|
14 | 14 | float8_weight_only,
|
15 | 15 | int4_weight_only,
|
16 | 16 | int8_weight_only,
|
| 17 | + int8_dynamic_activation_int8_weight, |
| 18 | + fpx_weight_only, |
17 | 19 | )
|
18 | 20 | from torchao.quantization.observer import PerRow, PerTensor
|
19 | 21 | from torchao.quantization.quant_api import quantize_
|
@@ -166,9 +168,33 @@ def test_tp_gemlite(self, dtype):
|
166 | 168 | return self._test_tp(dtype)
|
167 | 169 |
|
168 | 170 |
|
| 171 | +class TestInt8dqAffineQuantizedTensorParallel(TestAffineQuantizedTensorParallel): |
| 172 | + QUANT_METHOD_FN = staticmethod(int8_dynamic_activation_int8_weight) |
| 173 | + COMMON_DTYPES = [torch.bfloat16] |
| 174 | + |
| 175 | + @common_utils.parametrize("dtype", COMMON_DTYPES) |
| 176 | + @with_comms |
| 177 | + @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") |
| 178 | + def test_tp(self, dtype): |
| 179 | + return self._test_tp(dtype) |
| 180 | + |
| 181 | + |
| 182 | +class TestFpxwoAffineQuantizedTensorParallel(TestAffineQuantizedTensorParallel): |
| 183 | + QUANT_METHOD_FN = staticmethod(fpx_weight_only) |
| 184 | + COMMON_DTYPES = [torch.bfloat16] |
| 185 | + |
| 186 | + @common_utils.parametrize("dtype", COMMON_DTYPES) |
| 187 | + @with_comms |
| 188 | + @unittest.skipIf(not torch.cuda.is_available(), "Need CUDA available") |
| 189 | + def test_tp(self, dtype): |
| 190 | + return self._test_tp(dtype) |
| 191 | + |
| 192 | + |
169 | 193 | common_utils.instantiate_parametrized_tests(TestInt8woAffineQuantizedTensorParallel)
|
170 | 194 | common_utils.instantiate_parametrized_tests(TestInt4woAffineQuantizedTensorParallel)
|
171 | 195 | common_utils.instantiate_parametrized_tests(TestGemliteLayoutTensorParallel)
|
| 196 | +common_utils.instantiate_parametrized_tests(TestInt8dqAffineQuantizedTensorParallel) |
| 197 | +common_utils.instantiate_parametrized_tests(TestFpxwoAffineQuantizedTensorParallel) |
172 | 198 |
|
173 | 199 | # Run only on H100
|
174 | 200 | if torch.cuda.is_available() and torch.cuda.get_device_capability() >= (9, 0):
|
|
0 commit comments