Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

Merge dev into feat/qwen38-flash-next

JustVuggfd9b19db2a53
diff --cc c/qwen36_tiny/config.json
index 00000000,00000000..2645cecc
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny/config.json
@@@ -1,0 -1,0 +1,53 @@@
++{
++ "architectures": [
++ "Qwen3_5MoeForCausalLM"
++ ],
++ "attention_bias": false,
++ "attention_dropout": 0.0,
++ "bos_token_id": null,
++ "dtype": "float32",
++ "eos_token_id": null,
++ "head_dim": 16,
++ "hidden_act": "silu",
++ "hidden_size": 64,
++ "initializer_range": 0.02,
++ "intermediate_size": 128,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "linear_conv_kernel_dim": 4,
++ "linear_key_head_dim": 8,
++ "linear_num_key_heads": 4,
++ "linear_num_value_heads": 8,
++ "linear_value_head_dim": 8,
++ "max_position_embeddings": 512,
++ "model_type": "qwen3_5_moe_text",
++ "moe_intermediate_size": 32,
++ "num_attention_heads": 4,
++ "num_experts": 8,
++ "num_experts_per_tok": 2,
++ "num_hidden_layers": 8,
++ "num_key_value_heads": 2,
++ "output_router_logits": false,
++ "pad_token_id": null,
++ "partial_rotary_factor": 0.25,
++ "rms_norm_eps": 1e-06,
++ "rope_parameters": {
++ "partial_rotary_factor": 0.25,
++ "rope_theta": 10000.0,
++ "rope_type": "default"
++ },
++ "router_aux_loss_coef": 0.001,
++ "shared_expert_intermediate_size": 32,
++ "tie_word_embeddings": false,
++ "transformers_version": "5.16.1",
++ "use_cache": true,
++ "vocab_size": 320
++}
diff --cc c/qwen36_tiny/generation_config.json
index 00000000,00000000..ae1401e3
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny/generation_config.json
@@@ -1,0 -1,0 +1,7 @@@
++{
++ "_from_model_config": true,
++ "output_attentions": false,
++ "output_hidden_states": false,
++ "transformers_version": "5.16.1",
++ "use_cache": true
++}
diff --cc c/qwen36_tiny/ref_full.json
index 00000000,00000000..8c7f38b1
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny/ref_full.json
@@@ -1,0 -1,0 +1,34 @@@
++{
++ "prompt_ids": [
++ 1,
++ 2,
++ 3,
++ 4,
++ 5
++ ],
++ "full_ids": [
++ 1,
++ 2,
++ 3,
++ 4,
++ 5,
++ 32,
++ 146,
++ 258,
++ 130,
++ 236,
++ 174,
++ 55,
++ 104,
++ 68,
++ 141,
++ 234,
++ 74,
++ 308,
++ 166,
++ 305,
++ 301
++ ],
++ "mode": "full",
++ "model": "qwen36_tiny"
++}
diff --cc c/qwen36_tiny_bad/README.md
index 00000000,00000000..59dbd3cf
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_bad/README.md
@@@ -1,0 -1,0 +1,15 @@@
++---
++tags:
++ - colibri
++ - qwen3.6
++ - qwen3.6-35b-a3b
++ - moe
++library_name: colibri
++---
++
++colibri container for Qwen3.6-35B-A3B (Phase 2: all layers, incl. Gated DeltaNet).
++Every layer (Gated-Attention + Gated DeltaNet linear_attention) carries its
++MoE/MLP block. DeltaNet weights live under model.layers.{i}.linear_attn.* and are
++run by the recurrent gated-delta-rule in the colibri `qwen36` engine.
++
++Engine: https://github.com/JustVugg/colibri (c/qwen36.c)
diff --cc c/qwen36_tiny_bad/config.hf.json
index 00000000,00000000..2645cecc
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_bad/config.hf.json
@@@ -1,0 -1,0 +1,53 @@@
++{
++ "architectures": [
++ "Qwen3_5MoeForCausalLM"
++ ],
++ "attention_bias": false,
++ "attention_dropout": 0.0,
++ "bos_token_id": null,
++ "dtype": "float32",
++ "eos_token_id": null,
++ "head_dim": 16,
++ "hidden_act": "silu",
++ "hidden_size": 64,
++ "initializer_range": 0.02,
++ "intermediate_size": 128,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "linear_conv_kernel_dim": 4,
++ "linear_key_head_dim": 8,
++ "linear_num_key_heads": 4,
++ "linear_num_value_heads": 8,
++ "linear_value_head_dim": 8,
++ "max_position_embeddings": 512,
++ "model_type": "qwen3_5_moe_text",
++ "moe_intermediate_size": 32,
++ "num_attention_heads": 4,
++ "num_experts": 8,
++ "num_experts_per_tok": 2,
++ "num_hidden_layers": 8,
++ "num_key_value_heads": 2,
++ "output_router_logits": false,
++ "pad_token_id": null,
++ "partial_rotary_factor": 0.25,
++ "rms_norm_eps": 1e-06,
++ "rope_parameters": {
++ "partial_rotary_factor": 0.25,
++ "rope_theta": 10000.0,
++ "rope_type": "default"
++ },
++ "router_aux_loss_coef": 0.001,
++ "shared_expert_intermediate_size": 32,
++ "tie_word_embeddings": false,
++ "transformers_version": "5.16.1",
++ "use_cache": true,
++ "vocab_size": 320
++}
diff --cc c/qwen36_tiny_bad/config.json
index 00000000,00000000..fe690316
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_bad/config.json
@@@ -1,0 -1,0 +1,1 @@@
++{"architectures": ["Qwen3_5MoeForCausalLM"], "attention_bias": false, "attention_dropout": 0.0, "bos_token_id": null, "dtype": "float32", "eos_token_id": null, "head_dim": 16, "hidden_act": "silu", "hidden_size": 64, "initializer_range": 0.02, "intermediate_size": 128, "layer_types": ["linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention"], "linear_conv_kernel_dim": 4, "linear_key_head_dim": 8, "linear_num_key_heads": 4, "linear_num_value_heads": 8, "linear_value_head_dim": 8, "max_position_embeddings": 512, "model_type": "qwen3_5_moe_text", "moe_intermediate_size": 32, "num_attention_heads": 4, "num_experts": 8, "num_experts_per_tok": 2, "num_hidden_layers": 4, "num_key_value_heads": 2, "output_router_logits": false, "pad_token_id": null, "partial_rotary_factor": 0.25, "rms_norm_eps": 1e-06, "rope_parameters": {"partial_rotary_factor": 0.25, "rope_theta": 10000.0, "rope_type": "default"}, "router_aux_loss_coef": 0.001, "shared_expert_intermediate_size": 32, "tie_word_embeddings": false, "transformers_version": "5.16.1", "use_cache": true, "vocab_size": 320}
diff --cc c/qwen36_tiny_bad/qwen36_meta.json
index 00000000,00000000..26970e82
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_bad/qwen36_meta.json
@@@ -1,0 -1,0 +1,50 @@@
++{
++ "model_type": "qwen3_5_moe_text",
++ "hidden": 64,
++ "n_layers": 8,
++ "n_active": 8,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "num_experts": 8,
++ "topk": 2,
++ "moe_inter": 32,
++ "shared_inter": 32,
++ "rms_eps": 1e-06,
++ "ebits": 8,
++ "scoring_func": "softmax",
++ "n_group": 1,
++ "topk_group": 1,
++ "norm_topk_prob": false,
++ "attn_output_gate": false,
++ "rope_theta": 10000.0,
++ "mrope_section": [
++ 16,
++ 16,
++ 16
++ ],
++ "partial_rotary_factor": 0.25,
++ "q_heads": 4,
++ "kv_heads": 2,
++ "q_head_dim": 32,
++ "k_head_dim": 16,
++ "v_head_dim": 16,
++ "o_in": 64,
++ "qk_rope_head_dim": 16,
++ "expert_gs": 0,
++ "head_dim": 16,
++ "rope_dim": 16,
++ "dn_vheads": 8,
++ "dn_kheads": 4,
++ "dn_kdim": 8,
++ "dn_vdim": 8,
++ "dn_convk": 4,
++ "dn_conv_dim": 128
++}
diff --cc c/qwen36_tiny_c/README.md
index 00000000,00000000..59dbd3cf
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_c/README.md
@@@ -1,0 -1,0 +1,15 @@@
++---
++tags:
++ - colibri
++ - qwen3.6
++ - qwen3.6-35b-a3b
++ - moe
++library_name: colibri
++---
++
++colibri container for Qwen3.6-35B-A3B (Phase 2: all layers, incl. Gated DeltaNet).
++Every layer (Gated-Attention + Gated DeltaNet linear_attention) carries its
++MoE/MLP block. DeltaNet weights live under model.layers.{i}.linear_attn.* and are
++run by the recurrent gated-delta-rule in the colibri `qwen36` engine.
++
++Engine: https://github.com/JustVugg/colibri (c/qwen36.c)
diff --cc c/qwen36_tiny_c/config.hf.json
index 00000000,00000000..2645cecc
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_c/config.hf.json
@@@ -1,0 -1,0 +1,53 @@@
++{
++ "architectures": [
++ "Qwen3_5MoeForCausalLM"
++ ],
++ "attention_bias": false,
++ "attention_dropout": 0.0,
++ "bos_token_id": null,
++ "dtype": "float32",
++ "eos_token_id": null,
++ "head_dim": 16,
++ "hidden_act": "silu",
++ "hidden_size": 64,
++ "initializer_range": 0.02,
++ "intermediate_size": 128,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "linear_conv_kernel_dim": 4,
++ "linear_key_head_dim": 8,
++ "linear_num_key_heads": 4,
++ "linear_num_value_heads": 8,
++ "linear_value_head_dim": 8,
++ "max_position_embeddings": 512,
++ "model_type": "qwen3_5_moe_text",
++ "moe_intermediate_size": 32,
++ "num_attention_heads": 4,
++ "num_experts": 8,
++ "num_experts_per_tok": 2,
++ "num_hidden_layers": 8,
++ "num_key_value_heads": 2,
++ "output_router_logits": false,
++ "pad_token_id": null,
++ "partial_rotary_factor": 0.25,
++ "rms_norm_eps": 1e-06,
++ "rope_parameters": {
++ "partial_rotary_factor": 0.25,
++ "rope_theta": 10000.0,
++ "rope_type": "default"
++ },
++ "router_aux_loss_coef": 0.001,
++ "shared_expert_intermediate_size": 32,
++ "tie_word_embeddings": false,
++ "transformers_version": "5.16.1",
++ "use_cache": true,
++ "vocab_size": 320
++}
diff --cc c/qwen36_tiny_c/config.json
index 00000000,00000000..cd645c0a
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_c/config.json
@@@ -1,0 -1,0 +1,53 @@@
++{
++ "architectures": [
++ "Qwen3_5MoeForCausalLM"
++ ],
++ "attention_bias": false,
++ "attention_dropout": 0.0,
++ "bos_token_id": null,
++ "dtype": "float32",
++ "eos_token_id": null,
++ "head_dim": 16,
++ "hidden_act": "silu",
++ "hidden_size": 64,
++ "initializer_range": 0.02,
++ "intermediate_size": 128,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "linear_conv_kernel_dim": 4,
++ "linear_key_head_dim": 8,
++ "linear_num_key_heads": 4,
++ "linear_num_value_heads": 8,
++ "linear_value_head_dim": 8,
++ "max_position_embeddings": 512,
++ "model_type": "qwen3_5_moe_text",
++ "moe_intermediate_size": 32,
++ "num_attention_heads": 4,
++ "num_experts": 8,
++ "num_experts_per_tok": 2,
++ "num_hidden_layers": 8,
++ "num_key_value_heads": 2,
++ "output_router_logits": false,
++ "pad_token_id": null,
++ "partial_rotary_factor": 0.25,
++ "rms_norm_eps": 1e-06,
++ "rope_parameters": {
++ "partial_rotary_factor": 0.25,
++ "rope_theta": 10000.0,
++ "rope_type": "default"
++ },
++ "router_aux_loss_coef": 0.001,
++ "shared_expert_intermediate_size": 32,
++ "tie_word_embeddings": false,
++ "transformers_version": "5.16.1",
++ "use_cache": true,
++ "vocab_size": 320
++}
diff --cc c/qwen36_tiny_c/qwen36_meta.json
index 00000000,00000000..26970e82
new file mode 100644
--- /dev/null
+++ b/c/qwen36_tiny_c/qwen36_meta.json
@@@ -1,0 -1,0 +1,50 @@@
++{
++ "model_type": "qwen3_5_moe_text",
++ "hidden": 64,
++ "n_layers": 8,
++ "n_active": 8,
++ "layer_types": [
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention",
++ "linear_attention",
++ "linear_attention",
++ "linear_attention",
++ "full_attention"
++ ],
++ "num_experts": 8,
++ "topk": 2,
++ "moe_inter": 32,
++ "shared_inter": 32,
++ "rms_eps": 1e-06,
++ "ebits": 8,
++ "scoring_func": "softmax",
++ "n_group": 1,
++ "topk_group": 1,
++ "norm_topk_prob": false,
++ "attn_output_gate": false,
++ "rope_theta": 10000.0,
++ "mrope_section": [
++ 16,
++ 16,
++ 16
++ ],
++ "partial_rotary_factor": 0.25,
++ "q_heads": 4,
++ "kv_heads": 2,
++ "q_head_dim": 32,
++ "k_head_dim": 16,
++ "v_head_dim": 16,
++ "o_in": 64,
++ "qk_rope_head_dim": 16,
++ "expert_gs": 0,
++ "head_dim": 16,
++ "rope_dim": 16,
++ "dn_vheads": 8,
++ "dn_kheads": 4,
++ "dn_kdim": 8,
++ "dn_vdim": 8,
++ "dn_convk": 4,
++ "dn_conv_dim": 128
++}
diff --cc c/tools/clean.py
index 49c10c53,560952e9..8105be33
--- a/c/tools/clean.py
+++ b/c/tools/clean.py
@@@ -14,8 -14,14 +14,15 @@@ FILES =
"inkling", "inkling.exe",
"kimi_k3", "kimi_k3.exe",
"olmoe", "olmoe.exe",
+ # Missing here means `make clean` leaves the binary in place, and a rebuild
+ # with different EXTRA_CFLAGS then reports "up to date". That is how the
+ # `Qwen3.6 tiny oracle` job re-ran an UN-INSTRUMENTED binary from its ASan
+ # step for as long as it existed (#1262), reporting green while the
+ # sanitizer had never run. test_family_registry keeps this list and the
+ # registry in step.
"qwen36", "qwen36.exe",
+ "qwen38", "qwen38.exe",
+ "glm53", "glm53.exe",
"glm", "glm.exe", # pre-rename name of the colibri engine
"iobench", "iobench.exe",
"backend_cuda.o", "backend_loader.o",