Skip to content

feat: add Qwen4Exp architecture support (Qwen3.8-Flash-Next) - #80

Closed
turbo-tan wants to merge 4 commits into
mainfrom
feat/qwen4exp-support
Closed

turbo-tan wants to merge 4 commits into
mainfrom
feat/qwen4exp-support

Conversation

@turbo-tan

Copy link
Copy Markdown
Owner

Summary

Adds Qwen4Exp architecture support to llama.cpp-tq3 for loading Qwen3.8-Flash-Next models.

Changes

  • src/models/qwen4exp.cpp - Model implementation (from unsloth PR model: add Qwen3.8-Flash-Next (qwen4exp) ggml-org/llama.cpp#27742)
  • src/llama-memory-hybrid-idx.h - QSA indexer KV cache for block-sparse attention
  • src/llama-arch.h - LLM_ARCH_QWEN4EXP enum registration
  • src/llama-arch.cpp - Architecture name mapping and dispatch
  • src/models/models.h - llama_model_qwen4exp struct declaration
  • src/CMakeLists.txt - Added qwen4exp.cpp to build

Build Verification

  • llama-quantize builds successfully
  • llama-server builds successfully
  • All TQ3_4S code preserved (9 mmq.cu refs, 70 dp4a refs, 3 MTP hooks)

Notes

This is a minimal port of unsloth's qwen4exp support (PR ggml-org#27742) which is still open upstream.
Full QSA attention and PLE features depend on the upstream PR merge.

Related

- Add qwen4exp.cpp model implementation (from unsloth PR ggml-org#27742)
- Add llama-memory-hybrid-idx.h for QSA indexer KV cache
- Register LLM_ARCH_QWEN4EXP in architecture enum and dispatch
- Add model struct declaration to models.h
- Add qwen4exp.cpp to CMakeLists.txt

This enables loading Qwen3.8-Flash-Next models once quantized.
Full functionality requires upstream PR ggml-org#27742 to merge.
@github-actions github-actions Bot added the model label Aug 28, 2026
@turbo-tan

Copy link
Copy Markdown
Owner Author

Superseded by #81.

#81 contains a newer, parallel implementation of the same Qwen4Exp architecture support (its own qwen4exp.cpp + hybrid-idx memory + crash fixes: hybrid arch flag, PLE conv state size), PLUS the MTP/NextN draft head port (upstream ggml-org#27836), follow-up fixes (ggml-org#27941, ggml-org#28123), CUDA mm_ids fast path (ggml-org#27978), graph-split reduction (ggml-org#27880), GDN/LID op changes (ggml-org#27877), and the expert-cache backport (ggml-org#27861).

Critically, #81 also carries the non-x86 CI fixes (Q8_0_RHT switch case + arch fallbacks, 7929c44) that resolve the arm64 test-llama-archs failure this PR hit on fresh re-run today — and the Windows build fixes (9d0c773).

The two branches diverged and touch the same 14 files, so merging both would conflict; #81 is the functional superset and is production-validated (Qwen3.8-Flash-Next + Qwopus3.8-27B-Flash MTP quants served on RTX 3090 and GB10: 66-67% draft acceptance, full benchmark + garden batteries).

@turbo-tan turbo-tan closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants