Skip to content

[None][infra] Mount triton cache#11301

Closed
mlefeb01 wants to merge 1 commit into
NVIDIA:mainfrom
mlefeb01:mount-triton-cache
Closed

[None][infra] Mount triton cache#11301
mlefeb01 wants to merge 1 commit into
NVIDIA:mainfrom
mlefeb01:mount-triton-cache

Conversation

@mlefeb01
Copy link
Copy Markdown
Collaborator

@mlefeb01 mlefeb01 commented Feb 5, 2026

Summary by CodeRabbit

Release Notes

No user-facing changes in this release. This update includes infrastructure and testing configuration improvements.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Signed-off-by: Matt Lefebvre <mlefebvre@nvidia.com>
@mlefeb01 mlefeb01 requested review from a team as code owners February 5, 2026 03:59
@mlefeb01
Copy link
Copy Markdown
Collaborator Author

mlefeb01 commented Feb 5, 2026

/bot run

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

A data mount for ENROOT container runtime is added to the getMountListForSlurmTest function in the Jenkins test configuration, enabling the Triton configuration directory to be mounted from the service account into the container root directory.

Changes

Cohort / File(s) Summary
Jenkins Test Configuration
jenkins/L0_Test.groovy
Added ENROOT container runtime mount: /home/svc_tensorrt/.triton:/root/.triton to the mount list for Slurm tests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template structure with no actual content filled in. The Description and Test Coverage sections are completely empty, and no implementation details or rationale are provided. Fill in the Description section explaining why the Triton cache mount is needed and the Test Coverage section listing relevant tests that validate this change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[None][infra] Mount triton cache' clearly describes the main change: adding a mount for the Triton cache in infrastructure code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@jenkins/L0_Test.groovy`:
- Around line 903-906: The Triton compiler cache mount (the entry that maps
"/home/svc_tensorrt/.triton" into the container via the mounts list using
cluster.scratchPath and the explicit "/home/svc_tensorrt/.triton:/root/.triton"
mapping) can cause concurrent write races; either make the mount read-only if it
is a pre-populated shared cache (add :ro to
"/home/svc_tensorrt/.triton:/root/.triton") or, if jobs may populate the cache,
implement one of the recommended mitigations: upgrade Triton to a version with
the concurrency fixes, switch to NVIDIA Megatron-Core’s
ParallelFileCacheManager, or configure per-job unique TRITON_CACHE_DIRs (so each
job uses a local unique cache path) and remove the shared writable mount—apply
the chosen strategy consistently wherever mounts is constructed and where
TRITON_CACHE_DIR is set.

Comment thread jenkins/L0_Test.groovy
Comment on lines 903 to 906
mounts += [
"${cluster.scratchPath}:/scratch.trt_llm_data:ro",
"/home/svc_tensorrt/.triton:/root/.triton",
]
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the file to confirm the context
head -n 920 jenkins/L0_Test.groovy | tail -n 25

Repository: NVIDIA/TensorRT-LLM

Length of output: 1170


🌐 Web query:

Triton compiler cache concurrent writes safety thread safety

💡 Result:

Triton’s compiler cache has historically been not fully safe under concurrent multi-process writes to the same cache directory (common in distributed training / TP>1 on a shared filesystem).

  • Triton’s cache put() uses a “write temp → os.replace() to final name” pattern (atomic rename/replace), but other processes can still observe and act on transient temp files (e.g., via directory glob/listing) and then fail when those temp files get replaced, causing FileNotFoundError in multi-process runs. This exact failure mode is reported in triton-lang/triton issue trtllm-build llama3.1-8b failed #2688. (github.com)
  • Two upstream fixes addressed concurrency hazards:
    1. PR #3544: avoids temp-file name collisions across distributed setups (e.g., same PID/seed across nodes) by using UUIDs. (github.com)
    2. PR #4295: changes the cache manager to write into a process-private temp directory, so directory scans don’t pick up another process’s temp artifacts (and explains the race in detail). (github.com)
  • NVIDIA Megatron-Core ships a patched ParallelFileCacheManager explicitly to “prevent errors related to the building of the Triton compiler cache” under parallel ranks and on filesystems like Lustre, and notes it implements Triton PRs #3544 and #4295 (and suggests these changes should land in Triton 3.2). (docs.nvidia.com)

Practical guidance

  • If you see cache FileNotFoundError / odd behavior under distributed compilation: upgrade Triton to a version that includes PRs #3544 and #4295, or use Megatron-Core’s ParallelFileCacheManager, or ensure each process/rank uses a distinct TRITON_CACHE_DIR (ideally on local disk, not shared NFS/Lustre). (docs.nvidia.com)

Citations:


🏁 Script executed:

# Let's also search for any other references to the .triton mount or cache handling in the codebase
rg "\.triton|triton.*cache" --type groovy -i -A 2 -B 2

Repository: NVIDIA/TensorRT-LLM

Length of output: 339


Address Triton compiler cache concurrency safety with proper mitigation.

The Triton compiler cache at Line 905 does not specify an access mode, allowing concurrent writes from multiple SLURM jobs. This is a known issue in Triton's cache implementation—concurrent multi-process writes to the same cache directory can cause race conditions (FileNotFoundError) and cache corruption, particularly in distributed settings.

Simply adding :ro is insufficient if the cache needs to be populated dynamically. The proper upstream solutions are:

  1. Upgrade Triton to a version that includes concurrency fixes (PRs #3544 and #4295, expected in Triton 3.2+)
  2. Use NVIDIA Megatron-Core's ParallelFileCacheManager (explicitly designed to prevent cache corruption under parallel ranks)
  3. Use per-process cache directories on local disk by setting distinct TRITON_CACHE_DIR per job, rather than sharing a single cache

If this cache is intended as a pre-populated shared read-only resource, then adding :ro is appropriate. If jobs populate it dynamically, clarify the concurrency handling strategy and implement one of the upstream mitigations above.

🤖 Prompt for AI Agents
In `@jenkins/L0_Test.groovy` around lines 903 - 906, The Triton compiler cache
mount (the entry that maps "/home/svc_tensorrt/.triton" into the container via
the mounts list using cluster.scratchPath and the explicit
"/home/svc_tensorrt/.triton:/root/.triton" mapping) can cause concurrent write
races; either make the mount read-only if it is a pre-populated shared cache
(add :ro to "/home/svc_tensorrt/.triton:/root/.triton") or, if jobs may populate
the cache, implement one of the recommended mitigations: upgrade Triton to a
version with the concurrency fixes, switch to NVIDIA Megatron-Core’s
ParallelFileCacheManager, or configure per-job unique TRITON_CACHE_DIRs (so each
job uses a local unique cache path) and remove the shared writable mount—apply
the chosen strategy consistently wherever mounts is constructed and where
TRITON_CACHE_DIR is set.

@mlefeb01 mlefeb01 self-assigned this Feb 5, 2026
@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #34903 [ run ] triggered by Bot. Commit: 7010edb

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #34903 [ run ] completed with state SUCCESS. Commit: 7010edb
/LLM/main/L0_MergeRequest_PR pipeline #26924 completed with status: 'FAILURE'

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

@chzblych chzblych closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants