Repository navigation
Conversation
9674a64 to
fb1ca00
Compare
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-01 22:15:51.446168+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-01 22:16:28.941515+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM64
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-01 22:15:51.464168+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-01 22:16:34.624692+00:00
@@ -2614,11 +2614,14 @@
@pytest.mark.unit
def test_runtime_wheel_selects_driveos_bazel_config():
source = ast.unparse(
_class_method_def(_runtime_setup_tree(), "BazelBuild", "_build")
)
- assert "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'" in source
+ assert (
+ "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'"
+ in source
+ )
@pytest.mark.unit
def test_tensorrt_cmake_finder_parses_enterprise_version_macros(tmp_path):
cmake = shutil.which("cmake")fb1ca00 to
96aee61
Compare
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-06 02:06:41.217498+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-06 02:07:13.541907+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM64
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-06 02:06:41.235498+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-06 02:07:18.650488+00:00
@@ -2614,11 +2614,14 @@
@pytest.mark.unit
def test_runtime_wheel_selects_driveos_bazel_config():
source = ast.unparse(
_class_method_def(_runtime_setup_tree(), "BazelBuild", "_build")
)
- assert "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'" in source
+ assert (
+ "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'"
+ in source
+ )
@pytest.mark.unit
def test_tensorrt_cmake_finder_parses_enterprise_version_macros(tmp_path):
cmake = shutil.which("cmake")There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-07 16:35:15.595642+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-07 16:35:35.506309+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM64
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-07 16:35:15.607726+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-07 16:35:38.246336+00:00
@@ -2627,11 +2627,14 @@
@pytest.mark.unit
def test_runtime_wheel_selects_driveos_bazel_config():
source = ast.unparse(
_class_method_def(_runtime_setup_tree(), "BazelBuild", "_build")
)
- assert "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'" in source
+ assert (
+ "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'"
+ in source
+ )
@pytest.mark.unit
def test_tensorrt_cmake_finder_parses_enterprise_version_macros(tmp_path):
cmake = shutil.which("cmake")There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-08 21:30:24.174476+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-08 21:30:53.445776+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM64
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-08 21:30:24.191856+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-08 21:30:57.951163+00:00
@@ -2627,11 +2627,14 @@
@pytest.mark.unit
def test_runtime_wheel_selects_driveos_bazel_config():
source = ast.unparse(
_class_method_def(_runtime_setup_tree(), "BazelBuild", "_build")
)
- assert "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'" in source
+ assert (
+ "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'"
+ in source
+ )
@pytest.mark.unit
def test_tensorrt_cmake_finder_parses_enterprise_version_macros(tmp_path):
cmake = shutil.which("cmake")2cb12a2 to
88c47a5
Compare
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-08 21:32:53.913512+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-08 21:33:14.738364+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM64
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-08 21:32:53.926417+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/executorch/test_api.py 2026-10-08 21:33:17.727963+00:00
@@ -2627,11 +2627,14 @@
@pytest.mark.unit
def test_runtime_wheel_selects_driveos_bazel_config():
source = ast.unparse(
_class_method_def(_runtime_setup_tree(), "BazelBuild", "_build")
)
- assert "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'" in source
+ assert (
+ "build_config = 'driveos' if TARGET_PLATFORM == 'driveos' else 'linux'"
+ in source
+ )
@pytest.mark.unit
def test_tensorrt_cmake_finder_parses_enterprise_version_macros(tmp_path):
cmake = shutil.which("cmake")
--- /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/runtime/test_compile_memory.py 2026-10-08 21:32:53.934396+00:00
+++ /home/runner/work/TensorRT/TensorRT/tests/py/dynamo/runtime/test_compile_memory.py 2026-10-08 21:33:18.805099+00:00
@@ -18,21 +18,23 @@
env = {
k: v
for k, v in os.environ.items()
if k != "TORCHTRT_ENABLE_BUILDER_MALLOC_TRIM"
}
- with mock.patch.object(
- utils, "_glibc_malloc_trim", return_value=malloc_trim
- ), mock.patch.dict(os.environ, env, clear=True):
+ with (
+ mock.patch.object(utils, "_glibc_malloc_trim", return_value=malloc_trim),
+ mock.patch.dict(os.environ, env, clear=True),
+ ):
utils.trim_host_heap()
malloc_trim.assert_called_once_with(0)
def test_env_var_disables_trimming(self):
malloc_trim = mock.Mock(return_value=1)
- with mock.patch.object(
- utils, "_glibc_malloc_trim", return_value=malloc_trim
- ), mock.patch.dict(os.environ, {"TORCHTRT_ENABLE_BUILDER_MALLOC_TRIM": "0"}):
+ with (
+ mock.patch.object(utils, "_glibc_malloc_trim", return_value=malloc_trim),
+ mock.patch.dict(os.environ, {"TORCHTRT_ENABLE_BUILDER_MALLOC_TRIM": "0"}),
+ ):
utils.trim_host_heap()
malloc_trim.assert_not_called()
def test_missing_malloc_trim_is_a_no_op(self):
with mock.patch.object(utils, "_glibc_malloc_trim", return_value=None):| @@ -0,0 +1,31 @@ | |||
| """Expose the local DRIVE TensorRT SDK as @tensorrt_driveos, without downloads.""" | |||
|
|
|||
| def _drive_tensorrt_repository_impl(ctx): | |||
There was a problem hiding this comment.
Does this path change from DOS to DOS version or something? why do we need the env variable?
There was a problem hiding this comment.
removed the custom DRIVE TensorRT repository rule and its environment-variable override. DRIVE now uses new_local_repository(path="/usr/") with the existing local TensorRT BUILD file, following the NGC container layout. CMake retains its standard TensorRT_ROOT override for non-system SDK installations.
88c47a5 to
92e68d4
Compare
There was a problem hiding this comment.
There are some changes that do not conform to Python style guidelines:
--- /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-12 18:51:05.466751+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py 2026-10-12 18:51:38.741731+00:00
@@ -104,14 +104,11 @@
if WINDOWS_ON_ARM:
# setuptools does not know this project-specific option, so consume it
# before command-line processing. The environment variable remains
# supported for CI and scripted builds.
sys.argv.remove("--windows-on-arm")
-FORCED_WINDOWS_ARM64 = (
- WINDOWS_ON_ARM
- or TARGET_PLATFORM == "windows-arm64"
-)
+FORCED_WINDOWS_ARM64 = WINDOWS_ON_ARM or TARGET_PLATFORM == "windows-arm64"
if FORCED_WINDOWS_ARM64 and not IS_WINDOWS:
raise RuntimeError("Windows ARM64 builds are supported only on Windows")
if IS_DRIVEOS and not IS_AARCH64:
raise RuntimeError("DRIVE OS builds are supported only on Linux aarch64")
TARGET_WINDOWS_ARM64 = NATIVE_WINDOWS_ARM64 or FORCED_WINDOWS_ARM6492e68d4 to
ecde4ea
Compare
Summary
Add an opt-in DRIVE OS / Thor build configuration for the existing Torch-TensorRT + ExecuTorch deployment flow. Development began on DRIVE OS 7.2.4; the later target validation used DRIVE OS 7.2.5. The build selects the platform SDK rather than fixing support to one DRIVE or TensorRT release.
Export models in a Python/PyTorch development environment, then load the resulting programs in a native C++ ExecuTorch application. TensorRT regions run through
TensorRTBackend; supported fallback regions can run throughCudaBackend/ AOTInductor. This PR integrates the DRIVE build environment with these existing backends.“Python-only” describes the Torch-TensorRT build used for export; PyTorch/LibTorch is still present in that authoring environment. Native C++ inference is the Python-free and LibTorch-free deployment path.
Changes
--config=driveosfor Linux AArch64 dependency selection andTORCHTRT_TARGET_PLATFORM=driveosfor Python packaging.@cuda_driveosexposes the injected common/Thor headers and CUDA runtime directly. The Bazel DRIVE CUDA rule defaults to/usr/local/cudaand validates the DRIVE common/Thor headers,nvcc, and CUDA runtime.TORCHTRT_DRIVE_CUDA_ROOTis an optional override for a different toolkit location;TORCHTRT_DRIVE_CUDA_LIB_DIRis optional when runtime libraries are supplied separately./usrfor@tensorrt_driveos, following the existing NGC layout. This does not install files into/usror download the SBSA TensorRT archive. CMake retains the standardTensorRT_ROOToverride for other SDK locations.tensorrtdistribution. The PyTorch requirement follows the current ordinary-platform policy; the runtime-wheel build uses the platform TensorRT package. The existing DLFW CI dependency-management bypass remains.SDK discovery and dependency metadata do not establish version/ABI compatibility with every DRIVE or TensorRT release. No new delegate or blanket PyTorch-operator coverage is introduced.
Validation
Historical DRIVE OS 7.2.5 target validation — October 12, 2026
These results were obtained before the latest rebase, at Torch-TensorRT commit
92e68d48e7eb1eebefc61b163afc8d91e61f717a.7.2.5.0-4622957726.06-py313.3.3311.0.1.711.0.0.1142.16.0.dev20261009+cu1321.6.0.dev20261009+cu132a9665e25097b324a7116efa2bd6602287c9c064f.pteexecution passed full-output comparisons; these Python checks used PyTorch and are separate from the native deployment claim.The authoring setup preserved supplemental NGC libraries hidden by NVIDIA runtime injection. The test also recorded a failing standalone Bazel backend analysis and package dependency conflicts. Subsequent source changes address dependency selection and metadata, but the latest source still requires a fresh complete target run. The recorded container/native TensorRT and CUDA versions are evidence for this tested configuration, not a general compatibility guarantee.
Earlier DRIVE OS 7.2.4 development used NGC 26.05, TensorRT 10.16.1.11 and CUDA 13.2. Those results remain historical; they are not evidence that the latest rebased source has been retested on 7.2.4.
Latest source and local checks — October 29, 2026
2a2a856acac22330d5136d97c32c040431a13a88, rebased ontomainat39a0de8b5a145b999496f9535b6ca605e3d378c7.1.6.0.dev20261021, source5e379f610e034da507b48da61464679609517b52. This differs from the target-validation environment above.Follow-up work
Representative model examples are separate follow-up branches: BEVFormer-Tiny and SegFormer-B0. Their model code, export fixes, numerical validation and measurements are not part of this build-support PR.
The source branch retains its historical
abose/driveos-724-trt10.16-reviewname. Scope remains the ExecuTorch deployment path, not a complete port of every native Torch-TensorRT compiler/runtime target or validation of all DRIVE releases.