Skip to content

Scripts and a skill to do per-layer benchmark using flashinfer#1980

Open
sychen52 wants to merge 3 commits into
NVIDIA:mainfrom
sychen52:flashinfer_benchmark
Open

Scripts and a skill to do per-layer benchmark using flashinfer#1980
sychen52 wants to merge 3 commits into
NVIDIA:mainfrom
sychen52:flashinfer_benchmark

Conversation

@sychen52

@sychen52 sychen52 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

add scripts and a skill to use flashinfer to do layerwise benchmark with different backends.

What does this PR do?

Type of change: ? new skill and scripts

Usage

python .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py \
    openai/gpt-oss-120b \
    --tp 4 --ep 4 --ms 8 16 \
    --flashinfer_repo $HOME/flashinfer \
    --workdir /tmp/gpt-oss-benchmark

or

python .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py \
    --flashinfer_repo $HOME/flashinfer \
    --ms 8 16 \
    --nks 1280,2880 2880,1024 \
    --moe_hidden_size 2880 \
    --moe_intermediate_size 2880 \
    --moe_num_experts 32 \
    --moe_top_k 4 \
    --workdir /tmp/gpt-oss-via-builtin

Or example prompt to trigger the skill:

Benchmark the kernel shapes for NVIDIA-Nemotron-3-Nano-30B-A3B

example output (TP1, EP4):

GEMM
M,1,8
up: 3712x2688
bf16,8.015,9.264
fp8_cudnn,5.888,6.032
fp8_cudnn_with_quant,8.576,8.544
fp8_cutlass,7.104,7.152
fp8_cutlass_with_quant,9.792,9.664
fp8_trtllm,7.408,7.168
fp8_trtllm_with_quant,10.096,9.680
nvfp4_cudnn,6.992,7.184
nvfp4_cudnn_with_quant,9.552,9.808
nvfp4_cutlass,7.040,7.200
nvfp4_cutlass_with_quant,9.600,9.824
nvfp4_trtllm,6.688,6.368
nvfp4_trtllm_with_quant,9.120,8.864
down: 2688x3712
bf16,9.152,9.472
fp8_cudnn,6.592,6.560
fp8_cudnn_with_quant,9.344,9.296
fp8_cutlass,7.744,7.744
fp8_cutlass_with_quant,10.496,10.480
fp8_trtllm,8.256,8.144
fp8_trtllm_with_quant,11.008,10.880
nvfp4_cudnn,8.160,8.096
nvfp4_cudnn_with_quant,10.912,10.928
nvfp4_cutlass,7.680,8.480
nvfp4_cutlass_with_quant,10.432,11.312
nvfp4_trtllm,6.880,7.360
nvfp4_trtllm_with_quant,9.424,10.080
fused_qkv: 4608x2688
bf16,8.512,8.464
fp8_cudnn,6.240,6.192
fp8_cudnn_with_quant,8.928,8.704
fp8_cutlass,7.696,7.551
fp8_cutlass_with_quant,10.384,10.063
fp8_trtllm,7.584,7.472
fp8_trtllm_with_quant,10.272,9.984
nvfp4_cudnn,7.632,7.487
nvfp4_cudnn_with_quant,10.192,10.111
nvfp4_cutlass,8.432,7.407
nvfp4_cutlass_with_quant,10.992,10.031
nvfp4_trtllm,6.592,6.848
nvfp4_trtllm_with_quant,9.024,9.343
attention_out/mamba_out: 2688x4096
bf16,10.112,9.888
fp8_cudnn,6.832,6.832
fp8_cudnn_with_quant,9.568,9.392
fp8_cutlass,8.000,8.096
fp8_cutlass_with_quant,10.736,10.656
fp8_trtllm,8.096,8.448
fp8_trtllm_with_quant,10.832,11.008
nvfp4_cudnn,8.320,8.447
nvfp4_cudnn_with_quant,11.104,11.184
nvfp4_cutlass,8.736,8.736
nvfp4_cutlass_with_quant,11.520,11.472
nvfp4_trtllm,7.584,7.104
nvfp4_trtllm_with_quant,10.144,9.728
mamba_in: 10304x2688
bf16,18.464,16.928
fp8_cudnn,8.640,8.559
fp8_cudnn_with_quant,11.328,11.072
fp8_cutlass,10.223,10.240
fp8_cutlass_with_quant,12.912,12.752
fp8_trtllm,9.040,9.056
fp8_trtllm_with_quant,11.728,11.568
nvfp4_cudnn,8.560,8.560
nvfp4_cudnn_with_quant,11.120,11.184
nvfp4_cutlass,9.392,9.568
nvfp4_cutlass_with_quant,11.952,12.192
nvfp4_trtllm,ERROR: FlashInfer produced no result row and no error message; see /home/scratch.shiychen_coreai/tmp/driver.log,ERROR: FlashInfer produced no result row and no error message; see /home/scratch.shiychen_coreai/tmp/driver.log
nvfp4_trtllm_with_quant,ERROR: FlashInfer produced no result row and no error message; see /home/scratch.shiychen_coreai/tmp/driver.log,ERROR: FlashInfer produced no result row and no error message; see /home/scratch.shiychen_coreai/tmp/driver.log

