Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[None][test] Add accuracy benchmark in stress test#7561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
crazydemo merged 4 commits intoNVIDIA:mainfromcrazydemo:add_accuracy_in_stress
Sep 19, 2025

Conversation

@crazydemo
Copy link
Collaborator

@crazydemocrazydemo commentedSep 5, 2025
edited by coderabbitaibot
Loading

Summary by CodeRabbit

  • New Features

    • Added “stress-test-with-accuracy” mode combining performance, stress, and accuracy checks.
    • Runs baseline and post-stress accuracy, reports summary and relative drop, and enforces a 5% drop threshold.
    • Accuracy results are included alongside existing test reports.
  • Improvements

    • Increased token capacity for DeepSeek during accuracy runs.
    • Added server health safeguard to prevent duplicate server starts.
    • New accuracy settings: timeout, concurrency, retries, and max tokens/length.
  • Tests

    • Added preset stress-with-accuracy scenarios for multiple models.
  • Documentation

    • Updated overview of test modes and accuracy workflow.

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 FollowsTRT-LLM CODING GUIDELINES to the best of your knowledge.

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

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • 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.

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: DoesNOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx"(OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: DoesNOT 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: DoesNOT 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: DoesNOT update GitHub pipeline status.

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

--disable-multi-gpu-test(OPTIONAL) : Disable the multi-GPU tests. Note: DoesNOT 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 thestage-list parameter to access the appropriate container environment. Note: DoesNOT update GitHub check status.

For guidance on mapping tests to stage names, seedocs/source/reference/ci-overview.md
and thescripts/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.

@crazydemocrazydemo marked this pull request as ready for reviewSeptember 9, 2025 08:44
@coderabbitai
Copy link
Contributor

coderabbitaibot commentedSep 9, 2025
edited
Loading

📝 Walkthrough

Walkthrough

Adds an accuracy-testing workflow (GSM8K via lm_eval) to the stress test suite, introduces a new “stress-test-with-accuracy” mode, extends StressTestConfig with accuracy-related fields, integrates baseline and post-stress accuracy checks with threshold assertion, increases DeepSeek token limit, adds server health checks, and updates test list entries to invoke the new mode.

Changes

Cohort / File(s)Summary of Changes
Stress test accuracy integration
tests/integration/defs/stress_test/stress_test.py
Added “stress-test-with-accuracy” mode; extended StressTestConfig with accuracy fields (enable_accuracy_test, timeouts, concurrency, retries, token/length caps); increased DeepSeek max_num_tokens (1160→2048); auto-enable accuracy when mode set; added parse_accuracy_from_lm_eval_output and run_accuracy_test helpers; integrated baseline and post-stress GSM8K accuracy runs with timeout and regex parsing; compute/report accuracy drop and assert ≤5% drop; added server running pre-check; expanded logs/docs.
Test list updates
tests/integration/test_lists/qa/llm_function_stress.txt
Appended four parametrized entries invoking stress_test with “-with-accuracy” across DeepSeek-V3, DeepSeek-R1, and llama-v3-8b configurations.

Sequence Diagram(s)

sequenceDiagram    autonumber    participant T as PyTest Runner    participant ST as Stress Test Orchestrator    participant S as Model Server    participant E as lm_eval (GSM8K)    Note over T,ST: Mode: stress-test-with-accuracy (auto-enable accuracy)    T->>ST: start test_run_stress_test()    ST->>ST: ensure no server already running    ST->>S: start server    ST->>E: run_accuracy_test(phase="baseline")    E-->>ST: baseline accuracy (parsed)    ST->>ST: run performance + stress phases    ST->>E: run_accuracy_test(phase="post-stress")    E-->>ST: post-stress accuracy (parsed)    ST->>ST: compute drop and assert drop ≤ 5%    ST-->>T: report perf, stress, accuracy baseline/post and drop    ST->>S: shutdown server
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check nameStatusExplanationResolution
Description Check⚠️ WarningThe PR description only includes the template boilerplate without any substantive summary of the implemented changes or a list of relevant tests, leaving both the Description and Test Coverage sections empty.Please update the PR description to include a concise summary of the added accuracy benchmarking functionality, its motivation, and any new or updated tests under the Test Coverage section.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title Check✅ PassedThe title clearly summarizes the addition of an accuracy benchmark to the stress test and follows the repository’s ticket and type formatting conventions, making it concise and directly related to the main change.
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:pre_merge_checks:custom_checks:      -name:"Undocumented Breaking Changes"mode:"warning"instructions:|          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on thisDiscord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
Contributor

@coderabbitaicoderabbitaibot 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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/integration/defs/stress_test/stress_test.py (1)

90-94:Fix ServerConfig.url to honor configured host

The url property ignores the host field and hardcodes localhost, breaking remote-host scenarios and misleading logs.

Apply this diff:

-    def url(self) -> str:-        """Get the server URL"""-        return f"http://localhost:{self.port}"+    def url(self) -> str:+        """Get the server URL"""+        return f"http://{self.host}:{self.port}"
🧹 Nitpick comments (5)
tests/integration/defs/stress_test/stress_test.py (4)

1-14:Update copyright year to 2025

Per guidelines, prepend current year. Use 2022–2025.

-# SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

19-23:Docstring vs behavior mismatch for “stress-test-with-accuracy”

Docstring says it runs performance + stress + accuracy; code skips performance. Align one of them.

If skipping performance is intended, adjust the docstring:

-3. "stress-test-with-accuracy": Runs performance test, stress test, and accuracy tests (GSM8K)+3. "stress-test-with-accuracy": Runs stress test and accuracy tests (GSM8K), skipping the performance stage

Alternatively set run_performance = True for this mode.

Also applies to: 441-444


141-148:Right-size default accuracy load

Default accuracy_test_concurrency=512 and timeout=1200s can overwhelm smaller GPUs/servers and lengthen CI. Consider lower defaults (e.g., concurrency=64–128) and make them overridable via env or pytest args.

I can wire these to pytest options if helpful.


667-672:Accuracy tests: make failures actionable and resilient

  • Good baseline/post-stress flow and summary.
  • Use pytest.fail instead of assert to avoid Bandit S101 and ensure failures aren’t stripped with -O.
  • Guard against None accuracy values before computing drop.

Apply this diff:

-                        # Define threshold for significant accuracy drop (e.g., 5%)-                        accuracy_drop_threshold = 0.05  # 5%-                        # Assert that accuracy drop is within acceptable threshold-                        assert accuracy_drop_percentage <= (-                            accuracy_drop_threshold * 100-                        ), f"Accuracy drop {accuracy_drop_percentage:.2f}% exceeds threshold {accuracy_drop_threshold * 100}%"+                        # Define threshold for significant accuracy drop (e.g., 5%)+                        accuracy_drop_threshold = 0.05  # 5%+                        if accuracy_drop_percentage > accuracy_drop_threshold * 100:+                            pytest.fail(+                                f"Accuracy drop {accuracy_drop_percentage:.2f}% exceeds threshold {accuracy_drop_threshold * 100}%"+                            )

Also applies to: 706-751

tests/integration/test_lists/qa/llm_function_stress.txt (1)

1-4:Heavy accuracy runs: ensure they’re scoped to nightly/large runners

These four with-accuracy cases are long-running and resource-heavy. Consider marking them for nightly or large-runner labels (or gating via CI matrix) to avoid slowing PR CI.

I can add markers/filters to your test list and CI job if you share the CI config.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between6e712dd ande6e601e.

