Skip to content
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
804d3ba
feat(trtllm): add TRT-LLM generation backend
shikicloud Apr 29, 2026
bf2e4b4
Custom build wheel
shuyixiong Jul 2, 2026
ea5db8e
build(trtllm): migrate from UV_FIND_LINKS stub wheel to PEP 517 path …
shuyixiong Jul 3, 2026
96b930a
fix(trtllm): correct workspace deps and scope cutlass override to vllm
shuyixiong Jul 3, 2026
0fdd97e
Pin nvidia-cutlass-dsl version in vllm
shuyixiong Jul 3, 2026
1d3ec3d
Drop custom modelopt build
shuyixiong Jul 4, 2026
aecea09
Fix eos_id issue
shuyixiong Jul 4, 2026
b4383ae
Rename trtllm workspace
shuyixiong Jul 5, 2026
c890270
Clean code
shuyixiong Jul 5, 2026
a9b0ecb
allow TRT-LLM backend for async GRPO
shikicloud Jul 6, 2026
054e598
Deprecate sync trtllm_worker code
shuyixiong Jul 13, 2026
cb5fdf1
refactor(trtllm): remove TRT-LLM HTTP server (to be added back in the…
shuyixiong Jul 13, 2026
639df96
Clean code
shuyixiong Jul 13, 2026
2c71521
Resolve rebase conflict
shuyixiong Jul 14, 2026
0f662bc
Reorder uv sync step and move cuDNN env setup before TE build
shuyixiong Jul 15, 2026
88ffff4
Resolve review comment
shuyixiong Jul 15, 2026
0f71d14
Fix copyright-check and pre-commit changes
shuyixiong Jul 15, 2026
e63554b
fixup! Resolve review comment
shuyixiong Jul 17, 2026
29e874c
Add dtensor nightly tests and release test
shuyixiong Jul 17, 2026
e2b4f87
Add trtllm setup dependency
shuyixiong Jul 17, 2026
595940d
add ccache
shikicloud Jul 19, 2026
eb38a90
fix(recipe): disable async checkpoint save for nanov3-30BA3B trtllm t…
shuyixiong Jul 20, 2026
d76c757
add trtllm ci test
shikicloud Jul 20, 2026
1881b66
Resolve rebase conflict
shuyixiong Jul 20, 2026
430caca
Change description on CI test
shikicloud Jul 20, 2026
17600b6
Pre-commit changes
shuyixiong Jul 20, 2026
94d8e83
Apply the taplo-format hook's changes manually
shuyixiong Jul 20, 2026
50f2315
Add newly added files to pyrefly.toml
shuyixiong Jul 20, 2026
e23c46b
Add IPC-ZMQ refit unit tests
shikicloud Jul 20, 2026
3c5de7c
Resolve review comment
shuyixiong Jul 20, 2026
2b789a2
Resolve review comment
shuyixiong Jul 20, 2026
2a14252
Minor fix
shuyixiong Jul 20, 2026
bcb8e50
Fix rebase conflict and Add logprobs_simple_format=True
shuyixiong Jul 20, 2026
f6a58f2
build(trtllm): single-source the fork ref in [tool.trtllm]
shuyixiong Jul 21, 2026
a107f87
Reduce compile jobs to reduce memory pressure
shuyixiong Jul 21, 2026
65f2baa
validate ccache reuse
shikicloud Jul 21, 2026
d170371
Resolve rebase conflict
shuyixiong Jul 21, 2026
71bf08e
Add TRT-LLM non-colocated async recipe
shikicloud Jul 21, 2026
4c8efbd
build: refresh uv lock
shikicloud Jul 21, 2026
4e43b6a
Support save partial ccache and fix L0 bugs
shikicloud Jul 21, 2026
39ff598
ci: reuse TRT-LLM ccache by base image
joyang-nv Jul 22, 2026
ed00a39
ci: cache TRT-LLM uv builds
joyang-nv Jul 22, 2026
6699ee2
ci: reduce TRT-LLM build log noise
joyang-nv Jul 22, 2026
f05b002
ci: focus TRT-LLM build logging
joyang-nv Jul 22, 2026
8984ac3
ci: finalize TRT-LLM build caching
joyang-nv Jul 22, 2026
74711d9
ci: skip TRT-LLM cache work when disabled
joyang-nv Jul 22, 2026
206a2ae
ci: optimize TRT-LLM cache reuse
joyang-nv Jul 22, 2026
f8ad15e
ci: simplify TRT-LLM build caching
joyang-nv Jul 22, 2026
340c8b5
ci: document TRT-LLM lockfile correctness guard
joyang-nv Jul 23, 2026
e927101
ci: clarify late lockfile consistency check
joyang-nv Jul 23, 2026
b479c39
ci: skip empty TRT-LLM cache deltas
joyang-nv Jul 23, 2026
c9dd7ec
ci: reuse prebuilt TRT-LLM wheel in L0 tests
joyang-nv Jul 23, 2026
205d9d2
test: pass required NeMo Gym rollout arguments
joyang-nv Jul 23, 2026
da2030d
Revert "test: pass required NeMo Gym rollout arguments"
joyang-nv Jul 23, 2026
cb95347
test: consume async NeMo Gym rollout results
RayenTian Jul 23, 2026
a119d48
Merge branch 'main' into shuyix/trtllm
joyang-nv Jul 23, 2026
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
3 changes: 2 additions & 1 deletion .agents/contributor-skills/build-and-dependency/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ docker buildx build -f docker/Dockerfile \
Skip optional backends to reduce build time:

```bash
# Skip vLLM and SGLang
# Skip vLLM, SGLang, and TRT-LLM
docker buildx build -f docker/Dockerfile \
--build-arg SKIP_VLLM_BUILD=1 \
--build-arg SKIP_SGLANG_BUILD=1 \
--build-arg SKIP_TRTLLM_BUILD=1 \
--tag nemo-rl:latest .
```

Expand Down
204 changes: 203 additions & 1 deletion .github/workflows/_build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ on:
default: ""
description: Additional Docker build contexts.
type: string
trtllm-ccache-tag:
required: false
default: ""
description: Prefix for the TRT-LLM ccache image tag; the target architecture and a hash of the effective base image are appended automatically. Empty disables the ccache.
type: string
trtllm-wheel-cache-tag:
required: false
default: ""
description: Prefix for the TRT-LLM wheel cache image tag; the target architecture and a hash of the effective base image are appended automatically. Empty disables the cache.
type: string
dockerfile:
required: true
description: Path to the Dockerfile.
Expand Down Expand Up @@ -83,6 +93,142 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Resolve TRT-LLM cache configuration
id: trtllm_cache
shell: bash
env:
BUILD_ARGS: ${{ inputs.build-args }}
CCACHE_TAG_PREFIX: ${{ inputs.trtllm-ccache-tag }}
WHEEL_TAG_PREFIX: ${{ inputs.trtllm-wheel-cache-tag }}
DOCKERFILE: ${{ inputs.dockerfile }}
PLATFORM: ${{ inputs.platform }}
run: |
set -euo pipefail

# Match Dockerfile semantics: any non-empty value skips TRT-LLM.
SKIP_VALUE=$(printf '%s\n' "$BUILD_ARGS" | sed -nE 's/^[[:space:]]*SKIP_TRTLLM_BUILD[[:space:]]*=(.*)$/\1/p' | tail -1)
SKIP_VALUE=$(printf '%s' "$SKIP_VALUE" | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//')
if [[ -n "$SKIP_VALUE" ]]; then
echo "TRT-LLM build is disabled by SKIP_TRTLLM_BUILD"
echo "enabled=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "enabled=true" >> "$GITHUB_OUTPUT"

# No cache configuration is needed when both image prefixes are empty.
if [[ -z "$CCACHE_TAG_PREFIX" && -z "$WHEEL_TAG_PREFIX" ]]; then
exit 0
fi

BASE_IMAGE=$(printf '%s\n' "$BUILD_ARGS" | sed -nE 's/^[[:space:]]*BASE_IMAGE[[:space:]]*=[[:space:]]*(.+)[[:space:]]*$/\1/p' | tail -1)
if [[ -z "$BASE_IMAGE" ]]; then
BASE_IMAGE=$(sed -nE 's/^[[:space:]]*ARG[[:space:]]+BASE_IMAGE[[:space:]]*=[[:space:]]*(.+)[[:space:]]*$/\1/p' "$DOCKERFILE" | tail -1)
fi
if [[ -z "$BASE_IMAGE" ]]; then
echo "Could not resolve BASE_IMAGE from build args or $DOCKERFILE" >&2
exit 1
fi

ARCH="${PLATFORM#*/}"
ARCH="${ARCH%%/*}"
if [[ -z "$ARCH" || "$PLATFORM" != */* || "$PLATFORM" == *,* ]]; then
echo "Expected a single OS/architecture platform, got: $PLATFORM" >&2
exit 1
fi

CACHE_KEY=$(printf '%s' "$BASE_IMAGE" | sha256sum | cut -c1-12)
{
echo "arch=$ARCH"
if [[ -n "$CCACHE_TAG_PREFIX" ]]; then
echo "ccache_tag=${CCACHE_TAG_PREFIX}-${ARCH}-${CACHE_KEY}"
fi
if [[ -n "$WHEEL_TAG_PREFIX" ]]; then
echo "wheel_tag=${WHEEL_TAG_PREFIX}-${ARCH}-${CACHE_KEY}"
fi
} >> "$GITHUB_OUTPUT"
echo "TRT-LLM caches use $BASE_IMAGE on $ARCH (key $CACHE_KEY)"

- name: Resolve TRT-LLM cache seeds
id: trtllm_cache_seed
if: steps.trtllm_cache.outputs.ccache_tag != '' || steps.trtllm_cache.outputs.wheel_tag != ''
shell: bash
env:
CCACHE_TAG: ${{ steps.trtllm_cache.outputs.ccache_tag }}
WHEEL_TAG: ${{ steps.trtllm_cache.outputs.wheel_tag }}
run: |
set -euo pipefail

resolve_seed() {
local name="$1"
local tag="$2"
local context="$3"
local description="$4"
[[ -n "$tag" ]] || return 0

local ref="$REGISTRY/$IMAGE_NAME:$tag"
if docker buildx imagetools inspect "$ref" >/dev/null 2>&1; then
echo "Using TRT-LLM $description seed $ref"
{
echo "${name}_ref=$ref"
echo "${name}_context=${context}=docker-image://$ref"
} >> "$GITHUB_OUTPUT"
else
echo "No TRT-LLM $description image found at $ref; starting with an empty cache"
fi
}

resolve_seed ccache "$CCACHE_TAG" trtllm-ccache-seed ccache
resolve_seed wheel "$WHEEL_TAG" trtllm-wheel-cache-seed "wheel cache"

- name: Configure TRT-LLM cache exports
id: trtllm_cache_export
if: steps.trtllm_cache.outputs.ccache_tag != '' || steps.trtllm_cache.outputs.wheel_tag != ''
shell: bash
env:
CCACHE_SEED_REF: ${{ steps.trtllm_cache_seed.outputs.ccache_ref }}
CCACHE_TAG: ${{ steps.trtllm_cache.outputs.ccache_tag }}
WHEEL_SEED_REF: ${{ steps.trtllm_cache_seed.outputs.wheel_ref }}
WHEEL_TAG: ${{ steps.trtllm_cache.outputs.wheel_tag }}
PLATFORM: ${{ inputs.platform }}
run: |
set -euo pipefail

configure_export() {
local name="$1"
local seed_ref="$2"
local output_context="$3"
local description="$4"
local max_incremental_layers=16
local cache_layout=incremental-v1
local export_mode=full

if [[ -n "$seed_ref" ]]; then
local image_metadata
image_metadata=$(docker buildx imagetools inspect "$seed_ref" --format "{{len (index .Image \"$PLATFORM\").RootFS.DiffIDs}} {{index (index .Image \"$PLATFORM\").Config.Labels \"com.nvidia.nemo-rl.cache-layout\"}}" 2>/dev/null || true)
if [[ -z "$image_metadata" ]]; then
image_metadata=$(docker buildx imagetools inspect "$seed_ref" --format '{{len .Image.RootFS.DiffIDs}} {{index .Image.Config.Labels "com.nvidia.nemo-rl.cache-layout"}}' 2>/dev/null || true)
fi

local layer_count existing_layout
read -r layer_count existing_layout <<< "$image_metadata"
if [[ "$existing_layout" == "$cache_layout" && "$layer_count" =~ ^[0-9]+$ ]] && (( layer_count < max_incremental_layers )); then
export_mode=incremental
echo "Appending an incremental $description layer to $seed_ref ($layer_count existing layers)"
echo "${name}_output_context=${output_context}=docker-image://$seed_ref" >> "$GITHUB_OUTPUT"
else
echo "Compacting TRT-LLM $description into a full snapshot (layout: ${existing_layout:-legacy}, layers: ${layer_count:-unknown})"
fi
fi
echo "${name}_mode=$export_mode" >> "$GITHUB_OUTPUT"
}

if [[ -n "$CCACHE_TAG" ]]; then
configure_export ccache "$CCACHE_SEED_REF" trtllm-ccache-output-base ccache
fi
if [[ -n "$WHEEL_TAG" ]]; then
configure_export wheel "$WHEEL_SEED_REF" trtllm-wheel-cache-output-base "wheel cache"
fi

- name: Get recently merged PR cache refs
id: recent_pr_cache_refs
uses: actions/github-script@v8
Expand Down Expand Up @@ -160,7 +306,10 @@ jobs:
push: true
context: .
platforms: ${{ inputs.platform }}
build-contexts: ${{ inputs.build-contexts }}
build-contexts: |
${{ inputs.build-contexts }}
${{ steps.trtllm_cache_seed.outputs.ccache_context }}
${{ steps.trtllm_cache_seed.outputs.wheel_context }}
build-args: ${{ inputs.build-args }}
cache-from: |
${{ steps.build_meta.outputs.cache-from }}
Expand All @@ -170,3 +319,56 @@ jobs:
tags: |
${{ steps.build_meta.outputs.tags }}
target: ${{ inputs.target }}

- name: Update TRT-LLM ccache image
# Cache mounts survive a failed RUN in the current Buildx builder. Run
# this step after both successful and failed image builds so completed
# compiler outputs are preserved for the next retry.
if: ${{ always() && !cancelled() && steps.trtllm_cache.outputs.enabled == 'true' && steps.trtllm_cache.outputs.ccache_tag != '' && steps.trtllm_cache_export.outcome == 'success' }}
uses: docker/build-push-action@v5
with:
file: ${{ inputs.dockerfile }}
push: true
context: .
platforms: ${{ inputs.platform }}
build-contexts: |
${{ inputs.build-contexts }}
${{ steps.trtllm_cache_seed.outputs.ccache_context }}
${{ steps.trtllm_cache_export.outputs.ccache_output_context }}
build-args: |
${{ inputs.build-args }}
CCACHE_EXPORT_NONCE=${{ github.run_id }}-${{ github.run_attempt }}
CCACHE_EXPORT_MODE=${{ steps.trtllm_cache_export.outputs.ccache_mode }}
cache-from: |
${{ steps.build_meta.outputs.cache-from }}
${{ steps.recent_pr_cache_refs.outputs.cache-from }}
no-cache: false
provenance: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.trtllm_cache.outputs.ccache_tag }}
target: trtllm-ccache

- name: Update TRT-LLM wheel cache image
# Persist the custom wheel even when the release build fails, so a
# retry can reuse completed compilation work.
if: ${{ always() && !cancelled() && steps.trtllm_cache.outputs.enabled == 'true' && steps.trtllm_cache.outputs.wheel_tag != '' && steps.trtllm_cache_export.outcome == 'success' }}
uses: docker/build-push-action@v5
with:
file: ${{ inputs.dockerfile }}
push: true
context: .
platforms: ${{ inputs.platform }}
build-contexts: |
${{ inputs.build-contexts }}
${{ steps.trtllm_cache_seed.outputs.wheel_context }}
${{ steps.trtllm_cache_export.outputs.wheel_output_context }}
build-args: |
${{ inputs.build-args }}
WHEEL_CACHE_EXPORT_NONCE=${{ github.run_id }}-${{ github.run_attempt }}
WHEEL_CACHE_EXPORT_MODE=${{ steps.trtllm_cache_export.outputs.wheel_mode }}
cache-from: |
${{ steps.build_meta.outputs.cache-from }}
${{ steps.recent_pr_cache_refs.outputs.cache-from }}
no-cache: false
provenance: false
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.trtllm_cache.outputs.wheel_tag }}
target: trtllm-wheel-cache
13 changes: 13 additions & 0 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,11 @@ jobs:
build-contexts: |
nemo-rl=.
${{ vars.UV_BUILD_CACHE == 'enabled' && format('uv-cache-seed=docker-image://{0}/{1}:uv-cache', needs.org-member-pre-flight.outputs.registry, vars.CI_CONTAINER_NAME) || '' }}
trtllm-ccache-tag: ${{ vars.TRTLLM_BUILD_CACHE == 'enabled' && 'trtllm-ccache' || '' }}
trtllm-wheel-cache-tag: ${{ vars.TRTLLM_BUILD_CACHE == 'enabled' && 'trtllm-wheel-cache' || '' }}
build-args: |
MAX_JOBS=4
TRTLLM_BUILD_JOBS=24
NEMO_RL_COMMIT=${{ needs.pre-flight.outputs.test_sha }}

build-container-gb200:
Expand Down Expand Up @@ -398,8 +401,11 @@ jobs:
build-contexts: |
nemo-rl=.
${{ vars.UV_BUILD_CACHE == 'enabled' && format('uv-cache-seed=docker-image://{0}/{1}:uv-cache', needs.gb200-config.outputs.registry, vars.CI_CONTAINER_NAME) || '' }}
trtllm-ccache-tag: ${{ vars.TRTLLM_BUILD_CACHE == 'enabled' && 'trtllm-ccache' || '' }}
trtllm-wheel-cache-tag: ${{ vars.TRTLLM_BUILD_CACHE == 'enabled' && 'trtllm-wheel-cache' || '' }}
build-args: |
MAX_JOBS=4
TRTLLM_BUILD_JOBS=8
NEMO_RL_COMMIT=${{ needs.pre-flight.outputs.test_sha }}

update-uv-cache:
Expand Down Expand Up @@ -522,6 +528,8 @@ jobs:
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L0_Unit_Tests_Sglang
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L0_Unit_Tests_Trtllm
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L0_Unit_Tests_Mcore
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L0_Unit_Tests_Mcore_Policy_1
Expand Down Expand Up @@ -582,6 +590,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- name: main
# Lfast reuses the main image. Until TRT-LLM lands on main, running this
# shard would make prefetch_venvs compile the cp313 wheel from source.
if: ${{ needs.pre-flight.outputs.test_level != 'Lfast' || matrix.script != 'L0_Unit_Tests_Trtllm' }}
uses: ./.github/actions/test-template
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
Expand Down Expand Up @@ -706,6 +717,8 @@ jobs:
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L1_Functional_Tests_SGLang
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L1_Functional_Tests_Trtllm
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L1_Functional_Tests_Gym
runner: ${{ needs.org-member-pre-flight.outputs.runner_prefix }}
- script: L1_Functional_Tests_GRPO_1
Expand Down
Loading
Loading