Skip to content

Lower v2 SparseCore kernels through core_map#1

Closed
guowei-dev wants to merge 2 commits into
mainfrom
fix/v2-coremap
Closed

Lower v2 SparseCore kernels through core_map#1
guowei-dev wants to merge 2 commits into
mainfrom
fix/v2-coremap

Conversation

@guowei-dev

@guowei-dev guowei-dev commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the v2 SparseCore MoE kernels and routes them through the core_map_helper
introduced in vllm-project#2887 (the v1 core_map routing fix, now in main). This keeps the v2
kernels on the fast single-mesh core_map lowering instead of the mpmd_map path that
pl.kernel uses on jaxlib 0.10.1 — mpmd_map aliases the kernel refs and serializes the
SC gather against the gather_reduce preprocess argsort, losing the overlap. The helper is
already in main, so this PR does not re-introduce it.

Two commits:

  1. Add v2 SparseCore MoE kernelsragged_gather_v2 and ragged_gather_reduce_v2,
    selected at import time via RAGGED_GATHER_VERSION / RAGGED_GATHER_REDUCE_VERSION
    (both default to v2, set either to v1 to fall back).
  2. Lower v2 SparseCore kernels through core_map — route the v2 kernels through
    core_map_helper.

E2E

Qwen3.5-397B-A17B-FP8, tpu7x-8, TP=8, EP + dp_attention, jax 0.10.1 / jaxlib 0.10.1 /
libtpu 0.0.41. Prefill-heavy profile (input 8192 / output 1024, 640 prompts, concurrency
512), 1 warmup + 3 runs averaged, rel stdev < 0.8%.

v2 kernels total token throughput (tok/s)
without core_map routing 24,548.6
with core_map routing 27,172.0 (+10.69%)

Same base, same bench, only the lowering differs — the fix moves the v2 kernels the same
way it moved the v1 kernels (+8.25%, vllm-project#2887).

@github-actions

Copy link
Copy Markdown

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a Github issue, please include a link, e.g.,:
FIXES: #123456

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

guowei-dev and others added 2 commits June 17, 2026 19:26
New BlockSpec-pipelined gather (ragged_gather_v2) and 2D-grid combine
(ragged_gather_reduce_v2) SparseCore kernels for MoE, wired into
fused_moe_gmm and used by default. Set RAGGED_GATHER_VERSION=v1 and/or
RAGGED_GATHER_REDUCE_VERSION=v1 to fall back to the legacy kernels
independently. Includes kernel correctness/perf tests.

Signed-off-by: guowei <guoweij@google.com>
Route the v2 ragged_gather and ragged_gather_reduce kernels through the
core_map helper added for the v1 kernels, so they keep the fast single-mesh
lowering instead of the slower mpmd_map path that pl.kernel uses on jaxlib
0.10.1.

Signed-off-by: guowei-dev <rainycat.ava@gmail.com>
@guowei-dev guowei-dev changed the base branch from fix/sc-kernel-coremap to main June 17, 2026 19:28
@guowei-dev guowei-dev closed this Jul 7, 2026
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