Port of: fix: replace batched_count_greater_than to avoid dynamic shape TypeError on HPU #1412#1458
Merged
mgawarkiewicz-intel merged 1 commit intoMay 25, 2026
Conversation
…pe TypeError on HPU vllm-project#1412 Signed-off-by: Iryna Boiko <iboiko@habana.ai>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an HPU-specific monkey-patch to avoid Habana recipe_compiler failures caused by upstream @torch.compile(dynamic=True, ...) on vllm.v1.sample.ops.logprobs.batched_count_greater_than, by replacing it with an uncompiled implementation and deferring the patch until load_general_plugins runs (post platform initialization).
Changes:
- Add an uncompiled HPU-safe
batched_count_greater_thanreplacement. - Defer patch application by wrapping
vllm.plugins.load_general_pluginsto apply the override after general plugins load. - Document the new patch rationale and the platform-initialization import-order constraint.
Comment on lines
+105
to
+106
| import vllm.v1.sample.ops.logprobs as _logprobs_mod | ||
| import vllm.v1.sample.sampler as _sampler_mod |
Comment on lines
+137
to
+139
| def _load_general_with_hpu_patches(): | ||
| _original_load_general() | ||
| _patch_batched_count_greater_than() |
✅ CI PassedAll checks passed successfully against the following vllm commit: |
mgawarkiewicz-intel
approved these changes
May 25, 2026
6dd1b85
into
vllm-project:releases/v0.21.0
2 of 4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.