[https://nvbugs/6529792][fix] Avoid GPT-OSS V2 cache estimation OOM - #17470
[https://nvbugs/6529792][fix] Avoid GPT-OSS V2 cache estimation OOM#17470jiaganc wants to merge 2 commits into
Conversation
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
Signed-off-by: Jiagan Cheng <jiaganc@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughThe GPT-OSS single-GPU accuracy test reduces ChangesGPT-OSS accuracy configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --only-qa-verify test accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_1gpu[v2_kv_cache-True-True-cutlass-auto] |
|
PR_Github #65195 [ run ] triggered by Bot. Commit: |
|
PR_Github #65195 [ run ] completed with state |
|
/bot run |
|
/bot run |
2 similar comments
|
/bot run |
|
/bot run |
|
PR_Github #65232 [ run ] triggered by Bot. Commit: |
|
PR_Github #65232 [ run ] completed with state
|
brnguyen2
left a comment
There was a problem hiding this comment.
Approving — the comments below are optional touch-ups, not blockers.
Sizing checks out: the mocker.patch.object(GSM8K, "MAX_OUTPUT_LEN", 8192) above runs before LLM(...), so this is 4096+8192+128 = 12416, and accuracy_core truncates prompts to MAX_INPUT_LEN and caps generation at MAX_OUTPUT_LEN, so the bound can't be exceeded at runtime.
Two things:
- This is a test-side workaround. The engine-init allocation still scales with
max_batch_size × max_seq_lenindependently of what the workload requests, so the same config outside this test hits the same wall. Is there a follow-up tracking that, or is the intent that the test config was simply unrealistic? - Please confirm CI ran the failing parametrization (
v2_kv_cache-True-True-cutlass-auto) on the hardware that originally reproduced it — the failure is memory-margin sensitive and won't show up on a card with more headroom.
| max_batch_size=720, | ||
| max_batch_size=512, | ||
| max_seq_len=GSM8K.MAX_INPUT_LEN + GSM8K.MAX_OUTPUT_LEN + 128, | ||
| **pytorch_config, |
There was a problem hiding this comment.
Add a one-line comment tying these two values to https://nvbugs/6529792 and noting that the +128 is headroom over the GSM8K limits. Without it, the next person tuning this test has no way to tell that raising max_seq_len back toward the model's 131k default reintroduces the init-time OOM.
Dev Engineer Review
TestGPTOSS::test_w4_1gpufor the GPT-OSS 120B single-H100 accuracy case.max_batch_sizefrom 720 to 512.max_seq_lento 12,416 tokens, including the GSM8K limits and a 128-token safety margin.git diff --checkpassed.QA Engineer Review
TestGPTOSS::test_w4_1gpu.Description
Fix the GPT-OSS 120B single-H100 V2 KV-cache accuracy test startup OOM tracked by https://nvbugs/6529792.
The test inherited the model's 131K-token sequence limit and configured a maximum batch size of 720. During engine initialization, temporary KV-cache estimation and executor resources exhausted H100 memory before the test reached profiling.
This change:
max_seq_lenat the GSM8K workload's configured maximum input plus output length plus a 128-token safety margin (12,416 tokens)max_batch_sizefrom 720 to 512The test continues to cover the V2 KV-cache, CUDA graph, and CUTLASS paths while sizing initialization resources for its actual workload.
Test Coverage
pre-commit run --files tests/integration/defs/accuracy/test_llm_api_pytorch.pyPYTHONPYCACHEPREFIX=/tmp/trtllm_gptoss_pr_pycache python3 -m py_compile tests/integration/defs/accuracy/test_llm_api_pytorch.pygit diff --checkThe full H100 accuracy case was not run locally because it requires an H100 and the GPT-OSS 120B model weights. CI should rerun
TestGPTOSS::test_w4_1gpuwithv2_kv_cache=True, CUDA graph enabled, and the CUTLASS MoE backend.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)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.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
To see a list of available CI bot commands, please comment
/bot help.