[Tests] Add regression tests for use_kernels=True crash on Qwen3Next and Qwen3.5#46435
Closed
kpal002 wants to merge 2 commits into
Closed
[Tests] Add regression tests for use_kernels=True crash on Qwen3Next and Qwen3.5#46435kpal002 wants to merge 2 commits into
kpal002 wants to merge 2 commits into
Conversation
…and Qwen3.5 Adds test_kernelize_does_not_crash to Qwen3NextModelTest and Qwen3_5TextModelTest. Setting model.use_kernels = True raises ValueError because @use_kernelized_func references apply_rotary_pos_emb which lacks @use_kernel_func_from_hub in the generated modeling files for these two models. Tests are gated with @require_kernels and currently expected to fail — they will pass once the modular converter fix in the follow-up PR lands. Fixes huggingface#46399 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: qwen3_5, qwen3_next |
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.
What this PR does
Adds
test_kernelize_does_not_crashtoQwen3NextModelTestandQwen3_5TextModelTest.Root cause (from issue #46399)
Setting
model.use_kernels = Trueon either model raises:The generated modeling files for
Qwen3NextandQwen3.5define a localapply_rotary_pos_emb(partial-RoPE variant) without@use_kernel_func_from_hub, but the attention class still inherits@use_kernelized_func(apply_rotary_pos_emb)from the parent class via themodular converter's decorator fallback. When
kernelize()tries to registerthe plain function as an
nn.Module, it crashes.This PR
@require_kernels-gated tests, one per model.modular converter fix lands in the follow-up PR.
Follow-up PRs (tracked in #46399)
utils/modular_model_converter.py— strip@use_kernelized_func(fn)from generated classes whenfnis defined locally without@use_kernel_func_from_hub.modeling_qwen3_next.pyandmodeling_qwen3_5.pyusing the fixed converter.@use_kernel_func_from_hub("rotary_pos_emb_partial")once kernels-community#919 ships.Closes #46399 (partial — regression test step)
cc @MekkCyber @vasqu @ArthurZucker @drbh
Before submitting