MoE
M,1,8
bf16_cutlass_moe,56.288,183.071
fp8_cutlass_moe,40.592,79.839
fp8_cutlass_moe_with_quant,43.280,82.351
nvfp4_cutlass_moe,40.383,63.392
nvfp4_cutlass_moe_with_quant,41.167,63.615

Testing

run locally

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • Is this change backward compatible?: ✅ / ❌ / N/A
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: ✅ / ❌ / N/A
  • Did you write any new necessary tests?: ✅ / ❌ / N/A
  • Did you update Changelog?: ✅ / ❌ / N/A
  • Did you get Claude approval on this PR?: ✅ / ❌ / N/A

Additional Information

Summary by CodeRabbit

  • New Features
    • Added a guided workflow for planning and running per-rank GEMM and fused-MoE kernel benchmarks.
    • Added automatic model inspection to derive supported kernel shapes, tensor-parallel and expert-parallel settings, routing details, and required benchmark parameters.
    • Added FlashInfer built-in benchmark execution with BF16, FP8, NVFP4, and activation-quantization timing.
    • Added structured previews, logs, CSV reports, error details, and dry-run validation.
  • Bug Fixes
    • Improved handling of unsupported layouts, padding, missing results, invalid settings, and benchmark failures.
  • Tests
    • Added extensive coverage for model inspection, argument validation, benchmark generation, quantization, routing, reporting, and error handling.

@sychen52
sychen52 requested a review from a team as a code owner July 16, 2026 00:39
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an operator-facing kernel benchmarking skill, meta-tensor model inspection for dense, Mamba, and MoE layouts, FlashInfer case execution, quantization timing, CSV reporting, and comprehensive validation tests.

Changes

Model Kernel Benchmarking

