Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion extension/llm/custom_ops/custom_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
op2 = torch.ops.llama.fast_hadamard_transform.default
assert op2 is not None
except:
libs = list(Path(__file__).parent.resolve().glob("libcustom_ops_aot_lib.*"))
import glob

import executorch

executorch_package_path = executorch.__path__[0]
logging.info(f"Looking for libcustom_ops_aot_lib.so in {executorch_package_path }")
libs = list(
glob.glob(
f"{executorch_package_path}/**/libquantized_ops_aot_lib.*", recursive=True
)
)
assert len(libs) == 1, f"Expected 1 library but got {len(libs)}"
logging.info(f"Loading custom ops library: {libs[0]}")
torch.ops.load_library(libs[0])
Expand Down
Loading