Skip to content

build: bump TensorRT-LLM to feat/rl_rc (1.3.0rc28) - #4358

Merged
yuki-97 merged 7 commits into
mainfrom
shuyix/trtllm-rc28
Oct 8, 2026
Merged

yuki-97 merged 7 commits into
mainfrom
shuyix/trtllm-rc28

Conversation

@shuyixiong

@shuyixiong shuyixiong commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Bumps TensorRT-LLM to 1.3.0rc28.

  • 3rdparty/TensorRT-LLM-workspace/pyproject.toml: [tool.trtllm].ref -> f94eeb37, version -> 1.3.0rc28, dependencies resynced against the new branch's requirements.txt.
  • tools/build-custom-trtllm.sh: derive the bare nvshmem arch list from ARCH instead of hardcoding it, drop the upstream-removed modelopt patch, add the PyNvVideoCodec strip, NIXL/UCX build flags. Its BUILD_CUSTOM_TRTLLM_ARCH fallback tracks _backend.py's _DEFAULT_ARCH (90-real;100-real): the two must agree, since _backend.py folds the value into the wheel cache key while this script drives the actual compile.
  • docker/Dockerfile: libzmq3-dev + NIXL built from source, required by ENABLE_UCX=ON. ENABLE_UCX=ON is for PD disaggregation: TensorRT-LLM compiles every non-MPI cache-transceiver backend out of the wheel unless it is built against UCX, and cache_transceiver_backend=DEFAULT resolves to NIXL. The NIXL build is scoped to the TRT-LLM build in hermetic, so SKIP_TRTLLM_BUILD images do not pay for it (it takes ~42s). NIXL is built from source rather than installed from the published wheels because TensorRT-LLM's cmake needs nixl.h at build time (FindNIXL.cmake lists NIXL_INCLUDE_DIR in REQUIRED_VARS) and the wheels do not ship it.
  • pyproject.toml: trtllm extra -> torch 2.13.0 / torchvision 0.28.0 (which feat/rl_rc's requirements.txt now requires), tensorrt-llm 1.3.0rc28, and explicit nvidia-cutlass-dsl-libs-* pre-release pins so uv will admit 4.8.0.dev0. Drops the cuda-python/cuda-bindings <13.4 hold: rc28's _ipc_utils.py no longer reads cudaIpcMemHandle_t.reserved unconditionally.
  • nemo_rl/utils/cuda_ipc.py: docstring only -- TRT-LLM is no longer a torch 2.11 consumer, so it can open expandable-segment handles.
  • tests: cover _expanded_trtllm_url and the credential-redacting build-failure path; point the refit test at the finalize_weight_update branch rc28 takes.
  • uv.lock: regenerated for rc28 on torch 2.13.

grpo-qwen3-1.7b-2n4g-fsdp2-trtllm: wandb/nvidia/nemo-rl/runs/ipnfx8rs
image
image

grpo-qwen2.5-0.5b-1n4g-megatron-trtllm-noncolocated-async: https://forge.coreweave.com/wandb/nvidia/nemo-rl/runs/dm1mt7ko
image
image

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

@copy-pr-bot

copy-pr-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@shuyixiong
shuyixiong marked this pull request as ready for review October 6, 2026 04:50

@shuyixiong shuyixiong left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed by a team of six agents (RL/config expert, bug finder, test author, design reviewer, devil's advocate, plus the lead). 12 inline comments below; 6 candidate findings were challenged and dropped.

Nice work on the rationale comments. Several encode facts that would be unrecoverable six months from now — why the semicolons must stay backslash-escaped for the nvshmem CMake cache arg, why PIP_CONSTRAINT has to be unset, why BUILD_TESTS=OFF. The Not asserted: <upstream commit> <reason> convention on each relaxed patch site is a good micro-pattern, and the paired NIXL precondition/postcondition guards at both ends of the Dockerfile↔script contract are the right shape. Please keep this standard for build-script changes.

What I verified clean (so it isn't re-litigated)

  • The nvshmem ${NVSHMEM_ARCHS//;/'\\;'} escaping is correct — I ran the real lines against a fixture and got ...STRING=90\;100. The double backslash is load-bearing; a single one silently yields unescaped 90;100.
  • s/[af]$// is correct across all arch forms I tried (100f-real→100, 90a-real→90, 89-real→89, 90-virtual→90).
  • The deep_ep assert_patch_target target exists and is correctly scoped at f94eeb37 (CMakeLists.txt:153, inside ExternalProject_Add(nvshmem_project ...)'s CMAKE_CACHE_ARGS).
  • Dropping the cuda-python<13.4 / cuda-bindings<13.4 hold is justified — rc28's _ipc_utils.py now uses getattr(handle, "reserved", None) with a fallback.
  • [project].dependencies is a faithful, complete mirror of rc28's requirements.txt: 13 omissions all individually justified, zero unexplained extras, zero accidental drops. Every new pin resolves on PyPI.
  • Both control_action_decorator import paths exist at the pinned ref; _ray_utils.py is an explicit deprecation shim, so the try/except is correct.
  • set +x/set -x around the clone, unset PIP_CONSTRAINT scope, and python3 resolving to the venv interpreter are all correct. strenum→StrEnum is a cosmetic no-op (same distribution).

One note on CI

Only the lightweight public checks have run. The NVIDIA-runner unit/functional jobs are still gated behind copy-pr-bot vetting, so nothing has built this wheel yet — see the comment on pyproject.toml:250.

Generated by Claude Code

Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread pyproject.toml Resolved
Comment thread docker/Dockerfile Resolved
Comment thread pyproject.toml Resolved
Comment thread tools/build-custom-trtllm.sh Resolved
@shuyixiong

Copy link
Copy Markdown
Contributor Author

/ok to test 584098c

@shuyixiong shuyixiong added the CI:L1 Run doctests, unit tests, and functional tests label Oct 6, 2026
@shuyixiong

Copy link
Copy Markdown
Contributor Author

/ok to test 584098c

@shuyixiong
shuyixiong requested a review from yuki-97 October 7, 2026 01:44
@shuyixiong shuyixiong self-assigned this Oct 7, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Moving the TRT-LLM venv onto upstream feat/rl_rc and torch 2.13 is a welcome cleanup: it brings the trtllm extra in line with vLLM / mcore / automodel and retires the cuda-python <13.4 hold.

Scope: the full diff at 584098c, plus a per-fork comparison of uv.lock against the merge-base.

Checked:

  • Lock resolution: only the trtllm fork changes; base, vllm, mcore, automodel, sglang and nemo-gym resolve identical versions before and after.
  • Upstream at the pinned TRT-LLM ref: every tensorrt_llm import in trtllm_backend.py resolves, and _ipc_utils.py no longer reads .reserved unconditionally, so dropping the cuda-python hold is safe.
  • Workspace dependencies against upstream requirements.txt, line by line: every upstream requirement not listed is covered by a documented omission.
  • The four nvidia-cutlass-dsl-libs-*==4.8.0.dev0 pins in the trtllm extra are all required, libs-cu12 included: nvidia-cutlass-dsl 4.8.0.dev0 depends on libs-cu12 unconditionally (only libs-cu13 sits behind the cu13 extra), and uv admits a pre-release only when it is named. The 4.6.x releases used by the other venvs pull in libs-cu12 the same way.
  • Dockerfile: the global UCX / NIXL LD_LIBRARY_PATH entries do not shadow the pip nixl wheel used by checkpoint-engine refit, since its libraries use DT_RPATH and hash-renamed UCX.

Remaining comments are on dead code left by the exact rc28 pin (compat fallbacks, uv dependency-metadata blocks), a patch assert relaxed on a premise that does not hold at the pin, comments that no longer match the pinned ref or the lock, and the Dockerfile's NIXL / UCX additions to the base stage.

Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread pyproject.toml Resolved
Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread pyproject.toml Resolved
Comment thread docker/Dockerfile Resolved
Comment thread docker/Dockerfile Resolved
Comment thread docker/Dockerfile Resolved

@terrykong terrykong 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.

Thanks for this. Moving the trtllm extra to upstream feat/rl_rc and torch 2.13 is a good cleanup, and the fast turnaround on the self-review comments is appreciated. Handing url/ref/arch from [tool.trtllm] and _DEFAULT_ARCH to the build script keeps them in one place.

@yuki-97 asked me to look at the Dockerfile; the answer is in my reply on that thread. The main question there: does NeMo-RL need ENABLE_UCX=ON at all? The two other UCX/NIXL comments (on ARG NIXL_VERSION in the Dockerfile and on the nixl.h guard in build-custom-trtllm.sh) only matter if it stays.

For context, no action needed: the posted runs are dense models; no MoE model was run on the TRT-LLM backend.

CI is green at 584098c, including both container builds and the TRT-LLM L0/L1 lanes; lint passes.

Generated by Claude Code

Comment thread docker/Dockerfile Resolved
Comment thread tools/build-custom-trtllm.sh Resolved
Comment thread docker/Dockerfile Resolved
Comment thread docker/Dockerfile Resolved
Comment thread docker/Dockerfile Resolved
shuyixiong and others added 5 commits October 7, 2026 01:52
Adopts the trtllm-bump portion of #4230 (head 13d7278),
excluding the Dockerfile.trtllm split and its CI wiring.

- 3rdparty/TensorRT-LLM-workspace/pyproject.toml: [tool.trtllm].ref ->
  f94eeb37, version -> 1.3.0rc28, dependencies resynced against the new
  branch's requirements.txt.
- 3rdparty/TensorRT-LLM-workspace/_backend.py: ${VAR} URL expansion with
  credential redaction; _DEFAULT_ARCH -> 90-real;100-real.
- tools/build-custom-trtllm.sh: derive the bare nvshmem arch list from
  ARCH instead of hardcoding it, drop the upstream-removed modelopt patch,
  add the PyNvVideoCodec strip, NIXL/UCX build flags. Its BUILD_CUSTOM_TRTLLM_ARCH
  fallback tracks _backend.py's _DEFAULT_ARCH (90-real;100-real): the two
  must agree, since _backend.py folds the value into the wheel cache key
  while this script drives the actual compile.
- docker/Dockerfile: libzmq3-dev + NIXL built from source, required by
  ENABLE_UCX=ON. Retained here rather than moved to Dockerfile.trtllm.
- pyproject.toml: trtllm extra -> torch 2.13.0 / torchvision 0.28.0 (which
  feat/rl_rc's requirements.txt now requires), tensorrt-llm 1.3.0rc28, and
  explicit nvidia-cutlass-dsl-libs-* pre-release pins so uv will admit
  4.8.0.dev0. Drops the cuda-python/cuda-bindings <13.4 hold: rc28's
  _ipc_utils.py no longer reads cudaIpcMemHandle_t.reserved unconditionally.
- nemo_rl/utils/cuda_ipc.py: docstring only -- TRT-LLM is no longer a
  torch 2.11 consumer, so it can open expandable-segment handles.
- uv.lock: regenerated for rc28 on torch 2.13.

Not adopted from #4230: docker/Dockerfile.trtllm, the docker/Dockerfile
TRT-LLM removal that pairs with it, .github/** CI wiring, and the
tests/unit/L0_Unit_Tests_Trtllm.sh switch to the new image.

Co-authored-by: Erin Ho <[email protected]>
Signed-off-by: shuyixiong <[email protected]>
Regenerated with `uv lock` inside the rc28 container
(nemo-rl-rc28-20260929-aarch64.sqsh) on an aarch64 GB200 node, on top of
the rebase onto main where uv.lock was kept at main's resolution.

tensorrt-llm 1.3.0rc21 -> 1.3.0rc28, with the dependency-set changes that
follow from it: nvidia-cutlass-dsl* gain 4.8.0.dev0, cuda-python /
cuda-bindings / cuda-core / cuda-tile move past the old <13.4 hold,
flash-attn-4 -> 4.0.0b19, nvidia-matmul-heuristics added, and
tensorrt / tensorrt-cu13* / onnx-graphsurgeon drop out now that upstream
no longer pins them.

Verified with `uv lock --check` in the same container.

Signed-off-by: shuyixiong <[email protected]>
- build-custom-trtllm.sh: restore the `setuptools<80` assert_patch_target and
  revert its comment. The ceiling is still present at f94eeb37 (requirements.txt
  line 61), so the guard was dropped while its target still exists; the sed is
  load-bearing because the root pyproject overrides setuptools>=80.10.2 for CVE
  GHSA-58pv-8j8x-9vj2, and an unpatched ceiling would let build_wheel.py's pip
  step downgrade the shared venv.
- build-custom-trtllm.sh, 3rdparty/TensorRT-LLM-workspace/pyproject.toml:
  correct the PyNvVideoCodec rationale. 2.1.0 does exist on PyPI and `~=2.1.0`
  admits only it; it ships no cp313 wheel on any platform and no sdist, so the
  blocker is py3.13 rather than aarch64.
- pyproject.toml: resolve the apache-tvm-ffi TODO. tilelang 0.1.11 requires
  apache-tvm-ffi>=0.1.10,~=0.1.0 and would admit 0.1.13.post2; the binding
  <=0.1.11 ceilings are nemo-automodel[cuda] and tilelang 0.1.12.
- 3rdparty/TensorRT-LLM-workspace/pyproject.toml: add nvidia-modelopt to the
  upstream-dropped list, and record the apache-tvm-ffi (0.1.11) and xgrammar
  (0.2.7) overrides in the conflicts block.
- docker/Dockerfile: fail loudly when libcuda.so.1 is not found. `find` exits 0
  on no match, so `dirname ""` silently yielded "." and put the CWD on
  LD_LIBRARY_PATH instead of the CUDA driver stub directory.
- tests: cover _expanded_trtllm_url expansion/validation and assert the build
  failure message omits the expanded url; point the refit test at the branch
  rc28 actually takes by dropping _orig_mod from the mock module so upstream's
  _refit_modules does not skip it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: shuyixiong <[email protected]>
Patch guards and comment accuracy:
- build-custom-trtllm.sh: restore the asserted cutlass setup_library.py patch.
  The `setup_library.py develop --user` target is still present at f94eeb37, so
  the `if grep` guard's else branch was unreachable and a silent no-op would
  surface as an obscure cmake failure.
- build-custom-trtllm.sh: check the built wheel for the UCX and NIXL wrappers
  before it is cached. CMake sets ENABLE_UCX=0 and skips find_package(NIXL)
  without erroring when it cannot find them, so a wheel missing both wrappers
  would build, cache and be reused, aborting only at the first KV transfer.
- Comment fixes: cuda-python resolves to 13.4.1 (not 13.3.1); upstream already
  ships the nvidia-nccl-cu13 ceiling so nothing is raised locally; collectives.py
  now names only the sglang extra as torch 2.11; the llguidance override is
  >=1.7.0,<1.8.0.

Dead code after pinning tensorrt-llm==1.3.0rc28 exactly:
- trtllm_backend.py: import control_action_decorator from
  tensorrt_llm.executor.ray.utils directly and delegate the whole refit
  lifecycle to WorkerExtension (begin/finalize/finish). The hand-written begin
  step never called unwrap_compiled_model_for_refit, so with torch.compile on,
  load_weights matched nothing and allow_partial_loading=True silently kept the
  pre-refit weights. The pre-begin cuda.synchronize is dropped because
  py_executor's _handle_control_request already synchronizes before releasing
  the barrier control_action waits on.
- _backend.py, build-custom-trtllm.sh: drop the ${VAR} url expansion, its
  redaction code and its tests. Private sources clone over ssh like the vLLM and
  FlashInfer builds do; add GIT_SSH_COMMAND for the empty known_hosts in Docker.
- pyproject.toml + uv.lock: drop the CUTLASS DSL 4.5.x and TensorRT 10.16.1.11
  [[tool.uv.dependency-metadata]] overrides. Nothing resolves them after the
  bump -- the lock has cutlass-dsl 4.6.0/4.6.2/4.8.0.dev0 and no tensorrt*.

NIXL:
- Bump v1.3.1 -> v1.4.0 to match the pinned ref's docker/common/install_nixl.sh.
- Move the build out of `base` into the TRT-LLM block in `hermetic` so
  SKIP_TRTLLM_BUILD images no longer pay for it, and configure the library path
  via /etc/ld.so.conf.d + ldconfig instead of ENV (ENV cannot be set
  conditionally; this also discovers the arch dir rather than hardcoding both).
- Re-export NIXL_VERSION as ENV and fold it into the wheel cache key.
  build_wheel.py bundles the image's NIXL into the wheel, so without this a
  NIXL_VERSION bump silently reuses a wheel built against the old NIXL -- and
  the NGC base image otherwise reports its own NIXL_VERSION=1.0.1.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: shuyixiong <[email protected]>
[project].dependencies claimed `llguidance>=1.3.0,<1.4.0`, which was neither
upstream's pin nor what installs: upstream requirements.txt is `==0.7.29` and
the root override-dependencies pin of `llguidance>=1.7.0,<1.8.0` resolves this
venv to 1.7.6. Mirror upstream verbatim like the rest of the list and let the
global override settle it, the same way apache-tvm-ffi, xgrammar and
nvidia-cudnn-frontend are handled.

llguidance therefore moves out of "Intentional omissions" -- it is declared,
not omitted -- and into the "Conflicts against nemorl's own pins" block.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: shuyixiong <[email protected]>

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Scope: re-review of fix commits 88e6bfb and bcc1c6e against the open threads from the previous review and from @terrykong.

Remaining comments are on the NIXL ARG/ENV placement, which still invalidates the dependency layer on a NIXL bump, and a nit on the leftover model-loader hook shim.

Comment thread docker/Dockerfile Resolved
…ook shim

- docker/Dockerfile: declare `ARG`/`ENV NIXL_VERSION` after the TRT-LLM COPYs
  instead of with the other hermetic ARGs. BuildKit puts ARG and ENV into the
  environment of every later RUN, so declaring them above the dependency RUN
  meant a NIXL bump still busted that hour-long layer for every image,
  SKIP_TRTLLM_BUILD=1 included -- which is exactly what scoping the build was
  supposed to avoid. `_backend.py` still sees the ENV when it computes the wheel
  cache key, and `release` still inherits it from `hermetic`.
- trtllm_backend.py: drop `_call_model_loader_hook_if_available`. After the refit
  lifecycle moved to WorkerExtension its only remaining callers were the two
  `abort_update_weights` sites, and ModelLoader defines that method at the pinned
  ref (model_loader.py:1827), so the getattr guard was dead. Both except branches
  now call it directly, and the test that only exercised the shim is removed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: shuyixiong <[email protected]>
terrykong
terrykong previously approved these changes Oct 7, 2026
@shuyixiong

Copy link
Copy Markdown
Contributor Author

/ok to test 1b34726

Left over from replacing the try/except control_action_decorator import with a
direct one. Caught by the `ruff check --select I --fix` pre-commit hook.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: shuyixiong <[email protected]>
@shuyixiong

Copy link
Copy Markdown
Contributor Author

/ok to test 7a46655

@yuki-97
yuki-97 enabled auto-merge (squash) October 8, 2026 03:36
@yuki-97
yuki-97 merged commit 9046a59 into main Oct 8, 2026
212 of 214 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L1 Run doctests, unit tests, and functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants