|
79 | 79 |
|
80 | 80 | if __name__ == "__main__":
|
81 | 81 | 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 |
107 | 107 |
|
108 | 108 | # unittest.main()
|
0 commit comments