Skip to content

Commit 7748cef

Browse files
committed
libtorch free demo
1 parent 78a4e53 commit 7748cef

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

backends/aoti/aoti_backend.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ def move_to_cuda(obj):
107107
output_path = os.path.join(os.getcwd(), "aoti.so")
108108

109109
options: dict[str, typing.Any] = {
110+
"aot_inductor.debug_compile": True,
111+
"aot_inductor.embed_kernel_binary": True,
112+
"aot_inductor.link_libtorch": False,
110113
"aot_inductor.package_constants_in_so": True,
111114
"aot_inductor.output_path": output_path,
112115
"aot_inductor.force_mmap_weights": False,
@@ -126,10 +129,10 @@ def move_to_cuda(obj):
126129

127130
assert so_path == output_path, f"Expected {output_path} but got {so_path}"
128131

129-
check_call(
130-
f"patchelf --remove-needed libtorch.so --remove-needed libc10.so --remove-needed libtorch_cuda.so --remove-needed libc10_cuda.so --remove-needed libtorch_cpu.so --add-needed libcudart.so {output_path}",
131-
shell=True,
132-
)
132+
# check_call(
133+
# f"patchelf --remove-needed libtorch.so --remove-needed libc10.so --remove-needed libtorch_cuda.so --remove-needed libc10_cuda.so --remove-needed libtorch_cpu.so --add-needed libcudart.so {output_path}",
134+
# shell=True,
135+
# )
133136

134137
print("so_path", so_path)
135138

backends/aoti/runtime/aoti_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "shims/utils.h"
3333

3434
// Include CUDA AOTI shims
35-
#include <torch/csrc/inductor/aoti_torch/generated/c_shim_cuda.h>
35+
// #include <torch/csrc/inductor/aoti_torch/generated/c_shim_cuda.h>
3636

3737
namespace executorch {
3838
namespace backends {

export_and_run_aoti.sh

100644100755
File mode changed.

install_requirements.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def python_is_compatible():
7171
#
7272
# NOTE: If you're changing, make the corresponding change in .ci/docker/ci_commit_pins/pytorch.txt
7373
# by picking the hash from the same date in https://hud.pytorch.org/hud/pytorch/pytorch/nightly/
74-
NIGHTLY_VERSION = "dev20250811"
74+
NIGHTLY_VERSION = "dev20250910"
7575

7676

7777
def install_requirements(use_pytorch_nightly):
@@ -89,8 +89,8 @@ def install_requirements(use_pytorch_nightly):
8989
# Setting use_pytorch_nightly to false to test the pinned PyTorch commit. Note
9090
# that we don't need to set any version number there because they have already
9191
# been installed on CI before this step, so pip won't reinstall them
92-
f"torch==2.9.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torch",
93-
f"torchao==0.13.0{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchao",
92+
# f"torch==2.9.0.{NIGHTLY_VERSION}" if use_pytorch_nightly else "torch",
93+
f"torchao==0.14.0{NIGHTLY_VERSION}" if use_pytorch_nightly else "torchao",
9494
]
9595

9696
# Install the requirements for core ExecuTorch package.

0 commit comments

Comments
 (0)