Skip to content

Commit

Permalink
Load quantized_ops_aot_lib during portable load
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklandsign committed Aug 6, 2024
1 parent cfc68e4 commit 21c9673
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extension/pybindings/portable_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
ExecuTorchModule, # noqa: F401
)

try:
from pathlib import Path
libs = list(Path(__file__).parent.parent.parent.resolve().glob("**/libquantized_ops_aot_lib.*"))
del Path
assert len(libs) == 1, f"Expected 1 library but got {len(libs)}"
_torch.ops.load_library(libs[0])
except:
pass

# Clean up so that `dir(portable_lib)` is the same as `dir(_portable_lib)`
# (apart from some __dunder__ names).
del _torch

0 comments on commit 21c9673

Please sign in to comment.