Skip to content

Add Qwen4Exp model - #48337

Merged
Cyrilvallez merged 90 commits into
mainfrom
qwen4-exp
Aug 26, 2026
Merged

Add Qwen4Exp model#48337
Cyrilvallez merged 90 commits into
mainfrom
qwen4-exp

Conversation

@Cyrilvallez

@Cyrilvallez Cyrilvallez commented Aug 26, 2026

Copy link
Copy Markdown
Member

CPU CI GPU run-slow

What does this PR do?

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, qwen3_5, qwen3_5_moe, qwen4_exp

@ExtReMLapin

Copy link
Copy Markdown

based

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 32963869802:1
Result: failure | Jobs: 1 | Tests: 1 | Failures: 0 | Duration: 2s

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@Cyrilvallez
Cyrilvallez merged commit fc5c5bd into main Aug 26, 2026
109 of 112 checks passed
@Cyrilvallez
Cyrilvallez deleted the qwen4-exp branch August 26, 2026 12:03
Cyrilvallez added a commit that referenced this pull request Aug 26, 2026
* support Qwen4-Exp.

* Fix placement of concatenated checkpoint tensors

* Align Qwen4-Exp checkpoint conversion

* Simplify Qwen4-Exp model integration

* Add Qwen4-Exp parallel coverage and documentation

* revert some equivalent operation

* update qwen4_exp doc.

* fix

* no need to change qwen3.5

* sets activation directly inside norm

* remove specific head models

* native rotary

* simplify

* remove overwrite

* remove non compile criteria

* move outside the class

* remove constants

* simplify config

* indexer is always present

* indexer needs to train

* fix and simplify the selection of valid indices in indexer

* remove external functions

* simplify indexer further

* replace einsum with matmul

* start vectorizing

* simplify

* always use a mask for simplicity

* create and combine mask much more easily in indexer

* simplify hyper connections

* fix all prefixes

* fix ple input by reversing embeddings instead

* capture hidden states

* follow signature order

* always forward both masks

* fix and simplify past context in ngram embedding

* fix

* make do_natural_key more readable

* combine norm and grouped norm

* fix shapes

* fix qsa check

* fix mask

* style

* add a few decorators

* update minimal test

* adapt to newest config

* remove unnecessary test

* combine related test

* fix index mask broadcast error

* fix gdn previous state check when ple is enable

* avoid update conv state in place

* confirmed hybrid_indexed was not used

* fix rope test

* use vlm tester to pass ci

* rewrite layer type in config

* no need to reslice

* short conv up to latest standards

* dilution not supported in kernels 😭

* remove unused attr

* vectorize qsa indexer!!!

* qsa can use a separate rotary for simply

* add qwen_sparse_attention to support block key store!!!

* update test

* modular based on latest main

* make quality happy

* keep simple for now, generalize all library indexers later

* do not keep cos/sin in the cache for memory

* a bit cleaner

* extend 2d position_ids

* ignore rule

* simplify conversion Ops

* fix loading and tests

* do not use attn in tp_plan cause num_kv_head=2

* remove created file

* oupsi

* fix chunked prefill

* fix positions

* fix reverse loading

* improve conversion

* slightly clearer key ordering

* shard the embedding on dim1

* revert test

* force conversion on cpu for device_map

* make things work on simple hardware

* small fix

* oupsi

* latest upstream modular

---------

Co-authored-by: 弥道 <roy.zb@alibaba-inc.com>
Co-authored-by: JJJYmmm <1650675829@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants