fix(phi4): restore RoPE export workaround for transformers 5.x - #245
Merged
JakeStevens merged 1 commit intoJul 22, 2026
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Collaborator
|
We may still be getting an OOM error with Phi: https://github.com/huggingface/optimum-executorch/actions/runs/29868750873/job/88852447419?pr=245 |
Collaborator
Author
|
Yes I've put up: to try to address that. Seems like /mnt has variable amount of space, I added fallbacks to try /, and to more dynamically size the swap |
JakeStevens
force-pushed
the
fix/phi4-longrope-export
branch
from
July 22, 2026 15:32
28a0ef9 to
8e90add
Compare
regisss
approved these changes
Jul 22, 2026
regisss
left a comment
Collaborator
There was a problem hiding this comment.
LGTM!
I let you merge the PR since you have write rights now :)
…type key) transformers 5.x renamed the RoPE config field rope_scaling -> rope_parameters (rope_scaling is now a property alias) and dispatches on the 'rope_type' key instead of 'type'. The existing export workaround only set rope_scaling['type'] = 'default', which no longer takes effect: the model still reads rope_parameters['rope_type'] == 'longrope', keeps the dynamic longrope path, and export fails on the data-dependent branch in longrope_frequency_update. Add a shared helper disable_dynamic_rope_for_export() used by the causal_lm and multimodal_text_to_text tasks. It sets both 'type' and 'rope_type' to 'default' (compatible with transformers 4.x and 5.x), only downgrades the RoPE types with data-dependent branching (longrope, dynamic), and handles the transformers-5 nested per-layer-type rope dict shape.
JakeStevens
force-pushed
the
fix/phi4-longrope-export
branch
from
July 22, 2026 16:59
8e90add to
2a0a125
Compare
Collaborator
Author
|
all green, beautiful :) |
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.
transformers 5.x renamed the RoPE config field rope_scaling -> rope_parameters (rope_scaling is now a property alias) and dispatches on the 'rope_type' key instead of 'type'. The existing export workaround only set rope_scaling['type'] = 'default', which no longer takes effect: the model still reads rope_parameters['rope_type'] == 'longrope', keeps the dynamic longrope path, and export fails on the data-dependent branch in longrope_frequency_update.
Add a shared helper disable_dynamic_rope_for_export() used by the causal_lm and multimodal_text_to_text tasks. It sets both 'type' and 'rope_type' to 'default' (compatible with transformers 4.x and 5.x), only downgrades the RoPE types with data-dependent branching (longrope, dynamic), and handles the transformers-5 nested per-layer-type rope dict shape.