Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ build:cxx11_abi --define=abi=cxx11_abi
build:jetpack --//toolchains/dep_collection:compute_libs=jetpack

build:rtx --//toolchains/dep_collection:compute_libs=rtx
build:dlfw --//:package_executorch=false

build:ci_testing --define=torchtrt_src=prebuilt --cxxopt="-DDISABLE_TEST_IN_CI" --action_env "NVIDIA_TF32_OVERRIDE=0"
build:use_precompiled_torchtrt --define=torchtrt_src=prebuilt
Expand Down
148 changes: 0 additions & 148 deletions .github/scripts/setup-executorch-ci.sh

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/build-test-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ jobs:
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.filter-matrix.outputs.matrix }}
# it can pin to a specific version of executorch(can be a tag or a branch etc.)
executorch-ref: "main"


L0-dynamo-converter-tests:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/executorch-static-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ on:
description: 'Reference to checkout, defaults to ""'
default: ""
type: string
executorch-ref:
description: "ExecuTorch branch or tag to checkout; defaults to latest main"
default: "main"
type: string
test-infra-repository:
description: "Test infra repository to use"
default: "pytorch/test-infra"
Expand Down Expand Up @@ -73,10 +69,6 @@ jobs:
fail-on-empty: false
script: |
set -euo pipefail
export EXECUTORCH_ROOT="${RUNNER_TEMP}/executorch"
export EXECUTORCH_REF="${{ inputs.executorch-ref }}"
source .github/scripts/setup-executorch-ci.sh || exit 1

BAZELISK_VERSION="1.26.0"
case "$(uname -m)" in
aarch64|arm64)
Expand All @@ -99,6 +91,9 @@ jobs:

# this is to build the libtorchtrt.tar.gz
bazel build //:libtorchtrt --compilation_mode opt --config=linux
executorch_cmake_location="$(bazel query @executorch//:CMakeLists.txt --output=location)"
export EXECUTORCH_SOURCE_DIR="$(dirname "${executorch_cmake_location%%:*}")"
Comment thread
lanluo-nvidia marked this conversation as resolved.
export EXECUTORCH_ROOT="${EXECUTORCH_SOURCE_DIR}"
# this is to verify the end user's workflow
python -m pip install pyyaml
.github/scripts/verify-executorch-reference-runner.sh
23 changes: 19 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_zip")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")

bool_flag(
name = "package_executorch",
build_setting_default = True,
)

config_setting(
name = "windows",
constraint_values = [
Expand Down Expand Up @@ -39,6 +45,13 @@ config_setting(
},
)

config_setting(
name = "no_package_executorch",
flag_values = {
":package_executorch": "false",
},
)

pkg_tar(
name = "include_core",
package_dir = "include/torch_tensorrt",
Expand Down Expand Up @@ -199,10 +212,11 @@ pkg_tar(
pkg_tar(
name = "bin",
srcs = ["//cpp/bin/torchtrtc"] + select({
":rtx_win": [],
":windows": [],
":jetpack": [],
":no_package_executorch": [],
":rtx_win": [],
":rtx_x86_64": [],
":windows": [],
"//conditions:default": [
"//examples/executorch_reference_runner:example_executorch_runner",
],
Expand Down Expand Up @@ -241,10 +255,11 @@ pkg_tar(
":include_core",
":lib",
] + select({
":rtx_win": [],
":windows": [],
":jetpack": [],
":no_package_executorch": [],
":rtx_win": [],
":rtx_x86_64": [],
":windows": [],
"//conditions:default": [
":executorch_source_package",
":include_executorch",
Expand Down
19 changes: 11 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ git_override(

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")

local_torch = use_repo_rule("//toolchains:local_torch.bzl", "local_torch")
new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")

local_executorch = use_repo_rule("//toolchains:local_executorch.bzl", "local_executorch")
local_torch = use_repo_rule("//toolchains:local_torch.bzl", "local_torch")

# Detect ExecuTorch from the active Python environment (VIRTUAL_ENV / CONDA_PREFIX / PATH).
# Supports both pip-installed wheel layout and source-tree layout.
# Optional overrides:
# EXECUTORCH_ROOT=/path/to/executorch
# EXECUTORCH_SOURCE_DIR=/path/to/executorch
local_executorch(name = "executorch")
# Pinned to the ExecuTorch release/1.3 branch head.
new_git_repository(
name = "executorch",
build_file = "@//third_party/executorch:BUILD",
# latest commit in release/1.3 branch
commit = "6118688a095fd9697224f5cad72ce42db641c9cd",
recursive_init_submodules = True,
remote = "https://github.com/pytorch/executorch.git",
)

torch_nccl_detect = use_repo_rule("//toolchains/torch_nccl:defs.bzl", "torch_nccl_detect")

Expand Down
15 changes: 10 additions & 5 deletions docker/MODULE.bazel.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ git_override(
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")

local_executorch = use_repo_rule("//toolchains:local_executorch.bzl", "local_executorch")
new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")

torch_nccl_detect = use_repo_rule("//toolchains/torch_nccl:defs.bzl", "torch_nccl_detect")

Expand Down Expand Up @@ -64,9 +63,15 @@ new_local_repository(
build_file = "third_party/libtorch/BUILD"
)

# Detect ExecuTorch from EXECUTORCH_ROOT / EXECUTORCH_SOURCE_DIR, the active
# Python environment, or a nearby source checkout.
local_executorch(name = "executorch")
# Pinned to the ExecuTorch release/1.3 branch head.
new_git_repository(
name = "executorch",
build_file = "@//third_party/executorch:BUILD",
# latest commit in release/1.3 branch
commit = "6118688a095fd9697224f5cad72ce42db641c9cd",
recursive_init_submodules = True,
remote = "https://github.com/pytorch/executorch.git",
)


# This is a workaround (WAR), not a functional Bazel repository.
Expand Down
1 change: 0 additions & 1 deletion packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelis
&& mv bazelisk-linux-${BAZEL_PLATFORM} /usr/bin/bazel \
&& chmod +x /usr/bin/bazel

source .github/scripts/setup-executorch-ci.sh || exit 1

pip uninstall -y torch torchvision

Expand Down
19 changes: 15 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def load_dep_info():
CI_BUILD = False
USE_TRT_RTX = False

EXECUTORCH_REQUIREMENT = "executorch>=1.2.0"
Comment thread
lanluo-nvidia marked this conversation as resolved.


if "--use-rtx" in sys.argv:
USE_TRT_RTX = True
Expand Down Expand Up @@ -246,6 +248,10 @@ def build_libtorchtrt_cxx11_abi(
cmd.append("--config=rtx")
print("TensorRT RTX build")

if IS_DLFW_CI:
cmd.append("--config=dlfw")
print("DLFW build")

if IS_JETPACK:
cmd.append("--config=jetpack")
print("Jetpack build")
Expand Down Expand Up @@ -600,6 +606,9 @@ def run(self):
)

package_data = {}
executorch_header_package_data = (
[] if IS_DLFW_CI else ["include/torch_tensorrt/executorch/*.h"]
)

if not (PY_ONLY or NO_TS):
tensorrt_x86_64_external_dir = (
Expand Down Expand Up @@ -766,7 +775,7 @@ def run(self):
{
"torch_tensorrt": [
"include/torch_tensorrt/*.h",
"include/torch_tensorrt/executorch/*.h",
*executorch_header_package_data,
"include/torch_tensorrt/core/*.h",
"include/torch_tensorrt/core/conversion/*.h",
"include/torch_tensorrt/core/conversion/conversionctx/*.h",
Expand Down Expand Up @@ -796,7 +805,7 @@ def run(self):
{
"torch_tensorrt": [
"include/torch_tensorrt/*.h",
"include/torch_tensorrt/executorch/*.h",
*executorch_header_package_data,
"include/torch_tensorrt/core/*.h",
"include/torch_tensorrt/core/runtime/*.h",
"lib/*",
Expand Down Expand Up @@ -833,7 +842,9 @@ def get_x86_64_requirements(base_requirements):
requirements = base_requirements + ["numpy"]

if IS_DLFW_CI:
return requirements
return requirements + [
EXECUTORCH_REQUIREMENT,
]
else:
requirements = requirements + [
"torch>=2.13.0.dev,<2.14.0",
Expand All @@ -844,7 +855,7 @@ def get_x86_64_requirements(base_requirements):
]
else:
requirements = requirements + [
"executorch>=1.2.0",
EXECUTORCH_REQUIREMENT,
"tensorrt>=10.16.1,<10.17.0",
]
cuda_version = torch.version.cuda
Expand Down
Loading
Loading