Skip to content

fix(roofline): drop only cuda-graph capture, not inductor, for vLLM - #1470

Open
mgehre-amd wants to merge 1 commit into
mainfrom
fix/mgehre/vllm-cudagraph-mode-none
Open

mgehre-amd wants to merge 1 commit into
mainfrom
fix/mgehre/vllm-cudagraph-mode-none

Conversation

@mgehre-amd

@mgehre-amd mgehre-amd commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

The profiling fallback appended --enforce-eager for vLLM. That flag disables
graph capture as well as torch.compile/inductor. Disabling torch.compile/inductor means
that there are different kernel fusions/kernel choices during profiling then during benchmarking.

vLLM's --compilation-config.cudagraph_mode NONE drops only the cuda-graph capture and keeps inductor
compilation, so the profiled kernels match the measured ones.

  • Linked issue(s): none.

  • Tests: added/updated? commands run?

    Updated the three existing assertions that pinned the vLLM flag string
    (test_baseline_param_overrides.py, test_roofline_executor.py).

    pytest                                    # full suite
    ruff check . && ruff format --check .
    
  • Breaking changes: no.

  • PR addresses single concern: yes.

  • Root cause is upstream (Magpie/TraceLens/GEAK/IntelliKit/AgentKernelArena), ticket filed: no

The profiling fallback appended --enforce-eager for vLLM, which turns off
torch.compile/inductor as well as graph capture. A trace taken that way
profiles the uncompiled kernels, not the ones the measured runs execute, so
the roofline attributes device time to kernels production never runs.
--compilation-config.cudagraph_mode NONE drops only the capture and keeps
inductor compilation, so the profiled kernels match the measured ones.

Changes:
- The dotted form is deliberate. It is two plain tokens, so no shlex
  round-trip in the arg pipeline can damage it; the JSON form
  --compilation-config {"cudagraph_mode":"NONE"} only survives because
  _grid_server_args._repair_unquoted_json puts back the double quotes a
  round-trip strips. vLLM parses the dotted form in
  vllm/utils/argparse_utils.py: json.loads("NONE") fails, so it falls through
  to the raw string and merges to {"cudagraph_mode":"NONE"}.
- _with_cuda_graph_disabled now dedups on the option's base name rather than
  the whole flag string. vLLM's flag is two tokens with a dotted option, so
  whole-string matching would never fire and the flag would be re-appended on
  every call. Comparing the part before any "." or "=" also treats an
  operator-supplied --compilation-config (JSON form) or
  --compilation-config.<field> as already present, which matters because vLLM
  re-appends a synthesized --compilation-config for dotted args and argparse
  would then take the last one silently.  The original property is kept:
  --disable-cuda-graph-extra is still not mistaken for --disable-cuda-graph,
  because base names are compared whole.
- sglang is untouched; --disable-cuda-graph was already capture-only there.
@mgehre-amd
mgehre-amd requested review from a team and devalshahamd as code owners September 10, 2026 08:04
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.

1 participant