Skip to content

Commit 1ce8ecb

Browse files
committed
properly skip float8 inference tests without fbgemm
Summary: Makes the float8 inference tests pass if `fbgemm_gpu_genai` is not installed, nice for local development. Test Plan: ``` pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -s -x ``` Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 357c0eb ghstack-comment-id: 3460951577 Pull-Request: #3255
1 parent 3577306 commit 1ce8ecb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/quantization/quantize_/workflows/float8/test_float8_tensor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ def test_slice_and_copy_similar_to_vllm(self, granularity):
294294
self._test_slice_and_copy_similar_to_vllm(config)
295295

296296
@unittest.skipIf(not is_sm_at_least_90(), "Nedd sm90+")
297+
@unittest.skipIf(not _is_fbgemm_gpu_genai_available(), "Need fbgemm_gpu_genai")
297298
def test_bmm(self):
298299
# only support per row quantization
299300
config = Float8DynamicActivationFloat8WeightConfig(granularity=PerRow())
@@ -406,6 +407,7 @@ def test_cat(self, granularity, sizes):
406407
self.assertEqual(cat_qweight2.scale, ref_scale)
407408

408409
@unittest.skipIf(not is_sm_at_least_90(), "Nedd sm90+")
410+
@unittest.skipIf(not _is_fbgemm_gpu_genai_available(), "Need fbgemm_gpu_genai")
409411
def test_moe_weight_reshape_ops(self):
410412
# only per row quantization is supported for bmm
411413
granularity = PerRow()
@@ -416,6 +418,7 @@ def test_moe_weight_reshape_ops(self):
416418
# that should be moved here after v1 config is deprecated:
417419
# https://github.com/pytorch/ao/issues/2649
418420
@unittest.skipIf(not is_sm_at_least_90(), "Nedd sm90+")
421+
@unittest.skipIf(not _is_fbgemm_gpu_genai_available(), "Need fbgemm_gpu_genai")
419422
def test_expected_gpu_kernel_fbgemm(self):
420423
"""Making sure KernelPreference.FBGEMM calls correct quantize and gemm kernels
421424
and the bias add happens in the gemm kernel for per row quantization

0 commit comments

Comments
 (0)