Skip to content

feat: Allow discontiguous inputs to the group_rms_norm. #4982

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SimengLiu-nv
Copy link
Collaborator

@SimengLiu-nv SimengLiu-nv commented Jun 6, 2025

feat: Allow discontiguous inputs to the group_rms_norm.

Description

When input tensors are outputs of a split operation, the stride size along the batch dimension mismatches the size of dimension.

For example:

a, b = c.split([size_a, size_b], dim=1)
c.shape[1] = size_a + size_b
a.stride = (c.shape[1], 1); a_normed.stride = (size_a, 1) 
b.stride = (c.shape[1], 1); b_normed.stride = (size_b, 1)

This PR adds support for the above case. Note that last dimension of all inputs must be discontiguous.

Test Coverage

tests/unittest/_torch/test_group_rms_norm.py::test_group_rms_norm_with_different_IO_strides

When input tensors are outputs of a split operation, the stride size
along the batch dimension mismatches the size of dimension.

For example:

a, b = c.split([size_a, size_b], dim=1)
c.shape[1] = size_a + size_b
a.stride = (c.shape[1], 1); a_normed.stride = (size_a, 1)
b.stride = (c.shape[1], 1); b_normed.stride = (size_b, 1)

This PR adds support for the above case. Note that last dimension of all
inputs must be discontiguous.

Signed-off-by: Simeng Liu <[email protected]>
@SimengLiu-nv SimengLiu-nv requested a review from Kefeng-Duan June 6, 2025 06:56
@SimengLiu-nv
Copy link
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd
Copy link
Collaborator

PR_Github #7860 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #7860 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #5677 completed with status: 'FAILURE'

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.

2 participants