mjolnir-cli 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. mjolnir_cli/__init__.py +8 -0
  2. mjolnir_cli/__main__.py +4 -0
  3. mjolnir_cli/accuracy.py +333 -0
  4. mjolnir_cli/autoresearch.py +539 -0
  5. mjolnir_cli/benchy.py +475 -0
  6. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4/config.yaml +78 -0
  7. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_DFLASH2/config.yaml +103 -0
  8. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_DSPARK/config.yaml +102 -0
  9. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_FA2/config.yaml +84 -0
  10. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_FA4hd256/config.yaml +104 -0
  11. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR/config.yaml +86 -0
  12. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3/config.yaml +93 -0
  13. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_DFLASH2/config.yaml +123 -0
  14. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_DSPARK/config.yaml +124 -0
  15. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8/.env +2 -0
  16. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8/config.yaml +98 -0
  17. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT32K/.env +4 -0
  18. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT32K/config.yaml +98 -0
  19. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT64K/.env +4 -0
  20. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_LMH8_VT64K/config.yaml +102 -0
  21. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_VT32K/.env +3 -0
  22. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/NVFP4_MJOLNIR_E2M3_VT32K/config.yaml +98 -0
  23. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/draft_vocab.json +1 -0
  24. mjolnir_cli/bundled/configs/Qwen/Qwen3.8-27B/kv_scales.json +35197 -0
  25. mjolnir_cli/bundled/configs/Qwen/Qwen3.8_chat_template.jinja +456 -0
  26. mjolnir_cli/bundled/docker/litellm/docker-compose.yaml +113 -0
  27. mjolnir_cli/bundled/docker/litellm/litellm.env.example +51 -0
  28. mjolnir_cli/bundled/docker/litellm/litellm_config.template.example.yaml +192 -0
  29. mjolnir_cli/bundled/docker/perses/README.md +89 -0
  30. mjolnir_cli/bundled/docker/perses/dashboards/global-datasource.yaml +17 -0
  31. mjolnir_cli/bundled/docker/perses/dashboards/performance_statistics.yaml +771 -0
  32. mjolnir_cli/bundled/docker/perses/dashboards/project.yaml +13 -0
  33. mjolnir_cli/bundled/docker/perses/dashboards/query_statistics.yaml +399 -0
  34. mjolnir_cli/bundled/docker/perses/docker-compose.yaml +51 -0
  35. mjolnir_cli/bundled/docker/perses/perses.yml +16 -0
  36. mjolnir_cli/bundled/docker/perses/prometheus.template.yaml +20 -0
  37. mjolnir_cli/bundled/scripts/hw/setup-thor.sh +1287 -0
  38. mjolnir_cli/cachectl.py +146 -0
  39. mjolnir_cli/charts.py +1687 -0
  40. mjolnir_cli/cli.py +1480 -0
  41. mjolnir_cli/clidoc.py +170 -0
  42. mjolnir_cli/config.py +346 -0
  43. mjolnir_cli/dockerctl.py +533 -0
  44. mjolnir_cli/drivers/fa2_driver.py +89 -0
  45. mjolnir_cli/drivers/fi_driver.py +134 -0
  46. mjolnir_cli/e2e.py +302 -0
  47. mjolnir_cli/fonts/InterDisplay-Bold.ttf +0 -0
  48. mjolnir_cli/fonts/InterDisplay-Medium.ttf +0 -0
  49. mjolnir_cli/fonts/InterDisplay-Regular.ttf +0 -0
  50. mjolnir_cli/fonts/InterDisplay-SemiBold.ttf +0 -0
  51. mjolnir_cli/fonts/OFL.txt +92 -0
  52. mjolnir_cli/gate.py +233 -0
  53. mjolnir_cli/history.py +159 -0
  54. mjolnir_cli/interactive.py +383 -0
  55. mjolnir_cli/legs.py +109 -0
  56. mjolnir_cli/litellm.py +254 -0
  57. mjolnir_cli/perses.py +214 -0
  58. mjolnir_cli/picker.py +70 -0
  59. mjolnir_cli/readme.py +1020 -0
  60. mjolnir_cli/stack.py +340 -0
  61. mjolnir_cli/tasks.py +122 -0
  62. mjolnir_cli/theme.py +281 -0
  63. mjolnir_cli/thor.py +108 -0
  64. mjolnir_cli/verify/__init__.py +2 -0
  65. mjolnir_cli/verify/cli.py +816 -0
  66. mjolnir_cli/verify/docker.py +334 -0
  67. mjolnir_cli/verify/kvcache.py +180 -0
  68. mjolnir_cli/verify/legs.py +134 -0
  69. mjolnir_cli/verify/ncu.py +141 -0
  70. mjolnir_cli/verify/profile.py +312 -0
  71. mjolnir_cli/verify/report.py +177 -0
  72. mjolnir_cli/verify/results.py +157 -0
  73. mjolnir_cli/verify/spec.py +279 -0
  74. mjolnir_cli/verify/stages.py +817 -0
  75. mjolnir_cli-0.2.0.dist-info/METADATA +87 -0
  76. mjolnir_cli-0.2.0.dist-info/RECORD +80 -0
  77. mjolnir_cli-0.2.0.dist-info/WHEEL +4 -0
  78. mjolnir_cli-0.2.0.dist-info/entry_points.txt +2 -0
  79. mjolnir_cli-0.2.0.dist-info/licenses/LICENSE +202 -0
  80. mjolnir_cli-0.2.0.dist-info/licenses/NOTICE +64 -0
@@ -0,0 +1,124 @@
1
+ # NVFP4_MJOLNIR_E2M3_DSPARK — EXPERIMENT (opt-in e2e leg, Mjolnir image): NVFP4_MJOLNIR_E2M3
2
+ # (Mjolnir decode kernel, fp6 KV) with the DSpark drafter instead of the built-in MTP head —
3
+ # the drafter on Mjolnir and fp6 KV too. Its 5 layers (indices 64-68) hold a K/V
4
+ # per context token, 20 KB/token on bf16 next to the target's 24 KB on fp6; on
5
+ # fp6 they take 7.5 KB, so the cache holds ~1.4x the tokens of a bf16 drafter.
6
+ # - the target's verify steps (1 + 7 tokens) and the drafter's non-causal
7
+ # block steps (1 + 7 queries over the whole context) both run on the decode
8
+ # kernel (MJOLNIR_ATTN_NONCAUSAL); other steps on FlashAttention 4
9
+ # - fp6 scales for the target AND the drafter, in one file next to this one —
10
+ # NVFP4_MJOLNIR_E2M3_DSPARK.kv_scales.json, written by:
11
+ # mjolnir calibrate --config NVFP4_MJOLNIR_E2M3_DSPARK
12
+ # (`mjolnir serve` refuses to start this config without it)
13
+ # Measure it next to the headline pair:
14
+ # mjolnir bench e2e --optional (all optional legs)
15
+ # mjolnir bench e2e --only mjolnir --config NVFP4_MJOLNIR_E2M3_DSPARK
16
+ # Untested on Thor before its first run: check the startup log for "fp6_e2m3 KV
17
+ # scales ... for 5 layer(s)" (the drafter's group) and the acceptance rate.
18
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
19
+ served-model-name: Qwen/Qwen3.8-27B
20
+
21
+ dtype: bfloat16
22
+
23
+ performance-mode: throughput
24
+ optimization-level: 3
25
+ compilation-config:
26
+ cudagraph_num_of_warmups: 5
27
+ custom_ops:
28
+ - +rotary_embedding
29
+ pass_config:
30
+ eliminate_noops: true
31
+ fuse_allreduce_rms: false
32
+
33
+ disable-custom-all-reduce: true
34
+ trust-remote-code: true
35
+ enforce-eager: false
36
+
37
+ max-num-seqs: 8
38
+ max-model-len: 200K
39
+ max-num-batched-tokens: 16K
40
+ gpu-memory-utilization: 0.80
41
+
42
+ enable-auto-tool-choice: true
43
+ tool-call-parser: qwen3_coder
44
+ reasoning-parser: qwen3
45
+
46
+ # ── Attention / linear backends ─────────────────────────────────────────────
47
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
48
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
49
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
50
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
51
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
52
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
53
+ # kernel reads head-major pages 11-17% faster at long context.
54
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
55
+ # KV format: fp6 e2m3 (see the KV Cache section).
56
+ attention-backend: MJOLNIR
57
+ enable-flashinfer-autotune: true
58
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
59
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
60
+
61
+ # ── KV Cache ─────────────────────────────────────────────────────────────
62
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
63
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
64
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
65
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
66
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
67
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
68
+ kv-cache-dtype: fp6_e2m3
69
+ kv-cache-dtype-skip-layers: sliding_window
70
+ mamba-cache-mode: align
71
+ mamba-cache-dtype: bfloat16
72
+ mamba-ssm-cache-dtype: bfloat16
73
+
74
+ # ── Multimodal ─────────────────────────────────────────────────────────────
75
+ language-model-only: false
76
+ mm-encoder-tp-mode: data
77
+ mm-processor-cache-type: shm
78
+ # limit-mm-per-prompt:
79
+ # image: 4
80
+ # video: 0
81
+
82
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
83
+ enable-prefix-caching: true
84
+ enable-chunked-prefill: true
85
+ async-scheduling: true
86
+
87
+ # ── Speculative Decoding — DSpark drafter, K=7 ──────────────────────────
88
+ # RadixArk's DSpark drafter (5 dense Qwen3 layers + a Markov head) through the
89
+ # vLLM-ready fork (byte-identical weights; its "architectures" is set to
90
+ # Qwen3DSparkModel, which vLLM 0.31.0 registers natively — no custom image).
91
+ # num_speculative_tokens 7 — the drafter's trained block (block_size 7), not 8
92
+ # draft_sample_method probabilistic — greedy drafting measured ~23% slower in
93
+ # RadixArk's eval
94
+ # enable_adaptive_verification stays OFF (the default): vLLM rejects it for
95
+ # Qwen3.8, whose GDN layers cannot trim a verification on device
96
+ # The checkpoint's built-in MTP head is not loaded.
97
+ speculative-config:
98
+ method: dspark
99
+ model: Doopeworld/Qwen3.8-27B-DSpark-vLLM
100
+ num_speculative_tokens: 7
101
+ draft_sample_method: probabilistic
102
+ # the drafter on Mjolnir + fp6 KV. Explicit: vLLM gives a DSpark drafter its
103
+ # own backend choice (auto, unless set here) — it does not inherit the target's
104
+ attention_backend: MJOLNIR
105
+
106
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
107
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
108
+ # left to the client/proxy). Included here as the model card's recommendation
109
+ # if you want it pinned at the server instead.
110
+ override-generation-config:
111
+ temperature: 1.0
112
+ top_p: 0.95
113
+ top_k: 20
114
+ min_p: 0.0
115
+ presence_penalty: 0.0
116
+ repetition_penalty: 1.0
117
+
118
+ # ── Chat Template ──────────────────────────────────────────────────────────
119
+ default-chat-template-kwargs:
120
+ reasoning_effort: medium
121
+ preserve_thinking: true
122
+ enable_thinking: true
123
+
124
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,2 @@
1
+ # env for NVFP4_MJOLNIR_E2M3_LMH8 (KEY=VALUE; {configs} = the model's config dir in the container)
2
+ MJOLNIR_LM_HEAD=fp8
@@ -0,0 +1,98 @@
1
+ # NVFP4_MJOLNIR_E2M3_LMH8 — EXPERIMENT (opt-in): NVFP4_MJOLNIR_E2M3 plus an fp8 lm_head (MJOLNIR_LM_HEAD=fp8, NVFP4_MJOLNIR_E2M3_LMH8.env).
2
+ # The YAML is identical to NVFP4_MJOLNIR_E2M3; the switches are env vars in NVFP4_MJOLNIR_E2M3_LMH8.env,
3
+ # which `mjolnir serve` / `bench` / `verify` pass to the container. Check it before using:
4
+ # mjolnir verify spec --legs mjolnir:NVFP4_MJOLNIR_E2M3,mjolnir:NVFP4_MJOLNIR_E2M3_LMH8 --drafts "3 4"
5
+ # mjolnir bench ab --backends NVFP4_MJOLNIR_E2M3,NVFP4_MJOLNIR_E2M3_LMH8 --repeat 2
6
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
7
+ served-model-name: Qwen/Qwen3.8-27B
8
+
9
+ dtype: bfloat16
10
+
11
+ performance-mode: throughput
12
+ optimization-level: 3
13
+ compilation-config:
14
+ cudagraph_num_of_warmups: 5
15
+ custom_ops:
16
+ - +rotary_embedding
17
+ pass_config:
18
+ eliminate_noops: true
19
+ fuse_allreduce_rms: false
20
+
21
+ disable-custom-all-reduce: true
22
+ trust-remote-code: true
23
+ enforce-eager: false
24
+
25
+ max-num-seqs: 8
26
+ max-model-len: 200K
27
+ max-num-batched-tokens: 16K
28
+ gpu-memory-utilization: 0.80
29
+
30
+ enable-auto-tool-choice: true
31
+ tool-call-parser: qwen3_coder
32
+ reasoning-parser: qwen3
33
+
34
+ # ── Attention / linear backends ─────────────────────────────────────────────
35
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
36
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
37
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
38
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
39
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
40
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
41
+ # kernel reads head-major pages 11-17% faster at long context.
42
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
43
+ # KV format: fp6 e2m3 (see the KV Cache section).
44
+ attention-backend: MJOLNIR
45
+ enable-flashinfer-autotune: true
46
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
47
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
48
+
49
+ # ── KV Cache ─────────────────────────────────────────────────────────────
50
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
51
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
52
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
53
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
54
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
55
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
56
+ kv-cache-dtype: fp6_e2m3
57
+ kv-cache-dtype-skip-layers: sliding_window
58
+ mamba-cache-mode: align
59
+ mamba-cache-dtype: bfloat16
60
+ mamba-ssm-cache-dtype: bfloat16
61
+
62
+ # ── Multimodal ─────────────────────────────────────────────────────────────
63
+ language-model-only: false
64
+ mm-encoder-tp-mode: data
65
+ mm-processor-cache-type: shm
66
+ # limit-mm-per-prompt:
67
+ # image: 4
68
+ # video: 0
69
+
70
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
71
+ enable-prefix-caching: true
72
+ enable-chunked-prefill: true
73
+ async-scheduling: true
74
+
75
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
76
+ speculative-config:
77
+ method: mtp
78
+ num_speculative_tokens: 3
79
+
80
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
81
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
82
+ # left to the client/proxy). Included here as the model card's recommendation
83
+ # if you want it pinned at the server instead.
84
+ override-generation-config:
85
+ temperature: 1.0
86
+ top_p: 0.95
87
+ top_k: 20
88
+ min_p: 0.0
89
+ presence_penalty: 0.0
90
+ repetition_penalty: 1.0
91
+
92
+ # ── Chat Template ──────────────────────────────────────────────────────────
93
+ default-chat-template-kwargs:
94
+ reasoning_effort: medium
95
+ preserve_thinking: true
96
+ enable_thinking: true
97
+
98
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,4 @@
1
+ # env for NVFP4_MJOLNIR_E2M3_LMH8_VT32K (KEY=VALUE; {configs} = the model's config dir in the container)
2
+ MJOLNIR_LM_HEAD=fp8
3
+ MJOLNIR_DRAFT_VOCAB={configs}/draft_vocab.json
4
+ MJOLNIR_DRAFT_VOCAB_SIZE=32768
@@ -0,0 +1,98 @@
1
+ # NVFP4_MJOLNIR_E2M3_LMH8_VT32K — EXPERIMENT (opt-in): NVFP4_MJOLNIR_E2M3 plus an fp8 lm_head and the drafter's logits over the 32K most frequent target tokens (both env sidecar knobs).
2
+ # The YAML is identical to NVFP4_MJOLNIR_E2M3; the switches are env vars in NVFP4_MJOLNIR_E2M3_LMH8_VT32K.env,
3
+ # which `mjolnir serve` / `bench` / `verify` pass to the container. Check it before using:
4
+ # mjolnir verify spec --legs mjolnir:NVFP4_MJOLNIR_E2M3,mjolnir:NVFP4_MJOLNIR_E2M3_LMH8_VT32K --drafts "3 4"
5
+ # mjolnir bench ab --backends NVFP4_MJOLNIR_E2M3,NVFP4_MJOLNIR_E2M3_LMH8_VT32K --repeat 2
6
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
7
+ served-model-name: Qwen/Qwen3.8-27B
8
+
9
+ dtype: bfloat16
10
+
11
+ performance-mode: throughput
12
+ optimization-level: 3
13
+ compilation-config:
14
+ cudagraph_num_of_warmups: 5
15
+ custom_ops:
16
+ - +rotary_embedding
17
+ pass_config:
18
+ eliminate_noops: true
19
+ fuse_allreduce_rms: false
20
+
21
+ disable-custom-all-reduce: true
22
+ trust-remote-code: true
23
+ enforce-eager: false
24
+
25
+ max-num-seqs: 8
26
+ max-model-len: 200K
27
+ max-num-batched-tokens: 16K
28
+ gpu-memory-utilization: 0.80
29
+
30
+ enable-auto-tool-choice: true
31
+ tool-call-parser: qwen3_coder
32
+ reasoning-parser: qwen3
33
+
34
+ # ── Attention / linear backends ─────────────────────────────────────────────
35
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
36
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
37
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
38
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
39
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
40
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
41
+ # kernel reads head-major pages 11-17% faster at long context.
42
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
43
+ # KV format: fp6 e2m3 (see the KV Cache section).
44
+ attention-backend: MJOLNIR
45
+ enable-flashinfer-autotune: true
46
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
47
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
48
+
49
+ # ── KV Cache ─────────────────────────────────────────────────────────────
50
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
51
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
52
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
53
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
54
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
55
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
56
+ kv-cache-dtype: fp6_e2m3
57
+ kv-cache-dtype-skip-layers: sliding_window
58
+ mamba-cache-mode: align
59
+ mamba-cache-dtype: bfloat16
60
+ mamba-ssm-cache-dtype: bfloat16
61
+
62
+ # ── Multimodal ─────────────────────────────────────────────────────────────
63
+ language-model-only: false
64
+ mm-encoder-tp-mode: data
65
+ mm-processor-cache-type: shm
66
+ # limit-mm-per-prompt:
67
+ # image: 4
68
+ # video: 0
69
+
70
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
71
+ enable-prefix-caching: true
72
+ enable-chunked-prefill: true
73
+ async-scheduling: true
74
+
75
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
76
+ speculative-config:
77
+ method: mtp
78
+ num_speculative_tokens: 3
79
+
80
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
81
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
82
+ # left to the client/proxy). Included here as the model card's recommendation
83
+ # if you want it pinned at the server instead.
84
+ override-generation-config:
85
+ temperature: 1.0
86
+ top_p: 0.95
87
+ top_k: 20
88
+ min_p: 0.0
89
+ presence_penalty: 0.0
90
+ repetition_penalty: 1.0
91
+
92
+ # ── Chat Template ──────────────────────────────────────────────────────────
93
+ default-chat-template-kwargs:
94
+ reasoning_effort: medium
95
+ preserve_thinking: true
96
+ enable_thinking: true
97
+
98
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,4 @@
1
+ # env for NVFP4_MJOLNIR_E2M3_LMH8_VT64K (KEY=VALUE; {configs} = the model's config dir in the container)
2
+ MJOLNIR_LM_HEAD=fp8
3
+ MJOLNIR_DRAFT_VOCAB={configs}/draft_vocab.json
4
+ MJOLNIR_DRAFT_VOCAB_SIZE=65536
@@ -0,0 +1,102 @@
1
+ # NVFP4_MJOLNIR_E2M3_LMH8_VT64K — EXPERIMENT (opt-in): NVFP4_MJOLNIR_E2M3 plus an fp8 lm_head and the drafter's logits over the 64K most frequent target tokens (both env sidecar knobs).
2
+ # The YAML is identical to NVFP4_MJOLNIR_E2M3; the switches are env vars in NVFP4_MJOLNIR_E2M3_LMH8_VT64K.env,
3
+ # which `mjolnir serve` / `bench` / `verify` pass to the container. Check it before using:
4
+ # mjolnir verify spec --legs mjolnir:NVFP4_MJOLNIR_E2M3,mjolnir:NVFP4_MJOLNIR_E2M3_LMH8_VT64K --drafts "3 4"
5
+ # mjolnir bench ab --backends NVFP4_MJOLNIR_E2M3,NVFP4_MJOLNIR_E2M3_LMH8_VT64K --repeat 2
6
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
7
+ served-model-name: Qwen/Qwen3.8-27B
8
+
9
+ dtype: bfloat16
10
+
11
+ performance-mode: throughput
12
+ optimization-level: 3
13
+ compilation-config:
14
+ cudagraph_num_of_warmups: 5
15
+ custom_ops:
16
+ - +rotary_embedding
17
+ pass_config:
18
+ eliminate_noops: true
19
+ fuse_allreduce_rms: false
20
+
21
+ disable-custom-all-reduce: true
22
+ trust-remote-code: true
23
+ enforce-eager: false
24
+
25
+ max-num-seqs: 8
26
+ max-model-len: 200K
27
+ max-num-batched-tokens: 16K
28
+ gpu-memory-utilization: 0.80
29
+
30
+ enable-auto-tool-choice: true
31
+ tool-call-parser: qwen3_coder
32
+ reasoning-parser: qwen3
33
+
34
+ # ── Attention / linear backends ─────────────────────────────────────────────
35
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
36
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
37
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
38
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
39
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
40
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
41
+ # kernel reads head-major pages 11-17% faster at long context.
42
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
43
+ # KV format: fp6 e2m3 (see the KV Cache section).
44
+ attention-backend: MJOLNIR
45
+ enable-flashinfer-autotune: true
46
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
47
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
48
+
49
+ # ── KV Cache ─────────────────────────────────────────────────────────────
50
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
51
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
52
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
53
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
54
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
55
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
56
+ kv-cache-dtype: fp6_e2m3
57
+ kv-cache-dtype-skip-layers: sliding_window
58
+ mamba-cache-mode: align
59
+ mamba-cache-dtype: bfloat16
60
+ mamba-ssm-cache-dtype: bfloat16
61
+
62
+ # ── Multimodal ─────────────────────────────────────────────────────────────
63
+ language-model-only: false
64
+ mm-encoder-tp-mode: data
65
+ mm-processor-cache-type: shm
66
+ # limit-mm-per-prompt:
67
+ # image: 4
68
+ # video: 0
69
+
70
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
71
+ enable-prefix-caching: true
72
+ enable-chunked-prefill: true
73
+ async-scheduling: true
74
+
75
+ # ── Speculative Decoding — MTP (built-in head), K=5 ─────────────────────
76
+ # 5 drafts: with the fp8 lm_head and the 64K draft vocab a draft is cheap
77
+ # enough that the 5th and 6th pay — best at 4 requests, 1% off best at 1
78
+ # (verify spec 20261014-182829: 34.0 vs 33.8 t/s at 4 requests, 39.4 vs 39.8
79
+ # at 1 request)
80
+ speculative-config:
81
+ method: mtp
82
+ num_speculative_tokens: 5
83
+
84
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
85
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
86
+ # left to the client/proxy). Included here as the model card's recommendation
87
+ # if you want it pinned at the server instead.
88
+ override-generation-config:
89
+ temperature: 1.0
90
+ top_p: 0.95
91
+ top_k: 20
92
+ min_p: 0.0
93
+ presence_penalty: 0.0
94
+ repetition_penalty: 1.0
95
+
96
+ # ── Chat Template ──────────────────────────────────────────────────────────
97
+ default-chat-template-kwargs:
98
+ reasoning_effort: medium
99
+ preserve_thinking: true
100
+ enable_thinking: true
101
+
102
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,3 @@
1
+ # env for NVFP4_MJOLNIR_E2M3_VT32K (KEY=VALUE; {configs} = the model's config dir in the container)
2
+ MJOLNIR_DRAFT_VOCAB={configs}/draft_vocab.json
3
+ MJOLNIR_DRAFT_VOCAB_SIZE=32768
@@ -0,0 +1,98 @@
1
+ # NVFP4_MJOLNIR_E2M3_VT32K — EXPERIMENT (opt-in): NVFP4_MJOLNIR_E2M3 plus the drafter's logits over the 32K most frequent target tokens (VocabTrim; NVFP4_MJOLNIR_E2M3_VT32K.env, draft_vocab.json from `mjolnir calibrate --draft-vocab`).
2
+ # The YAML is identical to NVFP4_MJOLNIR_E2M3; the switches are env vars in NVFP4_MJOLNIR_E2M3_VT32K.env,
3
+ # which `mjolnir serve` / `bench` / `verify` pass to the container. Check it before using:
4
+ # mjolnir verify spec --legs mjolnir:NVFP4_MJOLNIR_E2M3,mjolnir:NVFP4_MJOLNIR_E2M3_VT32K --drafts "3 4"
5
+ # mjolnir bench ab --backends NVFP4_MJOLNIR_E2M3,NVFP4_MJOLNIR_E2M3_VT32K --repeat 2
6
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
7
+ served-model-name: Qwen/Qwen3.8-27B
8
+
9
+ dtype: bfloat16
10
+
11
+ performance-mode: throughput
12
+ optimization-level: 3
13
+ compilation-config:
14
+ cudagraph_num_of_warmups: 5
15
+ custom_ops:
16
+ - +rotary_embedding
17
+ pass_config:
18
+ eliminate_noops: true
19
+ fuse_allreduce_rms: false
20
+
21
+ disable-custom-all-reduce: true
22
+ trust-remote-code: true
23
+ enforce-eager: false
24
+
25
+ max-num-seqs: 8
26
+ max-model-len: 200K
27
+ max-num-batched-tokens: 16K
28
+ gpu-memory-utilization: 0.80
29
+
30
+ enable-auto-tool-choice: true
31
+ tool-call-parser: qwen3_coder
32
+ reasoning-parser: qwen3
33
+
34
+ # ── Attention / linear backends ─────────────────────────────────────────────
35
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
36
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
37
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
38
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
39
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
40
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
41
+ # kernel reads head-major pages 11-17% faster at long context.
42
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
43
+ # KV format: fp6 e2m3 (see the KV Cache section).
44
+ attention-backend: MJOLNIR
45
+ enable-flashinfer-autotune: true
46
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
47
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
48
+
49
+ # ── KV Cache ─────────────────────────────────────────────────────────────
50
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
51
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
52
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
53
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
54
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
55
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
56
+ kv-cache-dtype: fp6_e2m3
57
+ kv-cache-dtype-skip-layers: sliding_window
58
+ mamba-cache-mode: align
59
+ mamba-cache-dtype: bfloat16
60
+ mamba-ssm-cache-dtype: bfloat16
61
+
62
+ # ── Multimodal ─────────────────────────────────────────────────────────────
63
+ language-model-only: false
64
+ mm-encoder-tp-mode: data
65
+ mm-processor-cache-type: shm
66
+ # limit-mm-per-prompt:
67
+ # image: 4
68
+ # video: 0
69
+
70
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
71
+ enable-prefix-caching: true
72
+ enable-chunked-prefill: true
73
+ async-scheduling: true
74
+
75
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
76
+ speculative-config:
77
+ method: mtp
78
+ num_speculative_tokens: 3
79
+
80
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
81
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
82
+ # left to the client/proxy). Included here as the model card's recommendation
83
+ # if you want it pinned at the server instead.
84
+ override-generation-config:
85
+ temperature: 1.0
86
+ top_p: 0.95
87
+ top_k: 20
88
+ min_p: 0.0
89
+ presence_penalty: 0.0
90
+ repetition_penalty: 1.0
91
+
92
+ # ── Chat Template ──────────────────────────────────────────────────────────
93
+ default-chat-template-kwargs:
94
+ reasoning_effort: medium
95
+ preserve_thinking: true
96
+ enable_thinking: true
97
+
98
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja