Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
test(fp8): use float32 on CPU in the scaled-dequant fallback test
Josh Corbettd4a00283f473
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.ymlindex 43ecc7590d..56121972d8 100644--- a/.github/workflows/python-tests.yml+++ b/.github/workflows/python-tests.yml@@ -62,8 +62,7 @@ jobs:env:PIP_USE_PEP517: '1'# One compute thread per worker. Torch otherwise sizes its thread pools to the whole- # machine, so `-n logical` puts vCPUs^2 threads on a runner: they fight for the same cores- # and, on the Windows CPU build, the fp8 tests take a native worker down with them.+ # machine, so `-n logical` puts vCPUs^2 threads on a runner that fight for the same cores.OMP_NUM_THREADS: '1'MKL_NUM_THREADS: '1'diff --git a/tests/backend/quantization/test_fp8_scaled.py b/tests/backend/quantization/test_fp8_scaled.pyindex 13a5a43250..22fa9cb4d5 100644--- a/tests/backend/quantization/test_fp8_scaled.py+++ b/tests/backend/quantization/test_fp8_scaled.py@@ -655,11 +655,15 @@ class TestCustomLinearIntegration:"""With the matmul off, the weight must still be dequantized *with* its scale."""set_fp8_matmul_enabled(False)dev = torch.device("cuda" if torch.cuda.is_available() else "cpu")+ # CPU inference is float32 in the product (TorchDevice.choose_torch_dtype). A bf16 input+ # here would also hit an illegal-instruction fault (0xC000001D) in the Windows CPU torch+ # build's bf16 GEMM on some GitHub runner CPUs, taking the whole xdist worker down.+ dtype = torch.bfloat16 if dev.type == "cuda" else torch.float32model = self._module(dev)- x = torch.randn(32, 64, device=dev, dtype=torch.bfloat16)+ x = torch.randn(32, 64, device=dev, dtype=dtype)got = model(x)- w_ref = dequantize_weight(model[0].weight, model[0].weight_scale, torch.bfloat16)+ w_ref = dequantize_weight(model[0].weight, model[0].weight_scale, dtype)expected = torch.nn.functional.linear(x, w_ref)assert torch.equal(got, expected)