Skip to content

Commit 16bd340

Browse files
committed
up
1 parent 9426c3b commit 16bd340

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

torchao/experimental/ops/mps/test/test_lowbit.py

+25-25
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,30 @@
7979

8080
if __name__ == "__main__":
8181
print("RUNNING UNIT TESTS")
82-
try:
83-
print("TRYING")
84-
for nbit in range(1, 8):
85-
print("NBIT", nbit)
86-
getattr(torch.ops.torchao, f"_linear_fp_act_{nbit}bit_weight")
87-
getattr(torch.ops.torchao, f"_pack_weight_{nbit}bit")
88-
except AttributeError:
89-
try:
90-
print("LOADING LIB")
91-
libname = "libtorchao_ops_mps_aten.dylib"
92-
libpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../cmake-out/lib/", libname))
93-
print("AT ", libpath)
94-
torch.ops.load_library(libpath)
95-
print("LOADED")
96-
except Exception as e:
97-
print("FAILED TO LOAD")
98-
raise e
99-
# raise RuntimeError(f"Failed to load library {libpath}")
100-
else:
101-
try:
102-
for nbit in range(1, 8):
103-
getattr(torch.ops.torchao, f"_linear_fp_act_{nbit}bit_weight")
104-
getattr(torch.ops.torchao, f"_pack_weight_{nbit}bit")
105-
except AttributeError as e:
106-
raise e
82+
# try:
83+
# print("TRYING")
84+
# for nbit in range(1, 8):
85+
# print("NBIT", nbit)
86+
# getattr(torch.ops.torchao, f"_linear_fp_act_{nbit}bit_weight")
87+
# getattr(torch.ops.torchao, f"_pack_weight_{nbit}bit")
88+
# except AttributeError:
89+
# try:
90+
# print("LOADING LIB")
91+
# libname = "libtorchao_ops_mps_aten.dylib"
92+
# libpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "../cmake-out/lib/", libname))
93+
# print("AT ", libpath)
94+
# torch.ops.load_library(libpath)
95+
# print("LOADED")
96+
# except Exception as e:
97+
# print("FAILED TO LOAD")
98+
# raise e
99+
# # raise RuntimeError(f"Failed to load library {libpath}")
100+
# else:
101+
# try:
102+
# for nbit in range(1, 8):
103+
# getattr(torch.ops.torchao, f"_linear_fp_act_{nbit}bit_weight")
104+
# getattr(torch.ops.torchao, f"_pack_weight_{nbit}bit")
105+
# except AttributeError as e:
106+
# raise e
107107

108108
# unittest.main()

0 commit comments

Comments
 (0)