Skip to content

Commit 82bc17e

Browse files
Back out "Add fbgemm as a dep for torchao in fbcode"
Differential Revision: D76400895 Pull Request resolved: #2360
1 parent eaaf787 commit 82bc17e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

torchao/dtypes/fbgemm_int4_tensor.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# LICENSE file in the root directory of this source tree.
66

77

8-
import importlib.util
98
from typing import List
109

1110
import torch
@@ -25,11 +24,11 @@
2524
aten = torch.ops.aten
2625

2726

28-
if importlib.util.find_spec("fbgemm_gpu") is None:
27+
try:
28+
from fbgemm_gpu.experimental.gen_ai.quantize import int4_row_quantize_zp, pack_int4
29+
except:
2930
int4_row_quantize_zp = None
3031
pack_int4 = None
31-
else:
32-
from fbgemm_gpu.experimental.gen_ai.quantize import int4_row_quantize_zp, pack_int4
3332

3433

3534
class FbgemmInt4Tensor(TorchAOBaseTensor):

0 commit comments

Comments
 (0)