Skip to content

Revert "[Kernel] Integrate CUTLASS MoE kernel with PPLX (#18762)" #19512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

bnellnm
Copy link
Contributor

@bnellnm bnellnm commented Jun 11, 2025

This reverts commit 84166fe. This commit was causing per regressions in meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8

I couldn't repro the slowdown on main but I'll leave this PR up just in case.

cc @ElizaWszola

Testing done:

  • Ran SAFETENSORS_FAST_GPU=1 python3 benchmarks/benchmark_latency.py --model meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8 --tensor-parallel-size 8 --trust-remote-code before and after.
  • Ran an lm_eval using meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8
  • Ran tests/kernels/moe/test_cutlass_moe.py

Benchmark results as of 42f52cc95

Avg latency: 1.203230387919272 seconds
10% percentile latency: 1.1958889914443716 seconds
25% percentile latency: 1.2002694122493267 seconds
50% percentile latency: 1.203198349045124 seconds
75% percentile latency: 1.2073174895485863 seconds
90% percentile latency: 1.2108522689668462 seconds
99% percentile latency: 1.2137348168448079 seconds

Benchmark results for this PR

Avg latency: 1.185503136642122 seconds
10% percentile latency: 1.1786036632605827 seconds
25% percentile latency: 1.1814715392829385 seconds
50% percentile latency: 1.1853591100079939 seconds
75% percentile latency: 1.1900853918050416 seconds
90% percentile latency: 1.1924659392330796 seconds
99% percentile latency: 1.1944560091057792 seconds

lm-eval results this PR

|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value|   |Stderr|
|-----|------:|----------------|-----:|-----------|---|----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  | 0.95|±  |0.0219|
|     |       |strict-match    |     5|exact_match|↑  | 0.96|±  |0.0197|

…#18762)"

This reverts commit 84166fe.

Signed-off-by: Bill Nell <bnell@redhat.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the ci/build label Jun 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @bnellnm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request reverts a previous change that integrated a specific CUTLASS Mixture-of-Experts (MoE) kernel with PPLX. The changes involve removing PPLX-specific code paths, simplifying the interface of the core CUTLASS MoE kernel, and adjusting how data like strides are handled. It also removes related logic and parameters from various fused MoE layer implementations and tests. Curiously, it also adds new testing infrastructure specifically for PPLX.

Highlights

  • Revert PPLX Integration: This PR primarily reverts the integration of a specific CUTLASS MoE kernel with PPLX, removing PPLX-specific data generation functions and kernels from the codebase.
  • CUTLASS MoE Kernel Interface Changes: The cutlass_moe_mm C++ function and its Python binding (_custom_ops.cutlass_moe_mm) have been simplified by removing the per_act_token and per_out_ch boolean parameters. This logic is now derived internally within the kernel implementation based on scale tensor shapes.
  • Explicit Stride Handling: The CUTLASS MoE kernel (run_cutlass_moe_fp8) and its Python wrapper (cutlass_moe_fp8) now explicitly accept stride tensors (ab_strides1, c_strides1, ab_strides2, c_strides2) as parameters, rather than calculating them internally or relying on implicit batching logic.
  • Removal of Batched Format Logic: PPLX integration introduced a 'batched format' for handling MoE data. This PR removes the conditional logic related to this batched format from the CUTLASS MoE kernel implementation (run_cutlass_moe_fp8, CutlassExpertsFp8) and related tests/benchmarks, standardizing on the non-batched approach.
  • Quantization Parameter Simplification: The workspace_shapes method in several fused MoE layer implementations (DeepGemm, Triton, Batched variants) has been simplified by removing the aq (quantized input) parameter, suggesting a change in how workspace requirements are determined.
  • PPLX Testing Infrastructure Added (Unexpected): Despite being a revert of PPLX integration, this PR adds new parallel launch helper functions (_worker_parallel_launch, parallel_launch, parallel_launch_from_env) and a requires_pplx pytest marker in tests/kernels/moe/test_pplx_moe.py. This seems contradictory to the revert's stated purpose.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reverts commit 84166fe, which integrated a CUTLASS MoE kernel with PPLX. The changes primarily involve removing PPLX-specific code, adjusting function signatures in both C++/CUDA and Python for MoE kernels, and updating data preparation in benchmarks and tests to align with the reverted interfaces.

Overall, the revert appears to be implemented correctly across the affected files. I've pointed out a minor typo in cutlass_moe.py and a new activation constraint for one of the MoE methods that might warrant confirmation. Additionally, a type change for topk_ids in CUDA kernels was noted, which seems acceptable.

Comment on lines +80 to +81
elif (quant_config._is_fp8_w8a8_sm90(weight_quant, input_quant)
and layer.activation == "silu"):
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The condition for using CompressedTensorsW8A8Fp8MoECutlassMethod now includes layer.activation == "silu". This implies that the reverted CUTLASS MoE kernel might only support SiLU activation for this quantization method. Could you confirm if this is the intended behavior or if support for other activations with this method was inadvertently removed/restricted by the revert?

bnellnm added 2 commits June 11, 2025 21:50
Signed-off-by: Bill Nell <bnell@redhat.com>
Signed-off-by: Bill Nell <bnell@redhat.com>
@yeqcharlotte
Copy link
Collaborator

thanks! it's no longer needed as regression is fixed post #19168.

@bnellnm bnellnm closed this Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants