Skip to content

[310p]: add rmsnorm gated fallback and unit test - #7424

Merged
wangxiyuan merged 3 commits into
vllm-project:mainfrom
Tflowers-0129:test/310p-rmsnormgated-ut
Mar 24, 2026
Merged

wangxiyuan merged 3 commits into
vllm-project:mainfrom
Tflowers-0129:test/310p-rmsnormgated-ut

Conversation

@Tflowers-0129

@Tflowers-0129 Tflowers-0129 commented Mar 18, 2026 •

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it?

RFC #7394
310P cannot use the fused rmsnormgated operator and must fall back to the native implementation.

Does this PR introduce any user-facing change?

NO

How was this patch tested?

ut

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 PR introduces a new RMSNormGated implementation specifically for 310P devices, which leverages the native upstream RMSNormGated functionality as a fallback. This ensures that models utilizing gated RMS normalization can operate correctly on 310P hardware, accompanied by new unit tests to validate its integration and behavior.

Highlights

  • New Feature: RMSNormGated Fallback for 310P: Implemented AscendRMSNormGated310 to provide a fallback mechanism for RMSNormGated operations on 310P devices, ensuring compatibility by directly utilizing the upstream native implementation.
  • Unit Testing: Added comprehensive unit tests in test_layernorm_310.py to verify the correct behavior of AscendRMSNormGated310, including scenarios with and without a gate tensor.
  • Custom Operator Registration: Integrated AscendRMSNormGated310 into the custom operator registration utility for 310P devices, making it available for use within the vLLM Ascend framework.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

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

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

Copy link
Copy Markdown
Contributor

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 introduces a fallback implementation for RMSNormGated for the 310P device, ensuring compatibility by using the native PyTorch implementation instead of a Triton-based one. Unit tests are included to verify the fallback mechanism. The changes appear correct and well-tested.

My main feedback is to update the pull request title and description to align with the repository's style guide. The style guide requires a specific format for the PR title ([Branch][Module][Action] Title) and a structured summary. The current PR title and empty description do not follow this format. Adhering to this helps maintain consistency across the project.

Here are the suggestions based on the repository's style guide:

Suggested PR Title:

[310p][Ops][Feature] Add RMSNormGated fallback and unit test

Suggested PR Summary:

### What this PR does / why we need it?

This PR adds a fallback implementation for `RMSNormGated` for the Ascend 310P device. The 310P environment may not support the Triton-based implementation of gated RMS norm. This change introduces `AscendRMSNormGated310`, which inherits from `vllm.model_executor.layers.layernorm.RMSNormGated` and overrides the `forward_oot` method to call the native PyTorch implementation (`forward_native`). This ensures functionality on 310P without relying on Triton kernels.

Unit tests are added to verify that the fallback correctly calls the native implementation, both with and without a gate tensor.

The new `AscendRMSNormGated310` operator is registered for the 310P device.

### Does this PR introduce _any_ user-facing change?

No. This is a backend change to support a specific hardware platform and does not alter any user-facing APIs or behaviors.

### How was this patch tested?

New unit tests have been added in `tests/ut/_310p/ops/test_layernorm_310.py` to verify the behavior of the new `AscendRMSNormGated310` implementation. The tests use mocking to confirm that the `forward_oot` method correctly delegates to the `forward_native` method of the parent class. CI should pass with these new tests.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@Tflowers-0129 Tflowers-0129 changed the title feat(310p): add rmsnorm gated fallback and unit test [310p]: add rmsnorm gated fallback and unit test Mar 18, 2026
@gck123

gck123 commented Mar 20, 2026

Copy link
Copy Markdown

您好,想问下您是不是把您最近提交的几个pr合并了 就可以在310p3上跑qwen3.5了?

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: Tflowers-0129 <2906339855@qq.com>
@Tflowers-0129

Copy link
Copy Markdown
Collaborator Author

您好,想问下您是不是把您最近提交的几个pr合并了 就可以在310p3上跑qwen3.5了?

恐怕还得看看,不过我们会尽快的!

@gck123

gck123 commented Mar 23, 2026

Copy link
Copy Markdown

您好,想问下您是不是把您最近提交的几个pr合并了 就可以在310p3上跑qwen3.5了?

恐怕还得看看,不过我们会尽快的!
好的感谢回复

@wangxiyuan
wangxiyuan merged commit 83bd77c into vllm-project:main Mar 24, 2026
36 checks passed
starmountain1997 pushed a commit to starmountain1997/vllm-ascend that referenced this pull request Mar 25, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
lihaokun-2026 pushed a commit to lihaokun-2026/vllm-ascend that referenced this pull request Mar 29, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
chenchuw886 pushed a commit to chenchuw886/vllm-ascend that referenced this pull request Apr 1, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
yangzhe-2026 pushed a commit to yangzhe-2026/vllm-ascend that referenced this pull request May 6, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
nanxingMy pushed a commit to nanxingMy/vllm-ascend that referenced this pull request May 15, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
Signed-off-by: nanxing <1014662416@qq.com>
ader47 pushed a commit to ader47/vllm-ascend that referenced this pull request Jun 18, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
CXY-Katrina pushed a commit to CXY-Katrina/vllm-ascend that referenced this pull request Jun 27, 2026
### What this PR does / why we need it?
RFC vllm-project#7394
310P cannot use the fused `rmsnormgated` operator and must fall back to
the native implementation.

### Does this PR introduce _any_ user-facing change?
NO
### How was this patch tested?
ut
- vLLM version: v0.17.0
- vLLM main:
vllm-project/vllm@4497431

---------

Signed-off-by: Tflowers-0129 <2906339855@qq.com>
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.

3 participants