File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 19
19
from torchao .utils import (
20
20
is_MI300 ,
21
21
is_sm_at_least_89 ,
22
- is_sm_at_least_90 ,
23
22
)
24
23
25
24
Tensor = torch .Tensor
@@ -168,13 +167,11 @@ def _check_hardware_support(
168
167
ValueError: If invalid granularity type is provided
169
168
"""
170
169
for _granularity in granularities :
171
- if isinstance (_granularity , PerTensor ):
172
- assert is_sm_at_least_89 () or is_MI300 (), (
173
- "PerTensor quantization only works for CUDA>=8.9 and MI300+"
174
- )
175
- elif isinstance (_granularity , PerRow ):
176
- assert is_sm_at_least_90 () or is_MI300 (), (
177
- "PerRow quantization only works for CUDA>=9.0 and MI300+"
170
+ if not isinstance (_granularity , (PerTensor , PerRow )):
171
+ raise ValueError (
172
+ f"Invalid granularity type: { _granularity } , only PerTensor or PerRow are supported."
178
173
)
179
- else :
180
- raise ValueError (f"Invalid granularity type: { _granularity } " )
174
+
175
+ assert is_sm_at_least_89 () or is_MI300 (), (
176
+ "Float8 dynamic quantization requires CUDA compute capability ≥8.9 or MI300+."
177
+ )
You can’t perform that action at this time.
0 commit comments