mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #91] [MERGED] Fix HIP RoPE frequency length mismatch #137
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/91
Author: @derfasthirnlosenick
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @comfyanonymous
Base:
main← Head:rocm-rope-fix-only📝 Commits (1)
9a0f027Fix HIP RoPE frequency length mismatch📊 Changes
1 file changed (+4 additions, -1 deletions)
View changed files
📝
comfy_kitchen/backends/hip/__init__.py(+4 -1)📄 Description
While testing with Flux.2 9b, I ran into a reproducible crash on my 6800xt: HIP apply_rope could fail when freqs_cis contained more sequence positions than the input tensor, because the extra frequencies were passed directly to the kernel.
This change trims freqs_cis before the HIP kernel call, matching the expected RoPE behavior used by the reference/eager path. The shared trim_rope_freqs utility is reused instead of adding HIP-specific slicing logic. Only the non-split-half path is changed, as split-half RoPE uses different frequency layout handling.
Validated with test_rope.py (non-Triton) and test_hip_wmma.py.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.