Skip to content

[ROCm][Kernel] Add shared route switches and kernel configs for amd-kernels - #69415

Open
shen-shanshan wants to merge 1 commit into
vllm-project:mainfrom
shen-shanshan:rocm-amd-kernels-routes
Open

shen-shanshan wants to merge 1 commit into
vllm-project:mainfrom
shen-shanshan:rocm-amd-kernels-routes

Conversation

@shen-shanshan

Copy link
Copy Markdown
Member

Purpose

The MiniMax-M3.1 (#67850 / #69097), DeepSeek-V4.1 (#69097) and Kimi-K3.1 (#69172) integrations of
amd-kernels each define their own KernelConfig.amd_kernels (two
incompatible versions) and their own copy of the route switches (akr_config.py). This PR lands the shared part once,
model-agnostic, so the model PRs only declare their routes:

  • KernelConfig.amd_kernels (AmdKernelsConfig): enabled and disabled_routes (route names, validated by the
    models that declare them). Its compile factors include the sorted routes and the installed amd_kernels revision.
  • vllm/model_executor/amd_kernels_routes.py:
    • AmdKernelsRoutes(model, routes, needs): a model's routes and their prerequisites;
    • on(route): whether the route runs in this process, resolved once from the config, the platform and the
      prerequisites;
    • fail(route, reason): takes a route and its dependents out at load time;
    • covered(op, reason): logs a library blocker's reason once;
    • dp_max_tokens(n): the DP-group maximum a collective route decides on;
    • available(): ROCm gfx950 with amd_kernels importable.

Nothing calls the module yet; with no model routes, behaviour is unchanged on every platform.

--kernel-config '{"amd_kernels": {"disabled_routes": ["fused_ep8"]}}'   # or "enabled": false

Test Plan

pytest tests/model_executor/test_amd_kernels_routes.py tests/test_config.py

Test Result

  • test_amd_kernels_routes.py: 7 passed. It covers:
    • route resolution with prerequisites;
    • config-driven routes;
    • off without the package;
    • fail taking out dependents;
    • config parsing and the compile hash.
  • tests/test_config.py: 664 passed. 6 failed, and the same 6 fail on main in this environment (gated HF models,
    B200 / B300 defaults).
  • On MI355X: available() is True with amd-kernels on the path and False without it.

🤖 Generated with Claude Code

The MiniMax-M3.1, DeepSeek-V4.1 and Kimi-K3.1 integrations of amd-kernels each define their own
KernelConfig.amd_kernels and their own copy of the route switches. Land the shared, model-agnostic
part once: AmdKernelsConfig (enabled, disabled_routes; compile factors include the routes and the
installed amd_kernels revision) and vllm/model_executor/amd_kernels_routes.py (AmdKernelsRoutes with
prerequisites, on/fail, covered, dp_max_tokens, available). Nothing calls it yet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: shen-shanshan <467638484@qq.com>
@mergify mergify Bot added the rocm Related to AMD ROCm label Nov 23, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Nov 23, 2026
@shen-shanshan shen-shanshan changed the title [ROCm][Kernel] Shared amd_kernels route switches and KernelConfig.amd_kernels [ROCm][Kernel] Add shared route switches and kernel configs for amd-kernels Nov 23, 2026
@shen-shanshan
shen-shanshan marked this pull request as ready for review November 23, 2026 12:54

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rocm Related to AMD ROCm

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant