File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 1717
1818from torch .library import impl
1919
20- # TODO rename this file to custom_ops_meta_registration.py
2120try :
2221 op = torch .ops .llama .sdpa_with_kv_cache .default
2322 assert op is not None
2423 op2 = torch .ops .llama .fast_hadamard_transform .default
2524 assert op2 is not None
2625except :
27- path = Path (__file__ ).parent .resolve ()
28- logging .info (f"Looking for libcustom_ops_aot_lib.so in { path } " )
29- libs = list (path .glob ("libcustom_ops_aot_lib.*" ))
26+ import glob
27+
28+ import executorch
29+
30+ executorch_package_path = executorch .__path__ [0 ]
31+ logging .info (f"Looking for libcustom_ops_aot_lib.so in { executorch_package_path } " )
32+ libs = list (
33+ glob .glob (
34+ f"{ executorch_package_path } /**/libquantized_ops_aot_lib.*" , recursive = True
35+ )
36+ )
3037 assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
3138 logging .info (f"Loading custom ops library: { libs [0 ]} " )
3239 torch .ops .load_library (libs [0 ])
You can’t perform that action at this time.
0 commit comments