Skip to content

qwen: opt-in static YaRN for extended context (--qwen-yarn-factor; ported from Enntity f465aaf6e/9b25f5759) - #274

Merged
AzeezIsh merged 6 commits into
mainfrom
port/qwen-static-yarn
Oct 30, 2026
Merged

AzeezIsh merged 6 commits into
mainfrom
port/qwen-static-yarn

Conversation

@AzeezIsh

Copy link
Copy Markdown
Contributor

Summary

  • Ports SparkQwen 0.4.0's opt-in static YaRN for Qwen3.8-Flash-Next extended context, so its 512K/1M profiles (4x512k, 4x1m, which pass --qwen-yarn-factor) can run on main.
  • It's a cherry-pick of data-angel's two commits on Enntity spark-shared, credited in each message:
    • f465aaf6e feat(qwen): add opt-in static YaRN for extended context
    • 9b25f5759 fix(qwen): register YaRN MRoPE in the PDL launch policy
  • Conflicts were resolved keeping main's behaviour:
    • Two module lines that exist only in Enntity were dropped.
    • The new kernel handle went into main's types_layer.rs; it's still 500 LoC, with no change to the cap allow-list.
    • Two bindings unused on main were dropped.
  • Off by default. configure_qwen_yarn returns early unless model_type == "qwen4_exp" && yarn_factor != 0 (qwen3_attention/yarn.rs:18). --qwen-yarn-factor unset leaves the factor at 0, so the rope path is unchanged.
  • One ungated piece from upstream: index_qk_proj now loads through dense_auto. FP4-Local ships it as MXFP8, and the indexer reads BF16. The output-identity check below covers it.

Test plan (pair: reiner + spark2, TP=EP=2; receipts in reiner's ~/code/night1027/out/yarn-4d871a3d9/)

Part of #220. If data-angel opens his own PR for these commits, this one closes in favour of it.

Generated with Devin

data-angel and others added 6 commits October 30, 2026 07:32
(cherry picked from commit f465aaf)

Ported from Enntity/atlas f465aaf / 9b25f57 (AGPL-3.0-only, data-angel)
(cherry picked from commit 9b25f57)

Ported from Enntity/atlas f465aaf / 9b25f57 (AGPL-3.0-only, data-angel)
…he gate-weight doc, no field moves); revert the allow-list entry
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Heads-up: this added qsa_yarn.cuh next to kernels/gb10/qwen3.8-flash-next/nvfp4/qsa_indexer.cu, which strix-hip symlinks without the new header, so main's strix-hip build broke (fatal error: 'qsa_yarn.cuh' file not found). The fix (one symlink) is in a follow-up PR from the AMD campaign. No action needed here.

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.

2 participants