Layer / File(s) Summary
Skill workflow and operator contract
.agents/skills/benchmark-model-kernels/SKILL.md
Documents the decision workflow, shape preview, backend constraints, manual supplements, failure handling, and reporting artifacts.
Meta-model shape inspection and command derivation
.agents/skills/benchmark-model-kernels/scripts/benchmark_model.py, .agents/skills/benchmark-model-kernels/tests/test_benchmark_model.py
Loads models on meta tensors, derives dense, Mamba, and MoE shapes and routing, validates TP/EP constraints, builds runner arguments, and tests inspection behavior.
FlashInfer execution and result aggregation
.agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py, .agents/skills/benchmark-model-kernels/tests/test_benchmark_via_builtin.py
Generates GEMM and MoE cases, runs the FlashInfer driver, measures activation quantization, combines timings and errors, writes CSV results, and tests CLI and integration behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant benchmark_model.py
  participant Transformers
  participant benchmark_via_builtin.py
  participant flashinfer_benchmark.py
  participant combined_results.csv
  Operator->>benchmark_model.py: Provide model and TP/EP settings
  benchmark_model.py->>Transformers: Construct meta-tensor model
  Transformers-->>benchmark_model.py: Return module and config shapes
  benchmark_model.py->>benchmark_via_builtin.py: Pass derived GEMM, MoE, and routing arguments
  benchmark_via_builtin.py->>flashinfer_benchmark.py: Run generated benchmark cases
  flashinfer_benchmark.py-->>benchmark_via_builtin.py: Return timings and errors
  benchmark_via_builtin.py->>combined_results.csv: Write merged timing and error rows
Loading

Suggested reviewers: kevalmorabia97


🔕 Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @sychen52 via checkbox on 2026-07-20T18:20:07.912Z.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Security Anti-Patterns ❌ Error [IGNORED] benchmark_via_builtin.py adds forbidden # nosec B404 and # nosec B603 suppressions on subprocess import/Popen. Remove the Bandit suppressions. Keep the no-shell subprocess call if needed, but do not use # nosec; add a safety justification or get explicit codeowner approval.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: new skill docs and scripts for FlashInfer-based layerwise benchmarking.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 4

🤖 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 @.agents/skills/benchmark-model-kernels/scripts/benchmark_model.py:
- Around line 274-286: The argument parsers in benchmark_model.py (around parser
construction before _load_meta_model) and benchmark_via_builtin.py (around its
main parser) must validate all numeric benchmark inputs as positive integers.
Add shared positive-integer validation for --tp and --ep in benchmark_model.py,
and for M/N/K, MoE shape, and iteration arguments in benchmark_via_builtin.py,
so invalid non-positive values are rejected during parsing before model
inspection, shape generation, execution, or CUDA allocation.

In @.agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py:
- Around line 399-426: Update the CSV-writing flow in the results writer to emit
the separator rows required by the sectioned-table contract around both the GEMM
and MoE sections. Preserve the existing headers, data rows, and conditional
section ordering while restoring separators even when both sections are present.
- Around line 329-337: Update the FP8 branch in _quant_times() so that when
vllm_ops is unavailable it records an explicit warning or error result for the
affected quantization case instead of continuing silently. Ensure
_write_results() preserves and emits that fallback cell as the corresponding
_with_quant row, while leaving available vLLM and NVFP4 execution unchanged.
- Around line 525-537: Update the result-loading block around _run_driver and
builtin_csv so a missing builtin_results.csv is treated as an empty row set
instead of raising FileNotFoundError. Preserve normal CSV parsing when the file
exists, then continue completed_tags and per-case error aggregation so
combined_results.csv is still produced with missing-case reasons.
🪄 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: 8a542345-e207-4bbb-9999-64efe1192a93

📥 Commits

Reviewing files that changed from the base of the PR and between 95ee9c4 and 4d9cabf.

📒 Files selected for processing (7)
  • .agents/skills/benchmark-model-kernels/SKILL.md
  • .agents/skills/benchmark-model-kernels/agents/openai.yaml
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py
  • .agents/skills/benchmark-model-kernels/tests/evals.json
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_model.py
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_via_builtin.py

Comment thread .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py Outdated
Comment thread .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py Outdated
@sychen52
sychen52 force-pushed the flashinfer_benchmark branch from 4d9cabf to 9a63807 Compare July 17, 2026 19:05
@sychen52
sychen52 requested a review from a team as a code owner July 17, 2026 19:05
@sychen52
sychen52 requested a review from kevalmorabia97 July 17, 2026 19:05
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.21%. Comparing base (f479e78) to head (567481d).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1980      +/-   ##
==========================================
- Coverage   77.87%   74.21%   -3.67%     
==========================================
  Files         522      525       +3     
  Lines       58452    62462    +4010     
==========================================
+ Hits        45522    46358     +836     
- Misses      12930    16104    +3174     
Flag Coverage Δ
unit 54.86% <ø> (-0.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai coderabbitai Bot left a comment

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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 2

🤖 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 @.agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py:
- Around line 350-374: Update the per-spec quantization timing loop in
_quant_times to catch CUDA allocation, CUPTI, runner, and kernel timing
exceptions without aborting the overall benchmark. For each failed (kind, m, k)
specification, store an explicit error result using the existing error-value
convention like _FP8_QUANT_UNAVAILABLE, emit an appropriate warning if needed,
and continue so completed driver results can still be written to
combined_results.csv.

In `@pyproject.toml`:
- Around line 291-297: Remove the .agents/skills/benchmark-model-kernels/ entry
from Bandit’s exclude_dirs configuration so executable benchmark scripts remain
covered. Add a narrow suppression only at the specific reviewed false-positive
call site within those scripts, without excluding the broader skill directory.
🪄 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: db8b82d3-7d5e-4dbd-8b91-1a668cabacc9

📥 Commits

Reviewing files that changed from the base of the PR and between 4d9cabf and 9a63807.

📒 Files selected for processing (8)
  • .agents/skills/benchmark-model-kernels/SKILL.md
  • .agents/skills/benchmark-model-kernels/agents/openai.yaml
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py
  • .agents/skills/benchmark-model-kernels/tests/evals.json
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_model.py
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_via_builtin.py
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .agents/skills/benchmark-model-kernels/agents/openai.yaml
  • .agents/skills/benchmark-model-kernels/tests/evals.json
  • .agents/skills/benchmark-model-kernels/SKILL.md

Comment thread pyproject.toml Outdated
with different backends.

Signed-off-by: Shiyang Chen <shiychen@nvidia.com>
@sychen52
sychen52 force-pushed the flashinfer_benchmark branch from 9a63807 to 2cd8630 Compare July 17, 2026 21:01

@coderabbitai coderabbitai Bot left a comment

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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

🤖 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 @.agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py:
- Around line 33-36: Update the import and subprocess setup around argument
parsing, `run_benchmark`, and the child execution flow so `--flashinfer_repo`
controls both `flashinfer` and `flashinfer.testing` resolution. Add the selected
checkout root to `sys.path` before importing those modules, including when the
child runs from `benchmarks_dir`, and ensure imports cannot silently use an
unrelated installed FlashInfer.
🪄 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: 9c1b8ca4-8092-4081-b771-83772f0e2180

📥 Commits

Reviewing files that changed from the base of the PR and between 9a63807 and 2cd8630.

📒 Files selected for processing (6)
  • .agents/skills/benchmark-model-kernels/SKILL.md
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_model.py
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_via_builtin.py
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (3)
  • pyproject.toml
  • .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py
  • .agents/skills/benchmark-model-kernels/tests/test_benchmark_model.py

Comment thread .agents/skills/benchmark-model-kernels/scripts/benchmark_via_builtin.py Outdated
@sychen52 sychen52 changed the title add scripts and a skill to use flashinfer to do layerwise benchmark Scripts and a skill to do per-layer benchmark using flashinfer Jul 17, 2026

@cjluo-nv cjluo-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Bot review (bedrock-claude-opus-4-8) — DM the bot to share feedback.

New self-contained skill (benchmark-model-kernels) with two scripts that (1) derive per-rank GEMM/MoE benchmark shapes from a HF config on meta tensors and (2) drive FlashInfer's built-in benchmark for BF16/FP8/NVFP4. +2301/-1, 3 non-test files + 2 test files + a bandit-exclude tweak.

Design review (complexity gate fired): The problem — a per-layer microbenchmark harness that derives per-rank shapes from model configs without loading weights — has no existing in-repo equivalent (searched; other skills are task-specific and use tests.json eval metadata, not benchmarking). This wraps FlashInfer's flashinfer_benchmark.py rather than reimplementing it; the value-add is the config→shape derivation. OmegaConf/Hydra/Jinja aren't relevant. The pytest-in-skill layout is already an established convention (pyproject has a .agents/skills/*/tests/test_*.py per-file-ignore). Design looks reasonable and the PR body gives concrete usage, though the rationale is brief.

Licensing: clean — new files carry the canonical LICENSE_HEADER NVIDIA header verbatim; no LICENSE/vendoring changes. The bandit exclude_dirs addition is narrowly scoped to the new skill (justified by the intentional subprocess use, which is invoked without a shell and gates trust_remote_code behind an explicit flag).

Correctness: I traced the shape-derivation logic (fused QKV incl. GQA replication, gate/up, Mamba-2, ModuleList vs stacked/direct experts, EP-vs-TP intermediate sharding, routing derivation, expert audit, override rejection) and it holds up; the unit tests are genuinely meaningful and internally consistent across Llama/Mixtral/GptOss/NemotronH plus edge cases.

Why nudge (not approve): (1) sizable new subsystem worth an owner's architectural eyes; (2) coverage gap — benchmark_via_builtin.py's GPU/FlashInfer runtime paths (_run_driver real invocation, _quant_times/_nvfp4_runner/_fp8_runner CUDA timing) are mocked out and never exercised in CI, consistent with the repo's known GPU-only coverage risk; (3) CHANGELOG left unmarked — acceptable for an internal agent skill (no shipped library API change), but worth confirming. No prompt-injection concerns in the untrusted content (SKILL.md's "do not override" prose targets the skill's agent user, not the reviewer).

@Edwardf0t1 Edwardf0t1 left a comment

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.

Posting two inline comments from my review: one on CI test discovery, one on TP×EP handling for the MoE shape.

Comment on lines +23 to +25
pytest.importorskip("torch")
pytest.importorskip("accelerate")
transformers = pytest.importorskip("transformers")

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.

These tests never run in CI as written. The skills job in .github/workflows/unit_tests.yml installs only pytest (it's documented as "stdlib-only and hermetic"), so these importorskip calls on torch/accelerate/transformers skip this entire file — and pytest.importorskip("flashinfer") skips all of test_benchmark_via_builtin.py the same way. CI stays green whether or not the code works, so the ~870 lines of tests only ever run on a dev machine.

Suggestions:

  • Route this file into the main linux unit lane (it needs only torch/accelerate/transformers — all standard unit-test deps, no GPU).
  • In benchmark_via_builtin.py, defer import flashinfer into the functions that need it (same pattern as the existing vllm try/except). The majority of that test file (_parser, _combine, _write_results, _parse_driver_errors, case generation) is pure CPU logic that could then run without the GPU stack.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

import moved. However, route test to main unit lane involve workflow change.

Comment thread .agents/skills/benchmark-model-kernels/scripts/benchmark_model.py
Signed-off-by: Shiyang Chen <shiychen@nvidia.com>
@cjluo-nv

Copy link
Copy Markdown
Collaborator

Could you update the PR description to include an example prompt and expected output?

Signed-off-by: Shiyang Chen <shiychen@nvidia.com>
benchmarks_dir: Path, testlist: Path, output: Path, driver_log: Path
) -> tuple[int, list[str]]:
# This invokes the explicitly selected FlashInfer checkout without a shell.
process = subprocess.Popen( # nosec B603

@sychen52 sychen52 Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@kevalmorabia97 @shengliangxu here is the subprocess invoke. You can see that coderabbit is paused because of this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

got it, just exclude checking on these lines should be the way to go.

@sychen52
sychen52 requested review from Edwardf0t1 and cjluo-nv July 20, 2026 18:20
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.

5 participants