Skip to content

Fixed RoPE scaling extension factors buffer size for partial_rotary_factor - #337

Open
harrywhoo wants to merge 6 commits into
mlc-ai:mlcfrom
harrywhoo:fix-rope-scaling-buffer-size
Open

Fixed RoPE scaling extension factors buffer size for partial_rotary_factor#337
harrywhoo wants to merge 6 commits into
mlc-ai:mlcfrom
harrywhoo:fix-rope-scaling-buffer-size

Conversation

@harrywhoo

Copy link
Copy Markdown
Contributor

Phi-4 was causing runtime errors in TVM due to its partial_rotary_factor of 0.75, which resulted in a mismatch between the expected ext_factor dimensions and the actual. Changed ext_factors buffer size from head_dim//2 to rotary_dim//2 to align with RoPE implementation. This resolves TVMError: Assert fail for fused_rope_longrope_scaling_ext_factors_handle. Tested other models to ensure this didn't break support.

tqchen and others added 6 commits June 17, 2025 16:28
MLC local ci setup. Also CI for Windows and macOS building,
which may take 90-100 mins.

Co-authored-by: Siyuan Feng <Hzfengsy@sjtu.edu.cn>
- Revert "[CMake][MSVC] Disable permissive mode for MSVC builds (#16343)"
- Skip MSC tests
- Disable NNPack and TFLite
- Tweak CMAKE_CUDA_ARCHITECTURES
This PR updates the NVSHMEM-based NDArray allocation, which
was missed in the recent FFI refactor and thus fails to compile
when building tvm with NVSHMEM.
…tor models

- Change ext_factors buffer size from head_dim//2 to rotary_dim//2
- Fixes runtime error for models like Phi-4 with partial_rotary_factor < 1.0
- Resolves TVMError: Assert fail for fused_rope_longrope_scaling_ext_factors_handle
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 2 times, most recently from 07529be to e16f551 Compare September 28, 2025 03:53
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 2 times, most recently from 851d153 to da3714d Compare December 9, 2025 01:27
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 3 times, most recently from 90ab5d3 to b3d4fe9 Compare February 9, 2026 17:27
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 4 times, most recently from 2ef52fe to bfd7787 Compare March 3, 2026 15:45
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 3 times, most recently from 153ed4e to 2bf925c Compare April 2, 2026 04:03
@MasterJH5574
MasterJH5574 force-pushed the mlc branch 2 times, most recently from f5369ec to 06db68d Compare June 30, 2026 13:30
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