Skip to content

add new cases for ckpts on HF#938

Open
noeyy-mino wants to merge 2 commits intoNVIDIA:mainfrom
noeyy-mino:noeyy/add_new_cases_for_ckpts
Open

add new cases for ckpts on HF#938
noeyy-mino wants to merge 2 commits intoNVIDIA:mainfrom
noeyy-mino:noeyy/add_new_cases_for_ckpts

Conversation

@noeyy-mino
Copy link
Contributor

@noeyy-mino noeyy-mino commented Feb 26, 2026

What does this PR do?

Type of change: new tests

Overview:
Add new deployment tests for newly added checkpoints on HF

Usage

pytest test_deploy.py --run-release

None

Testing

None

Before your PR is "Ready for review"

  • Make sure you read and follow Contributor guidelines and your commits are signed.
  • Is this change backward compatible?: Yes
  • Did you write any new necessary tests?: Yes
  • Did you add or update any necessary documentation?: No
  • Did you update Changelog?: No

Additional Information

N/A

Summary by CodeRabbit

  • New Features

    • Added support for new model deployments: Qwen3 variants (480B, 235B, 397B), Kimi K2.5, and additional Mixtral configurations.
  • Improvements

    • Expanded backend support for select models, including TensorRT-LLM integration for Nemotron models.
  • Chores

    • Renamed environment variable from MODELOPT_LOCAL_MODEL_ROOT to MODELOPT_LOCAL_EAGLE_MODEL for improved clarity.

Signed-off-by: noeyy-mino <174223378+noeyy-mino@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR refactors the deployment testing infrastructure to execute backend deployments in isolated subprocesses, renames internal methods to clarify implementation separation, and expands the test suite with additional model deployments and backend configurations.

Changes

Cohort / File(s) Summary
Deployment Subprocess Infrastructure
tests/_test_utils/deploy_utils.py
Introduced new module-level functions (_run_trtllm_deploy, _run_vllm_deploy, _run_sglang_deploy, _run_deploy_via_subprocess) to execute deployments in child processes. Renamed ModelDeployer methods from _deploy_<backend> to _deploy_<backend>_impl to separate interface from implementation. Reworked orchestration in ModelDeployer.run() to dispatch via subprocess mechanism. Refactored TensorRT-LLM deployment logic with model grouping, conditional kv_cache configuration, and streamlined LLM initialization.
Test Suite Expansion
tests/examples/llm_ptq/test_deploy.py
Added new model deployments for Qwen3 variants, Kimi-K2.5, and Mixtral configurations. Extended Nemotron backend support from vLLM-only to include TensorRT-LLM. Renamed environment variable from MODELOPT_LOCAL_MODEL_ROOT to MODELOPT_LOCAL_EAGLE_MODEL in test_eagle with updated skip logic and docstring.

Sequence Diagram

sequenceDiagram
    participant Test as Test Process
    participant Main as ModelDeployer.run()
    participant Sub as Child Process
    participant Impl as _deploy_<backend>_impl()
    participant Backend as Backend (TRT-LLM/vLLM/SGLang)

    Test->>Main: run(backend, model_id, ...)
    Main->>Sub: _run_deploy_via_subprocess(backend, ...)
    Note over Sub: Python snippet created<br/>with backend handler
    activate Sub
    Sub->>Impl: _run_<backend>_deploy()
    Impl->>Backend: Initialize & deploy model
    Backend-->>Impl: Model deployed / logs
    Impl-->>Sub: stdout/stderr captured
    Sub-->>Main: Process completes
    deactivate Sub
    Main-->>Test: Result reported to pytest
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding new test cases for checkpoints hosted on Hugging Face, which aligns with the PR objectives and the actual changes (new model deployments in test files).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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

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

Copy link
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: 2

🧹 Nitpick comments (1)
tests/_test_utils/deploy_utils.py (1)

86-90: pytest.fail() will not work correctly in subprocess context.

The subprocess runs as a standalone Python process without pytest's test session. Calling pytest.fail() in this context will raise an exception that terminates the subprocess with a non-zero exit code, but the actual failure message may not propagate cleanly to the parent test. The traceback.print_exc() before pytest.fail() does help, but consider simply raising a SystemExit(1) or a custom exception instead, since the parent already checks result.check_returncode().

♻️ Proposed simplification
     except Exception:
         import traceback
 
         traceback.print_exc()
-        pytest.fail(traceback.format_exc())
+        sys.exit(1)

Also applies to: 113-117, 140-144

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/_test_utils/deploy_utils.py` around lines 86 - 90, Replace the
subprocess-local calls to pytest.fail() inside the generic except Exception
handlers in tests/_test_utils/deploy_utils.py with a subprocess-friendly exit
(e.g., raise SystemExit(1) or re-raise the original exception) so the parent
process can detect the non-zero exit code and preserve the traceback; update
each except block shown (the one around the traceback.print_exc() and the
similar handlers at the other mentioned locations) to print the traceback and
then raise SystemExit(1) (or reraise) instead of calling pytest.fail().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/_test_utils/deploy_utils.py`:
- Around line 163-167: The generated f-string that inlines {model_id!r},
{attn_backend!r}, and {base_model!r} into executable Python code is a potential
code-injection risk; instead stop emitting executable code with repr
interpolation in deploy_utils and pass parameters safely (for example serialize
the args to JSON or write them to a temp file and have _run_{backend}_deploy
read them, or invoke the helper with explicit CLI args parsed by argparse).
Update the code that builds the string (the block that constructs code = f"""...
_run_{backend}_deploy(...)""") to produce a call that reads a JSON payload or
command-line flags and modify/ensure _run_{backend}_deploy (and any wrapper that
executes it) accepts and parses that serialized input rather than relying on
repr interpolation. Ensure model_id, attn_backend, base_model (and other inputs
like eagle3_one_model, tensor_parallel_size, mini_sm) are passed as safe
serialized values and not embedded directly into generated Python source.

In `@tests/examples/llm_ptq/test_deploy.py`:
- Around line 578-579: Fix the typo in the docstring that reads "speculative
models shoule be loaded by local path" by changing "shoule" to "should" in the
triple-quoted string beginning with "Skip test if MODELOPT_LOCAL_EAGLE_MODEL is
set but model doesn't exist locally." in tests/examples/llm_ptq/test_deploy.py
so the docstring reads "speculative models should be loaded by local path".

---

Nitpick comments:
In `@tests/_test_utils/deploy_utils.py`:
- Around line 86-90: Replace the subprocess-local calls to pytest.fail() inside
the generic except Exception handlers in tests/_test_utils/deploy_utils.py with
a subprocess-friendly exit (e.g., raise SystemExit(1) or re-raise the original
exception) so the parent process can detect the non-zero exit code and preserve
the traceback; update each except block shown (the one around the
traceback.print_exc() and the similar handlers at the other mentioned locations)
to print the traceback and then raise SystemExit(1) (or reraise) instead of
calling pytest.fail().

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b0ea4d and 7d9bba8.

📒 Files selected for processing (2)
  • tests/_test_utils/deploy_utils.py
  • tests/examples/llm_ptq/test_deploy.py

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.03%. Comparing base (d78797b) to head (1335f82).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #938      +/-   ##
==========================================
- Coverage   73.09%   72.03%   -1.06%     
==========================================
  Files         205      207       +2     
  Lines       22301    22718     +417     
==========================================
+ Hits        16300    16365      +65     
- Misses       6001     6353     +352     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: noeyy-mino <174223378+noeyy-mino@users.noreply.github.com>
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