Skip to content

Conversation

@kzawora-intel
Copy link
Contributor

@kzawora-intel kzawora-intel commented Sep 8, 2025

Some layers inheriting from CustomOp are overwriting the forward method, effectively disabling the platform routing logic defined in CustomOp.dispatch_forward(), resulting in self._forward_method not being called. This is problematic for any out-of-tree backends, as providing backend-specific forward_oot doesn't result in calling the proper forward pass method, even though it's properly selected in self._forward_method. This PR moves forward overrides in layers inheriting from CustomOp to forward_native, and adds forward_cuda also calling forward_native - preserving the current behavior for all existing in-tree backends, but preserving routing logic for out-of-tree backends.

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: Konrad Zawora <kzawora@habana.ai>
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 addresses a bug in CustomOp implementations where platform-specific routing logic was being bypassed due to forward method overrides. The fix involves renaming forward methods to forward_native and adding forward_cuda methods that call forward_native, thus preserving routing logic for out-of-tree backends. The review focuses on ensuring the correctness of these changes and identifying any potential issues.

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
@xuechendi
Copy link
Contributor

@MengqingCao @simon-mo @youkaichao @DarkLight1337 , may you help to take a quick look of this PR

@xuechendi
Copy link
Contributor

@gshtras , may you take a look of this PR

Copy link
Collaborator

@jikunshang jikunshang left a comment

Choose a reason for hiding this comment

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

please fix precommit.

Copy link
Contributor

@MengqingCao MengqingCao left a comment

Choose a reason for hiding this comment

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

This pr is very clean, LGTM

Copy link
Collaborator

@ProExpertProg ProExpertProg left a comment

Choose a reason for hiding this comment

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

Please fix pre-commit

@kzawora-intel
Copy link
Contributor Author

kzawora-intel commented Sep 11, 2025

@jikunshang @MengqingCao @ProExpertProg pre-commit is green now

@ProExpertProg ProExpertProg enabled auto-merge (squash) September 11, 2025 14:21
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 11, 2025
@ProExpertProg ProExpertProg merged commit 4aa2389 into vllm-project:main Sep 11, 2025
51 of 53 checks passed
@yma11 yma11 mentioned this pull request Sep 12, 2025
5 tasks
skyloevil pushed a commit to skyloevil/vllm that referenced this pull request Sep 13, 2025
dsxsteven pushed a commit to dsxsteven/vllm_splitPR that referenced this pull request Sep 15, 2025
xuechendi added a commit to vllm-project/vllm-gaudi that referenced this pull request Sep 16, 2025
- HPU Mrope implementation had a bug which was exposed by
vllm-project/vllm#24444
- Initial workaround was to use the default implementation:
#162
- This PR fixes the bug in the HPU mrope

---------

Signed-off-by: attafosu <thomas.atta-fosu@intel.com>
Co-authored-by: Chendi.Xue <chendi.xue@intel.com>
@jikunshang
Copy link
Collaborator

slokesha pushed a commit to slokesha/vllm-gaudi that referenced this pull request Sep 24, 2025
- HPU Mrope implementation had a bug which was exposed by
vllm-project/vllm#24444
- Initial workaround was to use the default implementation:
vllm-project#162
- This PR fixes the bug in the HPU mrope

---------

Signed-off-by: attafosu <thomas.atta-fosu@intel.com>
Co-authored-by: Chendi.Xue <chendi.xue@intel.com>
Signed-off-by: slokesha <slokeshappa@habana.ai>
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
…llm-project#24444)

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…llm-project#24444)

Signed-off-by: Konrad Zawora <kzawora@habana.ai>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants