Skip to content

Port of: fix: replace batched_count_greater_than to avoid dynamic shape TypeError on HPU #1412#1458

Merged
mgawarkiewicz-intel merged 1 commit into
vllm-project:releases/v0.21.0from
iboiko-habana:port1412
May 25, 2026
Merged

Port of: fix: replace batched_count_greater_than to avoid dynamic shape TypeError on HPU #1412#1458
mgawarkiewicz-intel merged 1 commit into
vllm-project:releases/v0.21.0from
iboiko-habana:port1412

Conversation

@iboiko-habana
Copy link
Copy Markdown
Collaborator

No description provided.

…pe TypeError on HPU vllm-project#1412

Signed-off-by: Iryna Boiko <iboiko@habana.ai>
Copilot AI review requested due to automatic review settings May 19, 2026 09:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_than replacement.
  • Defer patch application by wrapping vllm.plugins.load_general_plugins to apply the override after general plugins load.
  • Document the new patch rationale and the platform-initialization import-order constraint.

Comment thread vllm_gaudi/patches.py
Comment on lines +105 to +106
import vllm.v1.sample.ops.logprobs as _logprobs_mod
import vllm.v1.sample.sampler as _sampler_mod
Comment thread vllm_gaudi/patches.py
Comment on lines +137 to +139
def _load_general_with_hpu_patches():
_original_load_general()
_patch_batched_count_greater_than()
Copy link
Copy Markdown
Collaborator

@kamil-kaczor kamil-kaczor left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link
Copy Markdown

✅ CI Passed

All checks passed successfully against the following vllm commit:
ad7125a431e176d4161099480a66f0169609a690

@mgawarkiewicz-intel mgawarkiewicz-intel merged commit 6dd1b85 into vllm-project:releases/v0.21.0 May 25, 2026
2 of 4 checks passed
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.

4 participants