Skip to content

feat: Enable TensorRT-RTX build for linux-aarch64 (SBSA / DGX Spark)#4426

Open
narendasan wants to merge 1 commit into
mainfrom
narendasan/rtx-sbsa
Open

feat: Enable TensorRT-RTX build for linux-aarch64 (SBSA / DGX Spark)#4426
narendasan wants to merge 1 commit into
mainfrom
narendasan/rtx-sbsa

Conversation

@narendasan

Copy link
Copy Markdown
Collaborator

TensorRT-RTX 1.5 ships a Linux aarch64 (SBSA) distribution, but the repo only wired up the x86_64 and Windows RTX archives. This adds the aarch64 RTX archive and threads a rtx_sbsa config_setting (aarch64 + linux + compute_libs=rtx) through the TensorRT selects, so USE_TRT_RTX=1 builds resolve @tensorrt_rtx_sbsa on aarch64.

Build wiring:

  • MODULE.bazel: add tensorrt_rtx_sbsa http_archive (aarch64 tarball).
  • third_party/tensorrt_rtx/{archive,local}/BUILD: rtx_sbsa config_setting
    • lib/header/nvinfer selects (lib/libtensorrt_rtx.so, @cuda//:cudart).
  • ~20 repo BUILD files: rtx_sbsa config_setting + a :rtx_sbsa select entry mirroring :rtx_x86_64 (sourced from @tensorrt_rtx_sbsa).

Basic CI:

  • .github/workflows/build-test-linux-aarch64_rtx.yml: mirrors the standard SBSA build (build-test-linux-aarch64.yml) with use-rtx: true. BUILD-ONLY (no aarch64 GPU test runners) — it validates the RTX aarch64 wheel builds. The full manifest-based wiring will layer on in the CI redesign (test-dx).

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@narendasan
narendasan requested a review from lanluo-nvidia July 22, 2026 20:25
@meta-cla meta-cla Bot added the cla signed label Jul 22, 2026
@narendasan
narendasan requested review from SandSnip3r and tp5uiuc July 22, 2026 20:26
@github-actions github-actions Bot added component: tests Issues re: Tests component: lowering Issues re: The lowering / preprocessing passes component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: build system Issues re: Build system component: api [C++] Issues re: C++ API component: evaluators Issues re: Specific op evaluators component: runtime component: partitioning labels Jul 22, 2026
@github-actions
github-actions Bot requested a review from apbose July 22, 2026 20:27

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:26:58.191844+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:27:16.313461+00:00
@@ -2,11 +2,10 @@

import torch
from torch.fx import GraphModule, Node

from .pass_utils import clean_up_graph_after_modifications
-

_INT64_MAX = 2**63 - 1
_SYM_MIN = getattr(torch, "sym_min", None)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:26:59.786592+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:27:20.904802+00:00
@@ -2,11 +2,10 @@

import torch
from torch.fx import GraphModule, Node

from .pass_utils import clean_up_graph_after_modifications
-

_INT64_MAX = 2**63 - 1
_SYM_MIN = getattr(torch, "sym_min", None)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:26:58.610133+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:27:22.936809+00:00
@@ -2,11 +2,10 @@

import torch
from torch.fx import GraphModule, Node

from .pass_utils import clean_up_graph_after_modifications
-

_INT64_MAX = 2**63 - 1
_SYM_MIN = getattr(torch, "sym_min", None)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:26:58.542315+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-22 20:27:22.244056+00:00
@@ -2,11 +2,10 @@

import torch
from torch.fx import GraphModule, Node

from .pass_utils import clean_up_graph_after_modifications
-

_INT64_MAX = 2**63 - 1
_SYM_MIN = getattr(torch, "sym_min", None)

Comment thread .github/workflows/build-test-linux-aarch64_rtx.yml Fixed
Comment thread .github/workflows/build-test-linux-aarch64_rtx.yml Fixed
@narendasan
narendasan force-pushed the narendasan/rtx-sbsa branch from 24ae757 to 64f51d4 Compare July 23, 2026 01:33

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-23 01:33:23.576086+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/dynamo/lowering/passes/eliminate_sym_min_int64_max.py	2026-07-23 01:33:48.284954+00:00
@@ -2,11 +2,10 @@

import torch
from torch.fx import GraphModule, Node

from .pass_utils import clean_up_graph_after_modifications
-

_INT64_MAX = 2**63 - 1
_SYM_MIN = getattr(torch, "sym_min", None)

@lanluo-nvidia lanluo-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

package-name: torch_tensorrt
display-name: RTX - Build SBSA torch-tensorrt whl package
name: ${{ matrix.display-name }}
uses: ./.github/workflows/build_linux.yml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this calls into setup.py. From my understanding of the code, we may need to modify that one as well?

  • The if IS_SBSA: branch is tested before the USE_TRT_RTX branch (which is in x86_64) during compilation. This means an aarch64+RTX build resolves the pybind include dir to @tensorrt_sbsa (which is enterprise) while the Bazel core is modified to link @tensorrt_rtx_sbsa. We should have a tensorrt_rtx_sbsa_external_dir lambda and use it when IS_SBSA and USE_TRT_RTX.
  • Similarly the SBSA wheels have the wrong dependencies. get_sbsa_requirements today unconditionally appends tensorrt>=11.0.0,<11.1.0 and does not have a USE_TRT_RTX branch (unlike get_x86_64_requirements which emits tensorrt_rtx>=1.5.0.114,<1.6.0.0)
  • These wheels also can get pushed to pypi as it is right now : should we gate it till we see everything passes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These wheels also can get pushed to pypi as it is right now : should we gate it till we see everything passes?

I think its ok since we dont run tests on this channel in CI, there are no gpu runners

pre-script: packaging/pre_build_script.sh
env-var-script: packaging/env_vars.txt
post-script: packaging/post_build_script.sh
smoke-test-script: packaging/smoke_test_script.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this in CI

# Smoke test is intentionally disabled.
# The issue was smoke test installs the built torch_tensorrt wheel file and checks `import torch_tensorrt; print(torch_tensorrt.__version__)`
# Since tensorrt cannot be pip installable in CI, the smoke test will fail.
# One way we tried to handle it is manually install tensorrt wheel while by extracting from the tarball.
# However, the TensorRT-10.8.0.43/lib path doesn't seem to show up in LD_LIBRARY_PATH even if we explicitly set it.
# TODO: Implement a custom smoke_test script to verify torch_tensorrt installation.

is this still true? I checked it because of the comment below (where malformed wheels can get pushed to pypi potentially). Why is tensorrt not pip installable in CI (because of GPU requirements or something)? An import torch_tensorrt; assert ENABLED_FEATURES.tensorrt_rtx check would suffice here I think

TensorRT-RTX 1.5 ships a Linux aarch64 (SBSA) distribution that supports
DGX Spark (GB10, compute capability 12.1, experimental), but the repo only
wired up the x86_64 and Windows RTX archives. This adds the aarch64 RTX
archive and threads a rtx_sbsa config_setting (aarch64 + linux +
compute_libs=rtx) through the TensorRT selects, so USE_TRT_RTX=1 builds
resolve @tensorrt_rtx_sbsa on aarch64.

Build wiring:
- MODULE.bazel + toolchains/ci_workspaces/MODULE.bazel.tmpl: add tensorrt_rtx_sbsa
  http_archive (aarch64 tarball). CI regenerates MODULE.bazel from the template
  (pre_build_script.sh), so both must carry the archive.
- third_party/tensorrt_rtx/{archive,local}/BUILD: rtx_sbsa config_setting
  + lib/header/nvinfer selects (lib/libtensorrt_rtx.so, @cuda//:cudart).
- ~20 repo BUILD files: rtx_sbsa config_setting + a :rtx_sbsa select entry
  mirroring :rtx_x86_64 (sourced from @tensorrt_rtx_sbsa).
- setup.py: add tensorrt_rtx_sbsa_external_dir, used for IS_SBSA + USE_TRT_RTX
  (pybind include dir was resolving to @tensorrt_sbsa / enterprise); add a
  USE_TRT_RTX branch to get_sbsa_requirements (tensorrt_rtx>=1.5.0.114).

CI (build-only; no aarch64 GPU test runners):
- .github/workflows/build-test-linux-aarch64_rtx.yml: mirrors the standard SBSA
  build with use-rtx: true. Same triggers + upload behavior as the x86_64 RTX
  workflow; explicit read-only permissions (CodeQL). Superseded by ci-sbsa.yml in
  the CI-redesign (test-dx) head commit.
- lint: drop a stray blank line in eliminate_sym_min_int64_max.py.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@narendasan
narendasan force-pushed the narendasan/rtx-sbsa branch from 64f51d4 to 265360e Compare July 23, 2026 18:11
@github-actions github-actions Bot added component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [C++] Issues re: C++ API component: api [Python] Issues re: Python API component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: evaluators Issues re: Specific op evaluators component: lowering Issues re: The lowering / preprocessing passes component: partitioning component: runtime component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants