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,102 @@
1
+ # NVFP4_DSPARK — EXPERIMENT (opt-in e2e leg, official image): NVFP4 with the DSpark drafter
2
+ # instead of the built-in MTP head. Stock vLLM 0.31.0: FlashInfer, fp8 KV — what
3
+ # DSpark gives WITHOUT Mjolnir. Measure it next to the headline pair:
4
+ # mjolnir bench e2e --optional (all optional legs)
5
+ # mjolnir bench e2e --only official --official-config NVFP4_DSPARK
6
+ # Untested on Thor before its first run: watch the startup log for the drafter's
7
+ # attention backend and the acceptance rate (`mjolnir verify spec` reads it).
8
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
9
+ served-model-name: Qwen/Qwen3.8-27B
10
+
11
+ dtype: bfloat16
12
+
13
+ performance-mode: throughput
14
+ optimization-level: 3
15
+ compilation-config:
16
+ cudagraph_num_of_warmups: 5
17
+ custom_ops:
18
+ - +rotary_embedding
19
+ pass_config:
20
+ eliminate_noops: true
21
+ fuse_allreduce_rms: false
22
+
23
+ disable-custom-all-reduce: true
24
+ trust-remote-code: true
25
+ enforce-eager: false
26
+
27
+ max-num-seqs: 8
28
+ max-model-len: 200K
29
+ max-num-batched-tokens: 16K
30
+ gpu-memory-utilization: 0.80
31
+
32
+ enable-auto-tool-choice: true
33
+ tool-call-parser: qwen3_coder
34
+ reasoning-parser: qwen3
35
+
36
+ # ── Attention / linear backends ─────────────────────────────────────────────
37
+ attention-backend: flashinfer # TRITON_ATTN
38
+ enable-flashinfer-autotune: true
39
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
40
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
41
+
42
+ # ── KV Cache ─────────────────────────────────────────────────────────────
43
+ kv-cache-dtype: fp8 # NVFP4 KV isn't available on SM110 for this arch; FP8 matches the checkpoint's own design (NVFP4 weights, FP8 KV)
44
+ # The drafter's layers (indices 64-68, after the target's 64) keep bf16 KV:
45
+ # its non-causal block attention then runs on any backend, and the KV it holds
46
+ # is small (5 layers, 8 KV heads).
47
+ kv-cache-dtype-skip-layers: ["sliding_window", "64", "65", "66", "67", "68"]
48
+ mamba-cache-mode: align
49
+ mamba-cache-dtype: bfloat16
50
+ mamba-ssm-cache-dtype: bfloat16
51
+
52
+ # ── Multimodal ─────────────────────────────────────────────────────────────
53
+ language-model-only: false
54
+ mm-encoder-tp-mode: data
55
+ mm-processor-cache-type: shm
56
+ # limit-mm-per-prompt:
57
+ # image: 4
58
+ # video: 0
59
+
60
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
61
+ enable-prefix-caching: true
62
+ enable-chunked-prefill: true
63
+ async-scheduling: true
64
+
65
+ # ── Speculative Decoding — DSpark drafter, K=7 ──────────────────────────
66
+ # RadixArk's DSpark drafter (5 dense Qwen3 layers + a Markov head) through the
67
+ # vLLM-ready fork (byte-identical weights; its "architectures" is set to
68
+ # Qwen3DSparkModel, which vLLM 0.31.0 registers natively — no custom image).
69
+ # num_speculative_tokens 7 — the drafter's trained block (block_size 7), not 8
70
+ # draft_sample_method probabilistic — greedy drafting measured ~23% slower in
71
+ # RadixArk's eval
72
+ # enable_adaptive_verification stays OFF (the default): vLLM rejects it for
73
+ # Qwen3.8, whose GDN layers cannot trim a verification on device
74
+ # The checkpoint's built-in MTP head is not loaded.
75
+ speculative-config:
76
+ method: dspark
77
+ model: Doopeworld/Qwen3.8-27B-DSpark-vLLM
78
+ num_speculative_tokens: 7
79
+ draft_sample_method: probabilistic
80
+ # the drafter's attention: FlashInfer, like the target. If it fails to boot on
81
+ # sm_110, try attention_backend: FLASH_ATTN (its layers keep bf16 KV — the skip
82
+ # list in the KV Cache section).
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,84 @@
1
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
2
+ served-model-name: Qwen/Qwen3.8-27B
3
+
4
+ dtype: bfloat16
5
+
6
+ performance-mode: throughput
7
+ optimization-level: 3
8
+ compilation-config:
9
+ cudagraph_num_of_warmups: 5
10
+ custom_ops:
11
+ - +rotary_embedding
12
+ pass_config:
13
+ eliminate_noops: true
14
+ fuse_allreduce_rms: false
15
+
16
+ disable-custom-all-reduce: true
17
+ trust-remote-code: true
18
+ enforce-eager: false
19
+
20
+ max-num-seqs: 10
21
+ max-model-len: 160K
22
+ max-num-batched-tokens: 16K
23
+ gpu-memory-utilization: 0.88
24
+
25
+ enable-auto-tool-choice: true
26
+ tool-call-parser: qwen3_coder
27
+ reasoning-parser: qwen3
28
+
29
+ # ── Attention / linear backends ─────────────────────────────────────────────
30
+ # NVFP4_FA2 — the stock-vLLM baseline on Thor: FlashAttention 2 with a bf16 KV
31
+ # cache (the third leg of the Mjolnir / FlashInfer / FA2 comparison). The 48
32
+ # GDN (linear-attention) layers are a separate backend and are untouched.
33
+ attention-config:
34
+ backend: FLASH_ATTN # the 16 full-attn layers (hd256) -> vLLM's FlashAttention backend
35
+ flash_attn_version: 2 # FA2 = what stock vLLM 0.31.0 runs on sm_110 (FA2 has no fp8 KV,
36
+ # so the KV cache below stays bf16 — 2x the decode bytes)
37
+ enable-flashinfer-autotune: true
38
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
39
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
40
+
41
+ # ── KV Cache ─────────────────────────────────────────────────────────────
42
+ kv-cache-dtype: auto # bf16: FlashAttention 2 has no fp8 KV path
43
+ kv-cache-dtype-skip-layers: sliding_window
44
+ mamba-cache-mode: align
45
+ mamba-cache-dtype: bfloat16
46
+ mamba-ssm-cache-dtype: bfloat16
47
+
48
+ # ── Multimodal ─────────────────────────────────────────────────────────────
49
+ language-model-only: false
50
+ mm-encoder-tp-mode: data
51
+ mm-processor-cache-type: shm
52
+ # limit-mm-per-prompt:
53
+ # image: 4
54
+ # video: 0
55
+
56
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
57
+ enable-prefix-caching: true
58
+ enable-chunked-prefill: true
59
+ async-scheduling: true
60
+
61
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
62
+ speculative-config:
63
+ method: mtp
64
+ num_speculative_tokens: 3
65
+
66
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
67
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
68
+ # left to the client/proxy). Included here as the model card's recommendation
69
+ # if you want it pinned at the server instead.
70
+ override-generation-config:
71
+ temperature: 1.0
72
+ top_p: 0.95
73
+ top_k: 20
74
+ min_p: 0.0
75
+ presence_penalty: 0.0
76
+ repetition_penalty: 1.0
77
+
78
+ # ── Chat Template ──────────────────────────────────────────────────────────
79
+ default-chat-template-kwargs:
80
+ reasoning_effort: medium
81
+ preserve_thinking: true
82
+ enable_thinking: true
83
+
84
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,104 @@
1
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
2
+ served-model-name: Qwen/Qwen3.8-27B
3
+
4
+ dtype: bfloat16
5
+
6
+ performance-mode: throughput
7
+ optimization-level: 3
8
+ compilation-config:
9
+ cudagraph_num_of_warmups: 5
10
+ custom_ops:
11
+ - +rotary_embedding
12
+ pass_config:
13
+ eliminate_noops: true
14
+ fuse_allreduce_rms: false
15
+
16
+ disable-custom-all-reduce: true
17
+ trust-remote-code: true
18
+ enforce-eager: false
19
+
20
+ max-num-seqs: 10
21
+ max-model-len: 200K
22
+ max-num-batched-tokens: 16K
23
+ gpu-memory-utilization: 0.88
24
+
25
+ enable-auto-tool-choice: true
26
+ tool-call-parser: qwen3_coder
27
+ reasoning-parser: qwen3
28
+
29
+ # ── Attention / linear backends ─────────────────────────────────────────────
30
+ # NVFP4_FA4hd256 — the ONLY change vs NVFP4 is the attention opt-in below.
31
+ #
32
+ # NVFP4 used `attention-backend: flashinfer` (top-level), which forced ALL 16
33
+ # full-attention (head_dim=256) layers onto FlashInfer — FA4 could never serve them
34
+ # because sm_110 defaults to FA2 and the Blackwell hd256 kernel was downgraded on FP8 KV.
35
+ # Here we replace it with an `attention-config` block (the two are mutually exclusive):
36
+ # - backend: FLASH_ATTN -> the 16 full-attn layers resolve to the FA backend
37
+ # - flash_attn_version: 4 -> the explicit FA4 opt-in. This is REQUIRED: without it
38
+ # sm_110 stays FA2 (passive-by-default gate), and the
39
+ # fa4-hd256 FP8 policy probe is unreachable (its grant is
40
+ # gated on fa_version==4). With it + FP8 KV + head 256,
41
+ # the dedicated 2-CTA hd256 kernel is selected and its
42
+ # one-shot probe validates the FP8 descale path on the box.
43
+ # The 48 GDN (linear-attention) layers are a SEPARATE backend (linear-backend / mamba) and
44
+ # are untouched by this — this is why only the full-attn group changes.
45
+ # attention-backend: flashinfer # replaced by attention-config below (mutually exclusive)
46
+ attention-config:
47
+ backend: FLASH_ATTN # target's 16 full-attn layers (hd256) -> FA4 (was FlashInfer)
48
+ flash_attn_version: 4 # explicit FA4 opt-in (sm_110 defaults to FA2 otherwise)
49
+ enable-flashinfer-autotune: true
50
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
51
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
52
+
53
+ # ── KV Cache ─────────────────────────────────────────────────────────────
54
+ # kv-cache-dtype: fp8 == fp8_e4m3 (vLLM aliases fp8->fp8_e4m3; both satisfy
55
+ # is_quantized_kv_cache), so the FP8 KV requirement is already met. No change.
56
+ kv-cache-dtype: fp8 # NVFP4 KV isn't available on SM110 for this arch; FP8 matches the checkpoint's own design (NVFP4 weights, FP8 KV)
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
+ # No global `block-size` and no `mamba-block-size` — same as NVFP4. The FA4 hd256
62
+ # kernel requires page_size==128 (TMA tile_n=128), so its KV group is auto-pinned to
63
+ # 128 by get_supported_kernel_block_sizes when FA4 hd256 is active. The GDN/mamba group
64
+ # resolves its own block size independently (per-group block sizes in the hybrid KV
65
+ # coordinator). No conflicting global size is set, so the two coexist. Verified by the
66
+ # server smoke test's "kv cache group sizes" log line.
67
+
68
+ # ── Multimodal ─────────────────────────────────────────────────────────────
69
+ language-model-only: false
70
+ mm-encoder-tp-mode: data
71
+ mm-processor-cache-type: shm
72
+ # limit-mm-per-prompt:
73
+ # image: 4
74
+ # video: 0
75
+
76
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
77
+ enable-prefix-caching: true
78
+ enable-chunked-prefill: true
79
+ async-scheduling: true
80
+
81
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
82
+ speculative-config:
83
+ method: mtp
84
+ num_speculative_tokens: 3
85
+
86
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
87
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
88
+ # left to the client/proxy). Included here as the model card's recommendation
89
+ # if you want it pinned at the server instead.
90
+ override-generation-config:
91
+ temperature: 1.0
92
+ top_p: 0.95
93
+ top_k: 20
94
+ min_p: 0.0
95
+ presence_penalty: 0.0
96
+ repetition_penalty: 1.0
97
+
98
+ # ── Chat Template ──────────────────────────────────────────────────────────
99
+ default-chat-template-kwargs:
100
+ reasoning_effort: medium
101
+ preserve_thinking: true
102
+ enable_thinking: true
103
+
104
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,86 @@
1
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
2
+ served-model-name: Qwen/Qwen3.8-27B
3
+
4
+ dtype: bfloat16
5
+
6
+ performance-mode: throughput
7
+ optimization-level: 3
8
+ compilation-config:
9
+ cudagraph_num_of_warmups: 5
10
+ custom_ops:
11
+ - +rotary_embedding
12
+ pass_config:
13
+ eliminate_noops: true
14
+ fuse_allreduce_rms: false
15
+
16
+ disable-custom-all-reduce: true
17
+ trust-remote-code: true
18
+ enforce-eager: false
19
+
20
+ max-num-seqs: 8
21
+ max-model-len: 200K
22
+ max-num-batched-tokens: 16K
23
+ gpu-memory-utilization: 0.80
24
+
25
+ enable-auto-tool-choice: true
26
+ tool-call-parser: qwen3_coder
27
+ reasoning-parser: qwen3
28
+
29
+ # ── Attention / linear backends ─────────────────────────────────────────────
30
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
31
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
32
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
33
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
34
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
35
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
36
+ # kernel reads head-major pages 11-17% faster at long context.
37
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
38
+ attention-backend: MJOLNIR
39
+ enable-flashinfer-autotune: true
40
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
41
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
42
+
43
+ # ── KV Cache ─────────────────────────────────────────────────────────────
44
+ kv-cache-dtype: fp8 # the Mjolnir kernel reads e4m3 KV; NVFP4 KV isn't available on SM110 for this arch; FP8 matches the checkpoint's own design (NVFP4 weights, FP8 KV)
45
+ kv-cache-dtype-skip-layers: sliding_window
46
+ mamba-cache-mode: align
47
+ mamba-cache-dtype: bfloat16
48
+ mamba-ssm-cache-dtype: bfloat16
49
+
50
+ # ── Multimodal ─────────────────────────────────────────────────────────────
51
+ language-model-only: false
52
+ mm-encoder-tp-mode: data
53
+ mm-processor-cache-type: shm
54
+ # limit-mm-per-prompt:
55
+ # image: 4
56
+ # video: 0
57
+
58
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
59
+ enable-prefix-caching: true
60
+ enable-chunked-prefill: true
61
+ async-scheduling: true
62
+
63
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
64
+ speculative-config:
65
+ method: mtp
66
+ num_speculative_tokens: 3
67
+
68
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
69
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
70
+ # left to the client/proxy). Included here as the model card's recommendation
71
+ # if you want it pinned at the server instead.
72
+ override-generation-config:
73
+ temperature: 1.0
74
+ top_p: 0.95
75
+ top_k: 20
76
+ min_p: 0.0
77
+ presence_penalty: 0.0
78
+ repetition_penalty: 1.0
79
+
80
+ # ── Chat Template ──────────────────────────────────────────────────────────
81
+ default-chat-template-kwargs:
82
+ reasoning_effort: medium
83
+ preserve_thinking: true
84
+ enable_thinking: true
85
+
86
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,93 @@
1
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
2
+ served-model-name: Qwen/Qwen3.8-27B
3
+
4
+ dtype: bfloat16
5
+
6
+ performance-mode: throughput
7
+ optimization-level: 3
8
+ compilation-config:
9
+ cudagraph_num_of_warmups: 5
10
+ custom_ops:
11
+ - +rotary_embedding
12
+ pass_config:
13
+ eliminate_noops: true
14
+ fuse_allreduce_rms: false
15
+
16
+ disable-custom-all-reduce: true
17
+ trust-remote-code: true
18
+ enforce-eager: false
19
+
20
+ max-num-seqs: 8
21
+ max-model-len: 200K
22
+ max-num-batched-tokens: 16K
23
+ gpu-memory-utilization: 0.80
24
+
25
+ enable-auto-tool-choice: true
26
+ tool-call-parser: qwen3_coder
27
+ reasoning-parser: qwen3
28
+
29
+ # ── Attention / linear backends ─────────────────────────────────────────────
30
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
31
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
32
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
33
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
34
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
35
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
36
+ # kernel reads head-major pages 11-17% faster at long context.
37
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
38
+ # KV format: fp6 e2m3 (see the KV Cache section).
39
+ attention-backend: MJOLNIR
40
+ enable-flashinfer-autotune: true
41
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
42
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
43
+
44
+ # ── KV Cache ─────────────────────────────────────────────────────────────
45
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
46
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
47
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
48
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
49
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
50
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
51
+ kv-cache-dtype: fp6_e2m3
52
+ kv-cache-dtype-skip-layers: sliding_window
53
+ mamba-cache-mode: align
54
+ mamba-cache-dtype: bfloat16
55
+ mamba-ssm-cache-dtype: bfloat16
56
+
57
+ # ── Multimodal ─────────────────────────────────────────────────────────────
58
+ language-model-only: false
59
+ mm-encoder-tp-mode: data
60
+ mm-processor-cache-type: shm
61
+ # limit-mm-per-prompt:
62
+ # image: 4
63
+ # video: 0
64
+
65
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
66
+ enable-prefix-caching: true
67
+ enable-chunked-prefill: true
68
+ async-scheduling: true
69
+
70
+ # ── Speculative Decoding — MTP (built-in head), K=3 ─────────────────────
71
+ speculative-config:
72
+ method: mtp
73
+ num_speculative_tokens: 3
74
+
75
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
76
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
77
+ # left to the client/proxy). Included here as the model card's recommendation
78
+ # if you want it pinned at the server instead.
79
+ override-generation-config:
80
+ temperature: 1.0
81
+ top_p: 0.95
82
+ top_k: 20
83
+ min_p: 0.0
84
+ presence_penalty: 0.0
85
+ repetition_penalty: 1.0
86
+
87
+ # ── Chat Template ──────────────────────────────────────────────────────────
88
+ default-chat-template-kwargs:
89
+ reasoning_effort: medium
90
+ preserve_thinking: true
91
+ enable_thinking: true
92
+
93
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja
@@ -0,0 +1,123 @@
1
+ # NVFP4_MJOLNIR_E2M3_DFLASH2 — EXPERIMENT (opt-in e2e leg, Mjolnir image): NVFP4_MJOLNIR_E2M3
2
+ # (Mjolnir decode kernel, fp6 KV) with the DFlash2 drafter instead of the built-in MTP head.
3
+ # The target's verify steps (1 + 7 tokens) run on Mjolnir; the drafter runs on
4
+ # FlashInfer with bf16 KV. Unlike DSpark it stays there: its 5 layers are
5
+ # sliding-window (2048 tokens), which neither the decode kernel nor the FA4
6
+ # fallback implements — and a 2048-token window caps its KV at ~42 MB per
7
+ # request on bf16, so fp6 would save ~26 MB a request. Measure it next to the
8
+ # headline pair:
9
+ # mjolnir bench e2e --optional (all optional legs)
10
+ # mjolnir bench e2e --only mjolnir --config NVFP4_MJOLNIR_E2M3_DFLASH2
11
+ # Untested on Thor before its first run: if the server refuses fp6 for the
12
+ # drafter's layers, the skip list below did not reach them — serve the fp8
13
+ # variant (copy this file, kv-cache-dtype: fp8) and report the log line.
14
+ model: QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
15
+ served-model-name: Qwen/Qwen3.8-27B
16
+
17
+ dtype: bfloat16
18
+
19
+ performance-mode: throughput
20
+ optimization-level: 3
21
+ compilation-config:
22
+ cudagraph_num_of_warmups: 5
23
+ custom_ops:
24
+ - +rotary_embedding
25
+ pass_config:
26
+ eliminate_noops: true
27
+ fuse_allreduce_rms: false
28
+
29
+ disable-custom-all-reduce: true
30
+ trust-remote-code: true
31
+ enforce-eager: false
32
+
33
+ max-num-seqs: 8
34
+ max-model-len: 200K
35
+ max-num-batched-tokens: 16K
36
+ gpu-memory-utilization: 0.80
37
+
38
+ enable-auto-tool-choice: true
39
+ tool-call-parser: qwen3_coder
40
+ reasoning-parser: qwen3
41
+
42
+ # ── Attention / linear backends ─────────────────────────────────────────────
43
+ # The 16 full-attention (head_dim=256) layers run the Mjolnir decode kernel
44
+ # (decode steps) on top of FlashAttention 4 (prefill, KV writes, mixed steps):
45
+ # the image resolves FLASH_ATTN to FA4 for MJOLNIR on sm_110 — no
46
+ # flash_attn_version needed here — and FA4's hd256 kernel pins the KV page to
47
+ # 128 tokens. MJOLNIR_ATTN_FALLBACK=FLASHINFER restores the FlashInfer prefill.
48
+ # `mjolnir serve` adds VLLM_KV_CACHE_LAYOUT=HND for MJOLNIR configs: the
49
+ # kernel reads head-major pages 11-17% faster at long context.
50
+ # Kernel knobs: MJOLNIR_ATTN_* env vars (see src/mjolnir/README.md).
51
+ # KV format: fp6 e2m3 (see the KV Cache section).
52
+ attention-backend: MJOLNIR
53
+ enable-flashinfer-autotune: true
54
+ mm-encoder-attn-backend: TORCH_SDPA # SM110 ViT PTX-crash workaround (vLLM issue #38411)
55
+ linear-backend: auto # do NOT hardcode flashinfer-cutlass — that's the RTX5090/SM120 GEMM path, not SM110
56
+
57
+ # ── KV Cache ─────────────────────────────────────────────────────────────
58
+ # NVFP4_MJOLNIR_E2M3 — the ONLY change vs NVFP4_MJOLNIR: a 6-bit e2m3 KV cache
59
+ # (4 values in 3 bytes, 25% fewer KV bytes than fp8, +33% tokens in the same
60
+ # memory). Mjolnir's decode kernel reads it directly (tcgen05 kind::f8f6f4);
61
+ # prefill / mixed steps expand the pages they read to fp8 for FlashAttention 4.
62
+ # Needs per-(layer, KV head) scales: `mjolnir calibrate` writes kv_scales.json
63
+ # next to this file, and `mjolnir serve` points MJOLNIR_ATTN_KV_SCALES at it.
64
+ kv-cache-dtype: fp6_e2m3
65
+ # The drafter's layers (indices 64-68, after the target's 64) keep bf16 KV:
66
+ # kv_scales.json calibrates the target only.
67
+ kv-cache-dtype-skip-layers: ["sliding_window", "64", "65", "66", "67", "68"]
68
+ mamba-cache-mode: align
69
+ mamba-cache-dtype: bfloat16
70
+ mamba-ssm-cache-dtype: bfloat16
71
+
72
+ # ── Multimodal ─────────────────────────────────────────────────────────────
73
+ language-model-only: false
74
+ mm-encoder-tp-mode: data
75
+ mm-processor-cache-type: shm
76
+ # limit-mm-per-prompt:
77
+ # image: 4
78
+ # video: 0
79
+
80
+ # ── Caching & Scheduling ─────────────────────────────────────────────────
81
+ enable-prefix-caching: true
82
+ enable-chunked-prefill: true
83
+ async-scheduling: true
84
+
85
+ # ── Speculative Decoding — DFlash2 drafter, K=7 ─────────────────────────
86
+ # The DFlash2 block-diffusion drafter (5 Qwen3 layers, 2048-token sliding
87
+ # window, non-causal block attention, a grouped local convolution and a
88
+ # top-16 candidate selector) — architecture DFlash2DraftModel, native in vLLM
89
+ # 0.31.0 (vllm-project/vllm#52816) under method "dflash".
90
+ # num_speculative_tokens 7 — the checkpoint's block size is 8 (1 anchor + 7)
91
+ # the drafter shares the TARGET's lm_head: keep it unquantized — do not stack
92
+ # the fp8 lm_head / draft-vocab env knobs (LMH8, VT*) on this config
93
+ # DFlash2 lives on the V2 model runner (vLLM 0.31's default); if the log says
94
+ # "Model Runner V2 does not yet support …", the drafter silently degrades to
95
+ # DFlash1 drafting — check the acceptance rate before trusting a number
96
+ # z-lab/Qwen3.8-27B-DFlash2 mirrors the same checkpoint.
97
+ speculative-config:
98
+ method: dflash
99
+ model: incoai/Qwen3.8-27B-DFlash2
100
+ num_speculative_tokens: 7
101
+ # the drafter's own attention backend: its sliding-window layers hold bf16 KV
102
+ # (the skip list in the KV Cache section) — MJOLNIR has no sliding window
103
+ attention_backend: FLASHINFER
104
+
105
+ # ── Generation defaults (Qwen3.8 card's documented Thinking-mode preset) ────
106
+ # NOTE: the verified Thor launch args do not set this server-side (sampling is
107
+ # left to the client/proxy). Included here as the model card's recommendation
108
+ # if you want it pinned at the server instead.
109
+ override-generation-config:
110
+ temperature: 1.0
111
+ top_p: 0.95
112
+ top_k: 20
113
+ min_p: 0.0
114
+ presence_penalty: 0.0
115
+ repetition_penalty: 1.0
116
+
117
+ # ── Chat Template ──────────────────────────────────────────────────────────
118
+ default-chat-template-kwargs:
119
+ reasoning_effort: medium
120
+ preserve_thinking: true
121
+ enable_thinking: true
122
+
123
+ chat-template: /configs/Qwen/Qwen3.8_chat_template.jinja