📒 Files selected for processing (2)
  • tests/integration/defs/stress_test/stress_test.py (10 hunks)
  • tests/integration/test_lists/qa/llm_function_stress.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{h,hpp,hh,hxx,cpp,cxx,cc,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Use only spaces, no tabs; indent with 4 spaces.

Files:

  • tests/integration/defs/stress_test/stress_test.py
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Python code must target Python 3.8+.
Indent Python code with 4 spaces; do not use tabs.
Maintain module namespace when importing; prefer 'from package.subpackage import foo' then 'foo.SomeClass()' instead of importing the class directly.
Python filenames should be snake_case (e.g., some_file.py).
Python classes use PascalCase names.
Functions and methods use snake_case names.
Local variables use snake_case; prefix 'k' for variables that start with a number (e.g., k_99th_percentile).
Global variables use upper SNAKE_CASE prefixed with 'G' (e.g., G_MY_GLOBAL).
Constants use upper SNAKE_CASE (e.g., MY_CONSTANT).
Avoid shadowing variables from an outer scope.
Initialize all externally visible members of a class in the constructor.
Prefer docstrings for interfaces that may be used outside a file; comments for in-function or file-local interfaces.
Use Google-style docstrings for classes and functions (Sphinx-parsable).
Document attributes and variables inline so they render under the class/function docstring.
Avoid reflection when a simpler, explicit approach suffices (e.g., avoid dict(**locals()) patterns).
In try/except, catch the most specific exceptions possible.
For duck-typing try/except, keep the try body minimal and use else for the main logic.

Files:

  • tests/integration/defs/stress_test/stress_test.py
**/*.{cpp,cxx,cc,h,hpp,hh,hxx,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

Prepend the NVIDIA Apache-2.0 copyright header with current year to the top of all source files (e.g., .cpp, .h, .cu, .py).

Files:

  • tests/integration/defs/stress_test/stress_test.py
🧠 Learnings (1)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxuPR: NVIDIA/TensorRT-LLM#6303File: tests/integration/test_lists/qa/examples_test_list.txt:494-494Timestamp: 2025-07-28T17:06:08.621ZLearning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • tests/integration/defs/stress_test/stress_test.py
🧬 Code graph analysis (1)
tests/integration/defs/stress_test/stress_test.py (1)
tests/integration/defs/disaggregated/test_disaggregated_single_gpu.py (1)
  • model_path (75-80)
🪛 Ruff (0.12.2)
tests/integration/defs/stress_test/stress_test.py

737-737: Use ofassert detected

(S101)


1144-1144:subprocess call: check for execution of untrusted input

(S603)


1172-1172: Do not catch blind exception:Exception

(BLE001)


1173-1173: Use explicit conversion flag

Replace with conversion flag

(RUF010)

🔇 Additional comments (3)
tests/integration/defs/stress_test/stress_test.py (3)

480-499:DeepSeek max_num_tokens bump: verify memory headroom

Increasing max_num_tokens to 2048 under attention DP and high batch sizes can push KV usage; ensure this aligns with BuildConfig and scheduler policy across both backends.

I can add a guard to compute expected KV memory and warn/skip if projected usage exceeds free fraction.


503-508:Propagation of accuracy flag looks good

enable_accuracy_test is correctly toggled for the new mode and preserved when overriding stress_time/timeout.

Also applies to: 516-518


343-346:Parametrize includes new mode correctly

The new “stress-test-with-accuracy” is wired into pytest param sets cleanly.

@crazydemocrazydemoforce-pushed theadd_accuracy_in_stress branch 2 times, most recently from8eb5f48 to854b4b6CompareSeptember 16, 2025 07:45
@crazydemo
Copy link
CollaboratorAuthor

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18744 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18744 [ run ] completed with stateSUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #14054 completed with status: 'FAILURE'

@crazydemo
Copy link
CollaboratorAuthor

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18864 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18864 [ run ] completed with stateSUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #14140 completed with status: 'FAILURE'

@crazydemo
Copy link
CollaboratorAuthor

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #19070 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #19070 [ run ] completed with stateSUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #14307 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check thererun report for details.

Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
@crazydemo
Copy link
CollaboratorAuthor

/bot reuse-pipeline

@crazydemocrazydemoenabled auto-merge (squash)September 19, 2025 07:35
@tensorrt-cicd
Copy link
Collaborator

PR_Github #19316 [ reuse-pipeline ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #19316 [ reuse-pipeline ] completed with stateSUCCESS
ReusingPR_Github #19070 for commita48bd61

@crazydemocrazydemo merged commit6b33bcc intoNVIDIA:mainSep 19, 2025
5 checks passed
Wong4j pushed a commit to Wong4j/TensorRT-LLM that referenced this pull requestSep 20, 2025
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
MrGeva pushed a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull requestSep 21, 2025
Signed-off-by: Ivy Zhang <25222398+crazydemo@users.noreply.github.com>
@xinhe-nvxinhe-nv deleted the add_accuracy_in_stress branchSeptember 26, 2025 06:23
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

@kaiyuxkaiyuxkaiyux approved these changes

@xinhe-nvxinhe-nvAwaiting requested review from xinhe-nv

@Wanli-JiangWanli-JiangAwaiting requested review from Wanli-Jiang

@dominicshanshandominicshanshanAwaiting requested review from dominicshanshan

@joyang-nvjoyang-nvAwaiting requested review from joyang-nv

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@crazydemo@tensorrt-cicd@kaiyux@dominicshanshan

[8]ページ先頭

©2009-2025 Movatter.jp