You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 419467e
Browse filesBrowse the repository at this point in the historyBrowse files
Fix L2 failures: arctic RoPE and Phi4-MM rope standardization (#230)
## Summary
Fixes 8 L2 test failures (arctic ×2, phi4_multimodal ×3, phi4mm ×3).
### Arctic (TypeError: rotary_emb is None)
Arctic's config JSON has `rope_theta=10000` (the default) and
`rope_scaling=null`. No signal triggers `_extract_rope_config()`, so
`rotary_emb` is never created — but the model uses RoPE.
**Fix:** Add `arctic` to `_IMPLICIT_ROPE_DEFAULTS` with
`rope_theta=10000.0`.
### Phi4-MM (AttributeError: max_position_embeddings)
Newer transformers (`convert_rope_params_to_dict` →
`standardize_rope_params`) accesses `self.max_position_embeddings`
before it's set as an attribute on `PretrainedConfig`. This crashes even
when `max_position_embeddings` is in the kwargs dict.
**Fix:** Two-layer defense in `_dict_to_pretrained_config`:
1. Proactively strip rope fields from **composite** configs (those with
nested text_config/thinker_config dicts) — the nested config carries its
own rope_scaling
2. For **flat** configs that still crash, catch the exception, strip
rope fields, reconstruct, then restore rope fields as attributes so
`_extract_rope_config` can still read them
---------
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
0 commit comments