[https://nvbugs/6143599][fix] DeepSeek-V3 OOM and artifacts path#14232
Conversation
- Lower kv_cache_free_gpu_memory_fraction from 0.85 to 0.75 for DeepSeek-V3/R1; the previous fraction left no headroom for the transient DeepGEMM MoE workspace and OOM'd at max_batch_size=2048. - Set PYTORCH_ALLOC_CONF=expandable_segments:True for DeepSeek-V3/R1 to reduce CUDA allocator fragmentation under stress. - Add ARTIFACTS_DIR constant anchored to this file's location; pass it to aiperf via --output-artifact-dir and use it as the default reader path in extract_stress_test_metrics, so writes and reads stay aligned independent of pytest cwd. Signed-off-by: Wangshanshan <[email protected]>
📝 WalkthroughWalkthroughThe stress test script consolidates artifact directory handling by introducing a centralized ChangesArtifact Directory Centralization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/integration/defs/stress_test/stress_test.py (2)
1-1:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUpdate the NVIDIA copyright year for this modified file.
This file was modified but still shows
2022-2024in the SPDX header on Line 1.As per coding guidelines, “Include NVIDIA copyright header on all new files; update year on modified files”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/integration/defs/stress_test/stress_test.py` at line 1, Update the SPDX header at the top of stress_test.py to reflect the current copyright year by changing "2022-2024" to "2022-2026" (i.e., update the year range in the existing SPDX comment); ensure the header remains the same format and spelling as the other files' NVIDIA SPDX header.
1370-1377:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate outdated docstring path description.
The docstring still describes a parent
defs/artifactsdefault, but Line 1379 now defaults toARTIFACTS_DIRunderstress_test/artifacts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/integration/defs/stress_test/stress_test.py` around lines 1370 - 1377, The docstring for the function parameter artifacts_dir is outdated (mentions defs/artifacts parent path) — update the documentation to reflect the current default path (ARTIFACTS_DIR under stress_test/artifacts) and any local-testing note; specifically modify the docstring lines that describe the default artifacts_dir and the commented local testing path so they mention ARTIFACTS_DIR (and/or stress_test/artifacts) instead of defs/artifacts, referencing the artifacts_dir parameter and the ARTIFACTS_DIR constant to keep them consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/integration/defs/stress_test/stress_test.py`:
- Around line 966-967: The fixed ARTIFACTS_DIR passed via the
"--output-artifact-dir" flag is causing recursive reads of historical
profile_export_aiperf.json files and contaminating Stage 2 metrics; update the
run setup to either (a) create a unique per-run artifact directory (e.g., append
a timestamp or run-id to ARTIFACTS_DIR) when constructing the
"--output-artifact-dir" value, or (b) explicitly delete or move any existing
profile_export_aiperf.json files under ARTIFACTS_DIR before starting profiling;
ensure changes touch the code that builds the CLI args containing
"--output-artifact-dir" and references ARTIFACTS_DIR, and apply the same
cleanup/unique-dir logic to the other occurrences mentioned (the other block
that passes ARTIFACTS_DIR).
- Around line 579-583: The code sets PYTORCH_ALLOC_CONF unconditionally for
DeepSeek models but never restores it, so capture the previous
os.environ.get("PYTORCH_ALLOC_CONF") before setting it, set
os.environ["PYTORCH_ALLOC_CONF"]="expandable_segments:True" only for the scope
where ServerConfig is created (the block around the if checking config.model_dir
and the subsequent test_server_config = ServerConfig(...)), and ensure you
restore the original value in a finally/cleanup step (reassign the previous
value or delete the env var if it was None) so later parametrized tests don't
inherit the override.
---
Outside diff comments:
In `@tests/integration/defs/stress_test/stress_test.py`:
- Line 1: Update the SPDX header at the top of stress_test.py to reflect the
current copyright year by changing "2022-2024" to "2022-2026" (i.e., update the
year range in the existing SPDX comment); ensure the header remains the same
format and spelling as the other files' NVIDIA SPDX header.
- Around line 1370-1377: The docstring for the function parameter artifacts_dir
is outdated (mentions defs/artifacts parent path) — update the documentation to
reflect the current default path (ARTIFACTS_DIR under stress_test/artifacts) and
any local-testing note; specifically modify the docstring lines that describe
the default artifacts_dir and the commented local testing path so they mention
ARTIFACTS_DIR (and/or stress_test/artifacts) instead of defs/artifacts,
referencing the artifacts_dir parameter and the ARTIFACTS_DIR constant to keep
them consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1c594b23-ffb2-4946-8b94-4de99297b36b
📒 Files selected for processing (1)
tests/integration/defs/stress_test/stress_test.py
|
/bot run |
|
PR_Github #48805 [ run ] triggered by Bot. Commit: |
|
PR_Github #48805 [ run ] completed with state
|
|
/bot run |
|
PR_Github #48860 [ run ] triggered by Bot. Commit: |
|
PR_Github #48860 [ run ] completed with state
|
|
/bot run |
|
PR_Github #48895 [ run ] triggered by Bot. Commit: |
|
PR_Github #48895 [ run ] completed with state
|
|
/bot run |
|
PR_Github #49057 [ run ] triggered by Bot. Commit: |
|
PR_Github #49057 [ run ] completed with state
|
|
/bot run |
|
PR_Github #49174 [ run ] triggered by Bot. Commit: |
|
PR_Github #49174 [ run ] completed with state
|
|
/bot run |
|
PR_Github #49304 [ run ] triggered by Bot. Commit: |
|
PR_Github #49304 [ run ] completed with state |
Summary by CodeRabbit
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)
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.