Views
No views yet
model_type: qwen3_5_moe) with a
split-IR MoE inference engine designed for a 64GB Intel AI PC. See
../../PLAN-QWEN36.md for the full experiment plan.optimum-intel cannot export this architecture (qwen3_5_moe is unregistered;
transformers itself needs >=5.5 to even read the config). The model's Gated
DeltaNet linear-attention layers maintain recurrent state and use CUDA-only
kernels (flash-linear-attention, causal-conv1d) that don't trace. So the
model is hand-ported to a pure, OV-traceable form, and the 256-expert MoE is
factored into a backbone + per-expert IRs so only the top-8 experts per token
ever execute.40 layers, 3:1 hybrid: 3 x (GatedDeltaNet -> MoE) + 1 x (GQA Attention -> MoE)
hidden=2048, head_dim=256, vocab=248320
GatedDeltaNet (linear attention, O(n)):
32 V heads / 16 QK heads, head_dim=128, causal conv1d (k=4),
delta rule + exponential gating + L2 norm. State = (conv_state, recurrent_state).
MoE:
256 routed experts (intermediate=512), top-8 + 1 shared expert.
Only ~3.5% of expert params touched per token.| File | Purpose |
|---|---|
configuration_qwen36.py | Qwen36Config dataclass, from_pretrained_dir(), make_toy_config() |
gptq_dequant.py | GPTQ int4 unpack/dequant; load_gptq_linear() from safetensors |
modeling_qwen36.py | OV-traceable decode-only model; all state as functional IO |
split_inference.py | backbone wrappers + router/combine seam + per-expert extraction |
expert_manager.py | LRU expert cache (capacity, pinning, stats) + ExpertFrequency |
pipeline.py | Qwen36Pipeline.generate() — autoregressive decode through the cache |
load_weights.py | real-checkpoint state-dict mapping (linear_attn / self_attn / experts) |
venv-qwen (transformers 5.9 + openvino 2026.1).1# Tests (toy-scale, fast; real-weight tests skip if checkpoint absent)
2venv-qwen/Scripts/python -m pytest tests/qwen36 -v
3
4# Toy -> OV IR conversion + numerical match
5venv-qwen/Scripts/python scripts/qwen36_convert_toy.py
6
7# End-to-end split-IR orchestration (backbone IRs + per-expert IRs)
8venv-qwen/Scripts/python scripts/qwen36_split_orchestrator_toy.py
9
10# Benchmark (selective vs compute-all, tok/s, cache, quant)
11venv-qwen/Scripts/python scripts/qwen36_benchmark.py
12
13# Live demo (toy default; --real loads the 40-layer checkpoint, ~13 min)
14venv-qwen/Scripts/python scripts/qwen36_demo.py --prompt-tokens 1,2,3 --max-tokens 8num_experts/top_kx
cheaper in FLOPs — at full scale 32x fewer expert FLOPs (8 of 256).ExpertFrequency.hot_keys → ExpertManager.prewarm).gptqmodel has no Windows wheels; BF16 checkpoint not downloaded).