Skip to content

[Bugfix] Forward launch grid to Triton kernel overrides - #63999

Merged
Isotr0py merged 2 commits into
vllm-project:mainfrom
wangxiyuan:fix/triton-dispatcher-grid
Oct 27, 2026
Merged

Isotr0py merged 2 commits into
vllm-project:mainfrom
wangxiyuan:fix/triton-dispatcher-grid

Conversation

@wangxiyuan

@wangxiyuan wangxiyuan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Overview

The kernel dispatcher's KernelOverride dropped the caller's launch grid, so platforms could not remap grids (e.g. to physical core counts). Triton kernel implementations are now swapped in directly, launching natively and staying inlinable as Triton device functions; non-Triton implementations are wrapped, receive the grid via getitem, and delegate compile-only warmup.

This PR fixes three gaps in the Triton kernel dispatcher: (1) the launch grid is now forwarded to overrides instead of being dropped, (2) Triton device functions called from inside other kernels can be overridden without breaking the outer kernel's compilation, and (3) JIT warmup is delegated to the override instead of failing.

Claims

Validation

Details


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

The kernel dispatcher's KernelOverride dropped the caller's launch grid, so platforms like vllm-ascend could not remap grids (e.g. to physical core counts). Triton kernel implementations are now swapped in directly, launching natively and staying inlinable as Triton device functions; non-Triton implementations are wrapped, receive the grid via __getitem__, and delegate compile-only warmup.

Co-authored-by: opencode-agent <noreply@opencode.ai>

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added the bug Something isn't working label Oct 27, 2026
@wangxiyuan

Copy link
Copy Markdown
Contributor Author

@Isotr0py Can you please take a look at this change? It fixed some bug we hit when add triton kernels in vllm-ascend. Thanks.

@Isotr0py Isotr0py left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@Isotr0py
Isotr0py enabled auto-merge (squash) October 27, 2026 13:06
@Isotr0py

Copy link
Copy Markdown
Member

/ci run

@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 27, 2026
@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #97626 for commit 0ca2af2cb547.

ℹ️ This PR is 41 commits behind upstream main. Merged upstream main into this branch as 0ca2af2cb547 before starting CI. Pull the branch before pushing more changes.

@Isotr0py
Isotr0py merged commit ca8dbcc into vllm-project:main Oct 27, 2026
107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants