-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Float8 support for AQT tensor parallel (#1003)
- Loading branch information
1 parent
d2982d5
commit 9e2a253
Showing
2 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import torch | ||
from torchao.testing.utils import copy_tests, TorchAOTensorParallelTestCase | ||
from torch.testing._internal.common_utils import run_tests | ||
from torchao.quantization import int8_weight_only | ||
from torchao.quantization import int8_weight_only, float8_weight_only | ||
|
||
class TestAffineQuantizedTensorParallel(TorchAOTensorParallelTestCase): | ||
pass | ||
class TestInt8woAffineQuantizedTensorParallel(TorchAOTensorParallelTestCase): | ||
QUANT_METHOD_FN = staticmethod(int8_weight_only) | ||
copy_tests(TorchAOTensorParallelTestCase, TestInt8woAffineQuantizedTensorParallel, "int8wo_tp") | ||
|
||
|
||
copy_tests(TorchAOTensorParallelTestCase, TestAffineQuantizedTensorParallel, "aqt_tp") | ||
# Run only on H100 | ||
if torch.cuda.is_available() and torch.cuda.get_device_capability() >= (9, 0): | ||
class TestFloat8woAffineQuantizedTensorParallel(TorchAOTensorParallelTestCase): | ||
QUANT_METHOD_FN = staticmethod(float8_weight_only) | ||
copy_tests(TorchAOTensorParallelTestCase, TestFloat8woAffineQuantizedTensorParallel, "fp8wo_tp") | ||
|
||
if __name__ == "__main__": | ||
run_tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters