Skip to content

Fix ragged gather reduce correctness#4262

Open
NuojCheng wants to merge 2 commits into
mainfrom
chengnuojin-ragged-followup
Open

Fix ragged gather reduce correctness#4262
NuojCheng wants to merge 2 commits into
mainfrom
chengnuojin-ragged-followup

Conversation

@NuojCheng

@NuojCheng NuojCheng commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR does three things:

  • Add the mask in ragged_gather_reduce kernel solving correctness using ragged sort kernels;
  • Remove fallback mechanism in ragged_gather_reduce kernel of small tensors. It breaks our ragged sort unit test;
  • Add fallback/cost estimate flags, which are missing in the previous PRs.

Tests

CI tests

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@NuojCheng NuojCheng force-pushed the chengnuojin-ragged-followup branch 3 times, most recently from 3b816f6 to e4b450a Compare June 26, 2026 17:05
@NuojCheng NuojCheng force-pushed the chengnuojin-ragged-followup branch from e4b450a to 8c14942 Compare June 27, 2026 00:13
@NuojCheng NuojCheng force-pushed the chengnuojin-ragged-followup branch 2 times, most recently from 64a11c0 to 9e10916 Compare June 29, 2026 18:03
abhinavgoel95 and others added 2 commits June 29, 2026 18:04
When prefuse_moe_weights=True (requires sparse_matmul=True), the two
FFN1 expert weight matrices [G,K,N] are concatenated into [G,K,2N] and
dispatched as a single grouped GEMM, then split. This halves FFN1
kernel launches and reads input activations from HBM once instead of
twice. Backend-agnostic: works with Megablox, Tokamax, and
jax.lax.ragged_dot. When attention=vllm_rpa the fused tensor is passed
directly to the vLLM-TPU serving kernel.

correct sort kernel convergence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants