jcbtc commited on
Commit
0da14e4
·
verified ·
1 Parent(s): 0f02cc7

Fix ROCm MLA LSE layout; preserve CIRU refs

Browse files
.gitattributes CHANGED
@@ -4,4 +4,4 @@
4
  *.md text eol=lf
5
  *.png filter=lfs diff=lfs merge=lfs -text
6
  *.safetensors filter=lfs diff=lfs merge=lfs -text
7
- Ling-3.0-Flash-CIRU-int4-Strix-native.tar.gz filter=lfs diff=lfs merge=lfs -text
 
4
  *.md text eol=lf
5
  *.png filter=lfs diff=lfs merge=lfs -text
6
  *.safetensors filter=lfs diff=lfs merge=lfs -text
7
+ runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle filter=lfs diff=lfs merge=lfs -text
CHANGELOG.md CHANGED
@@ -6,8 +6,8 @@
6
  - Model revision: `ca3ea63b0255d212c4fe6020db9e0a51ce136006`
7
  - Model format: 24 safetensors shards, 77,012,299,464 bytes total
8
  - vLLM upstream base: `d35eb6c44071ea806018841c490f0d2f3219c485`
9
- - CIRU runtime head: `388d82de2abe418e73380ba250270d3abc62ac12`
10
- - Net vLLM delta: six files, 365 insertions, 26 deletions
11
 
12
  ## Weight changes
13
 
@@ -23,6 +23,10 @@ Uses 512 rather than 1024 merge threads on ROCm so Wave32 hardware does not exce
23
 
24
  Adds an opt-in Torch implementation selected by `VLLM_ROCM_SAFE_MERGE_ATTN_STATES=1`. It handles token-first and head-first LSE layouts and avoids an observed `gfx1151` HSA fault in the Triton merge kernel.
25
 
 
 
 
 
26
  ### `vllm/v1/attention/backends/mla/triton_mla.py`
27
 
28
  Declares uniform query-length support and converts causal multi-token verifier blocks into per-token Triton MLA decode rows with correct causal KV-prefix lengths. This is relevant to MLA speculative verification, not W4A16 specifically.
@@ -39,6 +43,10 @@ Adds a low-launch-overhead Triton reduction for one to three tokens, top-k 8, an
39
 
40
  Wires the guarded WNA16 paths together and adds the exact small-shape `gfx1151` SiLU-and-multiply kernel. Every adjacent shape or unsupported configuration retains the upstream route.
41
 
 
 
 
 
42
  ## Runtime configuration
43
 
44
  - Triton MLA attention
@@ -68,3 +76,4 @@ The final exact-shape SiLU candidate passed bitwise source fixtures and exact ou
68
  - Added an explicitly experimental Windows 11 WSL2/AMD ROCDXG path; native Windows vLLM is not claimed.
69
  - Initially changed the public native-256K profile from `gpu_memory_utilization=0.82` to the measured `0.75` envelope used by the retained 60K benchmark; the release default was subsequently reduced to `0.72` as recorded above.
70
  - Added the retained 60K PP/TG comparison against AtomicChat AD-IQ4_XXS and ROCmFP4 STRIX MTP, with the native row marked for a final-commit refresh.
 
 
6
  - Model revision: `ca3ea63b0255d212c4fe6020db9e0a51ce136006`
7
  - Model format: 24 safetensors shards, 77,012,299,464 bytes total
8
  - vLLM upstream base: `d35eb6c44071ea806018841c490f0d2f3219c485`
9
+ - CIRU runtime head: `91fab4e6dcaa683911655630dae8a5b140a7cb91`
10
+ - Net vLLM delta: eight files, 459 insertions, 28 deletions, including regression tests
11
 
12
  ## Weight changes
13
 
 
23
 
24
  Adds an opt-in Torch implementation selected by `VLLM_ROCM_SAFE_MERGE_ATTN_STATES=1`. It handles token-first and head-first LSE layouts and avoids an observed `gfx1151` HSA fault in the Triton merge kernel.
25
 
26
+ ### `vllm/v1/attention/backends/mla/prefill/flash_attn.py`
27
+
28
+ Normalizes the LSE returned by upstream ROCm FlashAttention variable-length prefill from token-first `[tokens, heads]` to vLLM's documented head-first `[heads, tokens]` adapter contract. This prevents heterogeneous chunked-prefill batches from copying a head extent into a token extent in the MLA context accumulator.
29
+
30
  ### `vllm/v1/attention/backends/mla/triton_mla.py`
31
 
32
  Declares uniform query-length support and converts causal multi-token verifier blocks into per-token Triton MLA decode rows with correct causal KV-prefix lengths. This is relevant to MLA speculative verification, not W4A16 specifically.
 
43
 
44
  Wires the guarded WNA16 paths together and adds the exact small-shape `gfx1151` SiLU-and-multiply kernel. Every adjacent shape or unsupported configuration retains the upstream route.
45
 
46
+ ### `tests/v1/attention/test_mla_prefill_quant_output.py`
47
+
48
+ Adds adapter-layout coverage for both upstream ROCm FlashAttention and vLLM FlashAttention, plus an adapter-to-accumulator regression that exercises the formerly failing token/head extent mismatch.
49
+
50
  ## Runtime configuration
51
 
52
  - Triton MLA attention
 
76
  - Added an explicitly experimental Windows 11 WSL2/AMD ROCDXG path; native Windows vLLM is not claimed.
77
  - Initially changed the public native-256K profile from `gpu_memory_utilization=0.82` to the measured `0.75` envelope used by the retained 60K benchmark; the release default was subsequently reduced to `0.72` as recorded above.
78
  - Added the retained 60K PP/TG comparison against AtomicChat AD-IQ4_XXS and ROCmFP4 STRIX MTP, with the native row marked for a final-commit refresh.
79
+ - Fixed the ROCm MLA chunked-prefill LSE layout mismatch in runtime commit `91fab4e6d`. Focused attention tests passed 31/31 (with one unrelated CUDA-only FA4 test deselected), and the exact five-request tool-calling reproducer completed 5/5 scenarios with zero errors while the original server PID remained alive.
MANIFEST.json CHANGED
@@ -22,11 +22,11 @@
22
  "runtime": {
23
  "upstream_repo": "https://github.com/vllm-project/vllm.git",
24
  "upstream_base": "d35eb6c44071ea806018841c490f0d2f3219c485",
25
- "ciru_head": "388d82de2abe418e73380ba250270d3abc62ac12",
26
- "commits_ahead": 15,
27
- "net_files_changed": 6,
28
- "net_insertions": 365,
29
- "net_deletions": 26
30
  },
31
  "validated_stack": {
32
  "python": "3.12.12",
@@ -60,7 +60,17 @@
60
  "c4_aggregate_decode_tokens_per_second": 59.03,
61
  "c5_aggregate_decode_tokens_per_second": 62.16,
62
  "validated_max_concurrency": 5,
63
- "c6_status": "engine failure in chunked-prefill MLA accumulation; public profiles cap active sequences below this boundary"
 
 
 
 
 
 
 
 
 
 
64
  },
65
  "retained_60k_prompt_512_output": {
66
  "native_source": "fabbc7e928dfa64c29dcdf0f795b05246555f4ae",
 
22
  "runtime": {
23
  "upstream_repo": "https://github.com/vllm-project/vllm.git",
24
  "upstream_base": "d35eb6c44071ea806018841c490f0d2f3219c485",
25
+ "ciru_head": "91fab4e6dcaa683911655630dae8a5b140a7cb91",
26
+ "commits_ahead": 16,
27
+ "net_files_changed": 8,
28
+ "net_insertions": 459,
29
+ "net_deletions": 28
30
  },
31
  "validated_stack": {
32
  "python": "3.12.12",
 
60
  "c4_aggregate_decode_tokens_per_second": 59.03,
61
  "c5_aggregate_decode_tokens_per_second": 62.16,
62
  "validated_max_concurrency": 5,
63
+ "c6_status": "not rerun after the LSE layout fix; no post-fix C6 claim"
64
+ },
65
+ "rocm_mla_lse_fix_validation": {
66
+ "runtime_commit": "91fab4e6dcaa683911655630dae8a5b140a7cb91",
67
+ "focused_tests_passed": 31,
68
+ "cuda_only_tests_deselected": 1,
69
+ "reproducer_concurrency": 5,
70
+ "reproducer_scenarios_passed": 5,
71
+ "reproducer_request_error_rate": 0.0,
72
+ "server_process_survived": true,
73
+ "result_sha256": "f819148f8d49342a73fac2c8be6ce6cd08dfca01c238e94dd586bbd6e5894cd7"
74
  },
75
  "retained_60k_prompt_512_output": {
76
  "native_source": "fabbc7e928dfa64c29dcdf0f795b05246555f4ae",
README.md CHANGED
@@ -28,10 +28,11 @@ The model weights were **not** changed, requantized, merged, fine-tuned, or rena
28
 
29
  ## What this release changes
30
 
31
- The runtime is based on vLLM commit `d35eb6c44071ea806018841c490f0d2f3219c485` plus a 15-commit CIRU branch ending at `388d82de2abe418e73380ba250270d3abc62ac12`. Its net source delta is six files, 365 insertions, and 26 deletions.
32
 
33
  - Includes [`liminfei-amd`'s Wave32 LDS fix](https://github.com/vllm-project/vllm/pull/46012) for the ROCm top-k merge launch, preserving the AMD author's commit credit.
34
  - Adds an opt-in safe PyTorch attention-state merge for a `gfx1151` Triton/HSA fault, including both supported MLA LSE layouts.
 
35
  - Routes causal uniform multi-token MLA verification blocks through Triton decode with correct per-token sequence lengths.
36
  - Adds narrowly guarded W4A16 MoE decode/verification fast paths for Ling's exact small-token geometry.
37
  - Adds a `gfx1151` Triton SiLU-and-multiply kernel for Ling's exact eager W4A16 shapes.
@@ -111,7 +112,7 @@ The named release archive is `Ling-3.0-Flash-CIRU-int4-Strix-native.tar.gz`. It
111
 
112
  ## Quick start
113
 
114
- The exact validated environment is Python 3.12, Torch `2.13.0+rocm7.15.0a20260728`, HIP `7.15.0`, Triton `3.8.0+git4cff872c.rocm7.15.0a20260728`, FlashAttention `2.8.3`, and the CIRU vLLM source at `388d82de2`.
115
 
116
  For a guided install, run this from the repository root:
117
 
@@ -189,7 +190,7 @@ The exact runtime has been validated on CIRU's native-Linux NixOS Strix Halo hos
189
 
190
  The official checkpoint is natively configured and trained for 256K context. `run-256k.sh` uses `max_model_len=262144`, `max_num_seqs=5`, and `gpu_memory_utilization=0.72`. On CIRU's 128 GB Strix Halo host, this exact profile reported a 1,552,168-token KV pool and 5.92x capacity at 262,144 tokens per request, enough for five full native-context sequences.
191
 
192
- Five is also the validated serving safety cap. A six-request 2K+256 simultaneous burst terminated the engine in the chunked-prefill MLA accumulation path with an LSE extent mismatch. With `max_num_seqs=5`, additional requests wait in the scheduler instead of entering that unvalidated C6 path.
193
 
194
  The 1M profile is an experimental 4x YaRN extension, not native 1M training. It uses `max_model_len=1048576`, `max_num_seqs=2`, and `gpu_memory_utilization=0.82`; further requests wait in the vLLM scheduler.
195
 
@@ -199,6 +200,7 @@ The fork remains a vLLM runtime and safely falls back to upstream paths when its
199
 
200
  - The Wave32 top-k fix is broadly relevant to ROCm Wave32 GPUs.
201
  - Safe attention merging and uniform verifier routing are relevant to compatible ROCm MLA workloads, independent of W4A16.
 
202
  - The W4A16 fast assignment path currently requires 512 experts, top-k 8, block size 32, and one to three tokens.
203
  - The fast reduction requires hidden size 2560 and top-k 8.
204
  - The SiLU path requires exact `(8,1536)->(8,768)` or `(16,1536)->(16,768)` BF16 shapes on `gfx1151`.
 
28
 
29
  ## What this release changes
30
 
31
+ The runtime is based on vLLM commit `d35eb6c44071ea806018841c490f0d2f3219c485` plus a 16-commit CIRU branch ending at `91fab4e6dcaa683911655630dae8a5b140a7cb91`. Its net source delta is eight files, 459 insertions, and 28 deletions, including regression tests.
32
 
33
  - Includes [`liminfei-amd`'s Wave32 LDS fix](https://github.com/vllm-project/vllm/pull/46012) for the ROCm top-k merge launch, preserving the AMD author's commit credit.
34
  - Adds an opt-in safe PyTorch attention-state merge for a `gfx1151` Triton/HSA fault, including both supported MLA LSE layouts.
35
+ - Normalizes the upstream ROCm FlashAttention variable-length LSE result to vLLM's documented head-first layout before chunked MLA context accumulation.
36
  - Routes causal uniform multi-token MLA verification blocks through Triton decode with correct per-token sequence lengths.
37
  - Adds narrowly guarded W4A16 MoE decode/verification fast paths for Ling's exact small-token geometry.
38
  - Adds a `gfx1151` Triton SiLU-and-multiply kernel for Ling's exact eager W4A16 shapes.
 
112
 
113
  ## Quick start
114
 
115
+ The exact validated environment is Python 3.12, Torch `2.13.0+rocm7.15.0a20260728`, HIP `7.15.0`, Triton `3.8.0+git4cff872c.rocm7.15.0a20260728`, FlashAttention `2.8.3`, and the CIRU vLLM source at `91fab4e6d`.
116
 
117
  For a guided install, run this from the repository root:
118
 
 
190
 
191
  The official checkpoint is natively configured and trained for 256K context. `run-256k.sh` uses `max_model_len=262144`, `max_num_seqs=5`, and `gpu_memory_utilization=0.72`. On CIRU's 128 GB Strix Halo host, this exact profile reported a 1,552,168-token KV pool and 5.92x capacity at 262,144 tokens per request, enough for five full native-context sequences.
192
 
193
+ Five is the packaged concurrency setting and the validated simultaneous serving load. The earlier MLA accumulator failure was reproduced with five heterogeneous tool-calling requests and root-caused to the ROCm upstream FlashAttention LSE result arriving as `[tokens, heads]` while vLLM's chunk accumulator requires `[heads, tokens]`; it was not caused by a request occupying “slot 5.” Runtime commit `91fab4e6d` normalizes that adapter output. The exact five-request reproducer then completed 5/5 scenarios with zero request errors and the same server process remained healthy. Six-way serving has not been rerun after this fix, so this release makes no C6 stability claim. Requests beyond the configured five wait in vLLM's scheduler.
194
 
195
  The 1M profile is an experimental 4x YaRN extension, not native 1M training. It uses `max_model_len=1048576`, `max_num_seqs=2`, and `gpu_memory_utilization=0.82`; further requests wait in the vLLM scheduler.
196
 
 
200
 
201
  - The Wave32 top-k fix is broadly relevant to ROCm Wave32 GPUs.
202
  - Safe attention merging and uniform verifier routing are relevant to compatible ROCm MLA workloads, independent of W4A16.
203
+ - The upstream ROCm FlashAttention LSE normalization is relevant to compatible ROCm MLA chunked-prefill workloads, independent of Ling's W4A16 geometry.
204
  - The W4A16 fast assignment path currently requires 512 experts, top-k 8, block size 32, and one to three tokens.
205
  - The fast reduction requires hidden size 2560 and top-k 8.
206
  - The SiLU path requires exact `(8,1536)->(8,768)` or `(16,1536)->(16,768)` BF16 shapes on `gfx1151`.
SHA256SUMS CHANGED
@@ -1,22 +1,22 @@
1
  7b77dda00cc6bd6d0ce15f7c055f9e997f56e1cf1709c61cca5a57283ce3f008 .gitattributes
2
- 411ac21b4849cb3bf65f84a55263550dcd658e0623c2b117233ba1fced1c17ff assets/ling30int4.png
3
- 65cf5b48f9df164c40fbac98e21c6f9c5ced98660d653630cb58f5ab4b28919f CHANGELOG.md
4
- 16213dfa6abe90226ab92f9407f3bb92f9ed729e30bb8c37ffd92c7dbc999c73 config/experimental-yarn-1m.env
5
- c3cdeda6c1bdd47f2b947eac7c4c7182e27249220ddd6eb372c5d12c2c6c405f config/native-256k.env
6
- 0bb41680a6f0c8366e8f883ca7d76ce1a2ccd3e42541f6d0616df33fe867f55a docs/BENCHMARKS.md
7
  500a1953f2e27379ff90a70db485251c781290a49a3837fd91783e04adadd597 docs/UBUNTU_BUILD.md
8
- 23336099c40774a77a555165da7aee562d5e603017201668178f35f6a8e5cd0d docs/VALIDATED_ENVIRONMENT.md
9
- 3176eba46cccbd60d33589230190e530eaace8c96466c9621772a1f2c50c07e4 docs/WINDOWS_WSL2.md
10
  e7128cfb97cfac9d144cb999a45b7506c612a8678cfec7f292e00a23ebb8ca8d install.sh
11
- 852b2422c20355b533884dae00f330aea8e836efecf0b070d59b3e848540c169 MANIFEST.json
12
- e0fe2d5b9a74a077f1fc4316fb8b7d2d5c57f5cd2aaf4287cd4518761ed2dbaa README.md
13
- 15e48a8df3b65a73c81cf73c820ba12b4ab9474697d6b3f876c26c0b0cd3d455 runtime/COMMITS.txt
14
- 6b03af3a1685a1969ff96870ea776537f5f67fd3674fc353880bd088bcef9a9c runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle
15
- 8f307e9f2f16207856ca0b064a765a73bbebc029ad0b0fed61e5975a17e07ab6 runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.patch
16
- f4caeda80ed751a40fa976aa7853357b88075e6eb6d2d49e68b0bc8599754c34 runtime/SHA256SUMS.runtime
17
- 2c066e583d3b24d4c0caa7d04263228dff80e464c61a557736e9c5c5f79b9869 scripts/build-vllm-gfx1151.sh
18
  e6e987937ae4cb544b0aa9b3c90c29acd99c0a9bb8569d42bc95ea7169be245e scripts/download-model.sh
19
  8142ef953e2c9618df885756eb897303e6443a4d139a09fe9a882c80d054f466 scripts/install-host-deps.sh
20
- 27d3cfba9f4178f83cbd2d7e44db098ab69e515f76e5c98c40ac219b7b0597ca scripts/run-1m-yarn-experimental.sh
21
- 296ee94a925db5b97e21afb6ffd4ae3c0cc1c2be67af81e21350f43efaa59ead scripts/run-256k.sh
22
  718bd922b3bb0a07fb9e2bb0c5ca9a67b799582ac6f614c17af291793e2a69e0 scripts/run-common.sh
 
1
  7b77dda00cc6bd6d0ce15f7c055f9e997f56e1cf1709c61cca5a57283ce3f008 .gitattributes
2
+ 411ac21b4849cb3bf65f84a55263550dcd658e0623c2b117233ba1fced1c17ff assets/ling30int4.png
3
+ 45bdb22fa81cdd2d41b111060db97ab6eebdf176d37eba87065ffe6e8d49843c CHANGELOG.md
4
+ 16213dfa6abe90226ab92f9407f3bb92f9ed729e30bb8c37ffd92c7dbc999c73 config/experimental-yarn-1m.env
5
+ c3cdeda6c1bdd47f2b947eac7c4c7182e27249220ddd6eb372c5d12c2c6c405f config/native-256k.env
6
+ 658f33987b057ac0d62a9bad61eb437187d1509e1275424778ddf570476db112 docs/BENCHMARKS.md
7
  500a1953f2e27379ff90a70db485251c781290a49a3837fd91783e04adadd597 docs/UBUNTU_BUILD.md
8
+ 7014d768a0cd85681404e2d571325ae250f6a0713b4ca78c08d69a29ee8916d4 docs/VALIDATED_ENVIRONMENT.md
9
+ 3176eba46cccbd60d33589230190e530eaace8c96466c9621772a1f2c50c07e4 docs/WINDOWS_WSL2.md
10
  e7128cfb97cfac9d144cb999a45b7506c612a8678cfec7f292e00a23ebb8ca8d install.sh
11
+ 57ec70f2fb867e5de28dce1e3ef9d66ac879f78fc502e95da42d3b79c09478a4 MANIFEST.json
12
+ 496be3874793c2902e3baf419c0e3b8941a7b331e480f0dc09f9e228bec2d6fe README.md
13
+ a14fcd3747829be98a73a453057bd451a492d87a236c2affcf57db1cbbf18386 runtime/COMMITS.txt
14
+ 9cbcbbef5e113e22b753801ee141bd877b20c84f25f15cc159d0ae508aaf4324 runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle
15
+ c0c1446ea2c7334ef8b888f3104ec660d2ab41d2cb08bb9d90a3f589dba040e8 runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.patch
16
+ ecab16a7d189d48ff85942ebefd49f2c206445a4e4a85de440ebde19b6555551 runtime/SHA256SUMS.runtime
17
+ ca51fd447132732880d523db21527fce6f8126925fb175705640037eaecd5f97 scripts/build-vllm-gfx1151.sh
18
  e6e987937ae4cb544b0aa9b3c90c29acd99c0a9bb8569d42bc95ea7169be245e scripts/download-model.sh
19
  8142ef953e2c9618df885756eb897303e6443a4d139a09fe9a882c80d054f466 scripts/install-host-deps.sh
20
+ 27d3cfba9f4178f83cbd2d7e44db098ab69e515f76e5c98c40ac219b7b0597ca scripts/run-1m-yarn-experimental.sh
21
+ 296ee94a925db5b97e21afb6ffd4ae3c0cc1c2be67af81e21350f43efaa59ead scripts/run-256k.sh
22
  718bd922b3bb0a07fb9e2bb0c5ca9a67b799582ac6f614c17af291793e2a69e0 scripts/run-common.sh
docs/BENCHMARKS.md CHANGED
@@ -18,7 +18,7 @@ The native row used the then-current `gpu_memory_utilization=0.75`, 262,144-cont
18
 
19
  ### Update status
20
 
21
- The native 60K row was measured at CIRU runtime commit `fabbc7e928dfa64c29dcdf0f795b05246555f4ae`, immediately before the final exact-shape SiLU kernel commit. The released commit `388d82de2abe418e73380ba250270d3abc62ac12` has not yet been rerun on this 60K protocol. The table is therefore a valid retained comparison, but not a claim that 19.92 tok/s is the final commit's maximum 60K speed. Replace the native row only after a matched rerun of all three stacks or a clearly labeled native-only refresh.
22
 
23
  ## Short decode and concurrent serving
24
 
 
18
 
19
  ### Update status
20
 
21
+ The native 60K row was measured at CIRU runtime commit `fabbc7e928dfa64c29dcdf0f795b05246555f4ae`, before the final exact-shape SiLU kernel and ROCm MLA LSE-layout commits. The released commit `91fab4e6dcaa683911655630dae8a5b140a7cb91` has not yet been rerun on this 60K protocol. The table is therefore a valid retained comparison, but not a claim that 19.92 tok/s is the final commit's maximum 60K speed. Replace the native row only after a matched rerun of all three stacks or a clearly labeled native-only refresh.
22
 
23
  ## Short decode and concurrent serving
24
 
docs/VALIDATED_ENVIRONMENT.md CHANGED
@@ -19,7 +19,7 @@
19
  - torchaudio `2.11.0.2+rocm7.15.0a20260728`
20
  - FlashAttention `2.8.3`, Dao-AILab commit `0e60e39473e8df549a20fb5353760f7a65b30e2d`, Python-only AMD Triton path
21
  - vLLM upstream base `d35eb6c44071ea806018841c490f0d2f3219c485`
22
- - CIRU runtime head `388d82de2abe418e73380ba250270d3abc62ac12`
23
 
24
  ## Build facts
25
 
@@ -34,4 +34,6 @@ The Ubuntu/Debian, Fedora, Arch, and Windows/WSL build paths in this package are
34
 
35
  The published native-256K launcher defaults to `gpu_memory_utilization=0.72`, `max_model_len=262144`, and `max_num_seqs=5`. The running CIRU profile exposed a 1,552,168-token KV pool and reported 5.92x maximum concurrency at the full native context. Users who do not need that KV-cache capacity can lower the memory fraction to leave more unified memory free, at the cost of full-context concurrency.
36
 
 
 
37
  The retained 60K+512 benchmark was measured earlier at `gpu_memory_utilization=0.75`; that historical measurement completed without faults but left only about 2 GiB of available system memory at peak. Its result is not relabeled as a 0.72 measurement.
 
19
  - torchaudio `2.11.0.2+rocm7.15.0a20260728`
20
  - FlashAttention `2.8.3`, Dao-AILab commit `0e60e39473e8df549a20fb5353760f7a65b30e2d`, Python-only AMD Triton path
21
  - vLLM upstream base `d35eb6c44071ea806018841c490f0d2f3219c485`
22
+ - CIRU runtime head `91fab4e6dcaa683911655630dae8a5b140a7cb91`
23
 
24
  ## Build facts
25
 
 
34
 
35
  The published native-256K launcher defaults to `gpu_memory_utilization=0.72`, `max_model_len=262144`, and `max_num_seqs=5`. The running CIRU profile exposed a 1,552,168-token KV pool and reported 5.92x maximum concurrency at the full native context. Users who do not need that KV-cache capacity can lower the memory fraction to leave more unified memory free, at the cost of full-context concurrency.
36
 
37
+ The release head includes a ROCm MLA adapter fix that normalizes upstream FlashAttention LSE output to vLLM's head-first accumulator contract. Focused attention coverage passed 31 tests, with one unrelated CUDA-only FA4 test deliberately deselected. The exact heterogeneous five-request workload that previously exposed the mismatch completed all five scenarios with zero request errors after the fix, and the original server process remained healthy. C6 has not been rerun after the fix.
38
+
39
  The retained 60K+512 benchmark was measured earlier at `gpu_memory_utilization=0.75`; that historical measurement completed without faults but left only about 2 GiB of available system memory at peak. Its result is not relabeled as a 0.72 measurement.
runtime/COMMITS.txt CHANGED
@@ -13,3 +13,4 @@ abfff126e0698d98f1872f87f501d36a19382240 Optimize single-token MoE reduction
13
  928e725a9dbcdbea0bf6c914c8b3fe93f08b0d3f Optimize K2 verification MoE support kernels
14
  fabbc7e928dfa64c29dcdf0f795b05246555f4ae Extend MoE support fast path to K1 verification
15
  388d82de2abe418e73380ba250270d3abc62ac12 ROCm: optimize exact small WNA16 SiLU activation
 
 
13
  928e725a9dbcdbea0bf6c914c8b3fe93f08b0d3f Optimize K2 verification MoE support kernels
14
  fabbc7e928dfa64c29dcdf0f795b05246555f4ae Extend MoE support fast path to K1 verification
15
  388d82de2abe418e73380ba250270d3abc62ac12 ROCm: optimize exact small WNA16 SiLU activation
16
+ 91fab4e6dcaa683911655630dae8a5b140a7cb91 [Bugfix][ROCm][MLA] Normalize upstream FlashAttention LSE layout
runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle CHANGED
Binary files a/runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle and b/runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle differ
 
runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.patch CHANGED
@@ -1,5 +1,5 @@
1
  diff --git a/csrc/libtorch_stable/sampler.cu b/csrc/libtorch_stable/sampler.cu
2
- index 519e213281cd07a9a4cc81f7bc5fcb843277528d..847d8284afc992c3f75e2d65f240afe3d3d0e0e3 100644
3
  --- a/csrc/libtorch_stable/sampler.cu
4
  +++ b/csrc/libtorch_stable/sampler.cu
5
  @@ -711,7 +711,12 @@ void top_k_per_row_decode(const torch::stable::Tensor& logits, int64_t next_n,
@@ -15,8 +15,129 @@ index 519e213281cd07a9a4cc81f7bc5fcb843277528d..847d8284afc992c3f75e2d65f240afe3
15
  vllm::topKPerRowDecode<kNumThreadsPerBlockMerge, true, false, true>
16
  <<<numRows, kNumThreadsPerBlockMerge, topK * sizeof(int32_t), stream>>>(
17
  outLogitsAux.const_data_ptr<float>(), seqLens.const_data_ptr<int>(),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  diff --git a/vllm/model_executor/layers/fused_moe/experts/triton_moe.py b/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
19
- index 9d93dfe54ac1a81d5c1f512bc266b9732506e31a..dd96f6da4cc3e3655bbab58f64ceed0882f2e7c0 100644
20
  --- a/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
21
  +++ b/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
22
  @@ -27,6 +27,7 @@ from vllm.model_executor.layers.fused_moe.fused_moe import (
@@ -225,7 +346,7 @@ index 9d93dfe54ac1a81d5c1f512bc266b9732506e31a..dd96f6da4cc3e3655bbab58f64ceed08
225
  + # separate function is required for MoE + LoRA
226
  + self.moe_sum(intermediate_cache3, output)
227
  diff --git a/vllm/model_executor/layers/fused_moe/fused_moe.py b/vllm/model_executor/layers/fused_moe/fused_moe.py
228
- index be4930052a9a1c883679f7e7415853b2f9c9f667..034c963b7cee65d253e9c27517463c2e59b2d1c0 100644
229
  --- a/vllm/model_executor/layers/fused_moe/fused_moe.py
230
  +++ b/vllm/model_executor/layers/fused_moe/fused_moe.py
231
  @@ -97,6 +97,7 @@ def fused_moe_kernel_gptq_awq(
@@ -294,7 +415,7 @@ index be4930052a9a1c883679f7e7415853b2f9c9f667..034c963b7cee65d253e9c27517463c2e
294
  )
295
 
296
  diff --git a/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py b/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
297
- index 768f41db854e0d532d5faeb3379eab1ab8ad5ef4..827f19fdd2117821861e89cb29571875d56257c0 100644
298
  --- a/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
299
  +++ b/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
300
  @@ -7,6 +7,55 @@ from vllm.platforms import current_platform
@@ -353,8 +474,27 @@ index 768f41db854e0d532d5faeb3379eab1ab8ad5ef4..827f19fdd2117821861e89cb29571875
353
  @triton.jit
354
  def moe_fused_mul_sum_kernel(
355
  inputs_ptr,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  diff --git a/vllm/v1/attention/backends/mla/triton_mla.py b/vllm/v1/attention/backends/mla/triton_mla.py
357
- index 71a38e95d0ad49fd6a0511cf6613b5cab1f62af0..641f68b166ff4b4269eb7ec6f07b5cead3849a38 100644
358
  --- a/vllm/v1/attention/backends/mla/triton_mla.py
359
  +++ b/vllm/v1/attention/backends/mla/triton_mla.py
360
  @@ -13,6 +13,7 @@ from vllm.model_executor.layers.attention.mla_attention import (
@@ -435,7 +575,7 @@ index 71a38e95d0ad49fd6a0511cf6613b5cab1f62af0..641f68b166ff4b4269eb7ec6f07b5cea
435
 
436
  # Run MQA — always pass layer scales. When KV cache is
437
  diff --git a/vllm/v1/attention/ops/merge_attn_states.py b/vllm/v1/attention/ops/merge_attn_states.py
438
- index 20c7503e9d0518a1c9459c6a599708f94a2bae62..cc860e1ab26ca78bf747a00b160314c4d740c5b1 100644
439
  --- a/vllm/v1/attention/ops/merge_attn_states.py
440
  +++ b/vllm/v1/attention/ops/merge_attn_states.py
441
  @@ -1,11 +1,87 @@
 
1
  diff --git a/csrc/libtorch_stable/sampler.cu b/csrc/libtorch_stable/sampler.cu
2
+ index 519e21328..847d8284a 100644
3
  --- a/csrc/libtorch_stable/sampler.cu
4
  +++ b/csrc/libtorch_stable/sampler.cu
5
  @@ -711,7 +711,12 @@ void top_k_per_row_decode(const torch::stable::Tensor& logits, int64_t next_n,
 
15
  vllm::topKPerRowDecode<kNumThreadsPerBlockMerge, true, false, true>
16
  <<<numRows, kNumThreadsPerBlockMerge, topK * sizeof(int32_t), stream>>>(
17
  outLogitsAux.const_data_ptr<float>(), seqLens.const_data_ptr<int>(),
18
+ diff --git a/tests/v1/attention/test_mla_prefill_quant_output.py b/tests/v1/attention/test_mla_prefill_quant_output.py
19
+ index d7659485a..93df32d38 100644
20
+ --- a/tests/v1/attention/test_mla_prefill_quant_output.py
21
+ +++ b/tests/v1/attention/test_mla_prefill_quant_output.py
22
+ @@ -1,8 +1,9 @@
23
+ # SPDX-License-Identifier: Apache-2.0
24
+ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
25
+ -"""Tests for MLA prefill backend fused-quant-output support.
26
+ +"""Tests for MLA prefill adapter contracts and fused-quant-output support.
27
+
28
+ -Covers two things:
29
+ +Covers three things:
30
+ + * ROCm upstream FlashAttention LSE layout normalization at the adapter boundary.
31
+ * `MLAPrefillBackend.supports_quant_output`, the capability gate that decides
32
+ whether the prefill kernel writes quantized output directly (FA4 native
33
+ fused FP8, see flash-attention#135) instead of the post-quant path.
34
+ @@ -10,11 +11,16 @@ Covers two things:
35
+ + standalone static-FP8-quant path it replaces (GPU-only, SM100/SM110).
36
+ """
37
+
38
+ +from types import SimpleNamespace
39
+ from unittest.mock import patch
40
+
41
+ import pytest
42
+ import torch
43
+
44
+ +from vllm.model_executor.layers.attention.mla_attention import (
45
+ + accumulate_mla_context_chunk,
46
+ + init_mla_context_partial,
47
+ +)
48
+ from vllm.model_executor.layers.quantization.utils.quant_utils import (
49
+ kFp8Dynamic128Sym,
50
+ kFp8StaticTensorSym,
51
+ @@ -57,9 +63,87 @@ def _make_fa_backend(version: int | None, is_vllm_fa: bool):
52
+ backend = object.__new__(FlashAttnPrefillBackend)
53
+ backend.vllm_flash_attn_version = version
54
+ backend._is_vllm_fa = is_vllm_fa
55
+ + backend.flash_attn_varlen_func = None
56
+ return backend
57
+
58
+
59
+ +@pytest.mark.parametrize("is_vllm_fa", [False, True])
60
+ +def test_flash_attn_normalizes_rocm_varlen_lse_layout(is_vllm_fa):
61
+ + """ROCm upstream FA returns [tokens, heads]; MLA requires [heads, tokens]."""
62
+ + backend = _make_fa_backend(version=None, is_vllm_fa=is_vllm_fa)
63
+ + backend.requires_v_padding = False
64
+ + tokens, heads, dim = 5, 3, 4
65
+ + attn_out = torch.zeros(tokens, heads, dim)
66
+ + token_major_lse = torch.arange(tokens * heads).reshape(tokens, heads)
67
+ +
68
+ + with patch(
69
+ + f"{_FA_MODULE}.FA4_MLA_PREFILL_KERNEL",
70
+ + return_value=(attn_out, token_major_lse),
71
+ + ):
72
+ + _, lse = backend._flash_attn_varlen_diff_headdims(
73
+ + q=attn_out,
74
+ + k=attn_out,
75
+ + v=attn_out,
76
+ + return_softmax_lse=True,
77
+ + )
78
+ +
79
+ + expected = token_major_lse if is_vllm_fa else token_major_lse.transpose(0, 1)
80
+ + torch.testing.assert_close(lse, expected)
81
+ + if not is_vllm_fa:
82
+ + assert lse.is_contiguous()
83
+ +
84
+ +
85
+ +def test_rocm_lse_normalization_satisfies_context_accumulator_contract():
86
+ + """Token-major ROCm LSE must reach MLA accumulation as head-major.
87
+ +
88
+ + This reproduces the release failure at the adapter/accumulator boundary:
89
+ + without normalization, the accumulator tries to copy a head-count-wide
90
+ + dimension into a token-count-wide destination and terminates EngineCore.
91
+ + """
92
+ + backend = _make_fa_backend(version=None, is_vllm_fa=False)
93
+ + backend.requires_v_padding = False
94
+ + tokens, heads, dim = 5, 3, 4
95
+ + attn_output = torch.arange(tokens * heads * dim).reshape(tokens, heads, dim)
96
+ + token_major_lse = torch.arange(tokens * heads).reshape(tokens, heads)
97
+ +
98
+ + with patch(
99
+ + f"{_FA_MODULE}.FA4_MLA_PREFILL_KERNEL",
100
+ + return_value=(attn_output, token_major_lse),
101
+ + ):
102
+ + normalized_output, normalized_lse = (
103
+ + backend._flash_attn_varlen_diff_headdims(
104
+ + q=attn_output,
105
+ + k=attn_output,
106
+ + v=attn_output,
107
+ + return_softmax_lse=True,
108
+ + )
109
+ + )
110
+ +
111
+ + metadata = SimpleNamespace(empty_token_slices=[])
112
+ + output, output_lse = init_mla_context_partial(
113
+ + metadata,
114
+ + normalized_output,
115
+ + normalized_lse,
116
+ + num_tokens=tokens,
117
+ + )
118
+ + chunk = SimpleNamespace(
119
+ + token_slice=slice(0, tokens),
120
+ + continuation_token_end=tokens,
121
+ + is_continuation=False,
122
+ + )
123
+ + accumulate_mla_context_chunk(
124
+ + chunk,
125
+ + normalized_output,
126
+ + normalized_lse,
127
+ + output,
128
+ + output_lse,
129
+ + )
130
+ +
131
+ + assert output_lse.shape == (heads, tokens)
132
+ + torch.testing.assert_close(output, attn_output)
133
+ + torch.testing.assert_close(output_lse, token_major_lse.transpose(0, 1))
134
+ +
135
+ +
136
+ @pytest.mark.parametrize(
137
+ ("version", "is_vllm_fa", "dc_major", "quant_key", "expected"),
138
+ [
139
  diff --git a/vllm/model_executor/layers/fused_moe/experts/triton_moe.py b/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
140
+ index 9d93dfe54..dd96f6da4 100644
141
  --- a/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
142
  +++ b/vllm/model_executor/layers/fused_moe/experts/triton_moe.py
143
  @@ -27,6 +27,7 @@ from vllm.model_executor.layers.fused_moe.fused_moe import (
 
346
  + # separate function is required for MoE + LoRA
347
  + self.moe_sum(intermediate_cache3, output)
348
  diff --git a/vllm/model_executor/layers/fused_moe/fused_moe.py b/vllm/model_executor/layers/fused_moe/fused_moe.py
349
+ index be4930052..034c963b7 100644
350
  --- a/vllm/model_executor/layers/fused_moe/fused_moe.py
351
  +++ b/vllm/model_executor/layers/fused_moe/fused_moe.py
352
  @@ -97,6 +97,7 @@ def fused_moe_kernel_gptq_awq(
 
415
  )
416
 
417
  diff --git a/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py b/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
418
+ index 768f41db8..827f19fdd 100644
419
  --- a/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
420
  +++ b/vllm/model_executor/layers/fused_moe/moe_fused_mul_sum.py
421
  @@ -7,6 +7,55 @@ from vllm.platforms import current_platform
 
474
  @triton.jit
475
  def moe_fused_mul_sum_kernel(
476
  inputs_ptr,
477
+ diff --git a/vllm/v1/attention/backends/mla/prefill/flash_attn.py b/vllm/v1/attention/backends/mla/prefill/flash_attn.py
478
+ index 97cb57c18..5d85b08c0 100644
479
+ --- a/vllm/v1/attention/backends/mla/prefill/flash_attn.py
480
+ +++ b/vllm/v1/attention/backends/mla/prefill/flash_attn.py
481
+ @@ -416,6 +416,14 @@ class FlashAttnPrefillBackend(MLAPrefillBackend):
482
+ if isinstance(attn_out, tuple):
483
+ attn_out, lse = attn_out[0], attn_out[1]
484
+
485
+ + # The upstream FlashAttention Triton backend on ROCm returns varlen
486
+ + # LSE as [total_q, num_heads], despite documenting (and fake-tensor
487
+ + # modeling) [num_heads, total_q]. vLLM's MLA merge contract uses the
488
+ + # latter layout. Normalize at the adapter boundary so multi-request
489
+ + # cached-prefix prefills do not fail while accumulating context chunks.
490
+ + if not self._is_vllm_fa and lse is not None:
491
+ + lse = lse.transpose(0, 1).contiguous()
492
+ +
493
+ # Remain consistent with old `flash_attn_varlen_func` where there
494
+ # is only one output tensor if `return_softmax_lse` is False.
495
+ if return_softmax_lse:
496
  diff --git a/vllm/v1/attention/backends/mla/triton_mla.py b/vllm/v1/attention/backends/mla/triton_mla.py
497
+ index 71a38e95d..641f68b16 100644
498
  --- a/vllm/v1/attention/backends/mla/triton_mla.py
499
  +++ b/vllm/v1/attention/backends/mla/triton_mla.py
500
  @@ -13,6 +13,7 @@ from vllm.model_executor.layers.attention.mla_attention import (
 
575
 
576
  # Run MQA — always pass layer scales. When KV cache is
577
  diff --git a/vllm/v1/attention/ops/merge_attn_states.py b/vllm/v1/attention/ops/merge_attn_states.py
578
+ index 20c7503e9..cc860e1ab 100644
579
  --- a/vllm/v1/attention/ops/merge_attn_states.py
580
  +++ b/vllm/v1/attention/ops/merge_attn_states.py
581
  @@ -1,11 +1,87 @@
runtime/SHA256SUMS.runtime CHANGED
@@ -1,3 +1,3 @@
1
- 15e48a8df3b65a73c81cf73c820ba12b4ab9474697d6b3f876c26c0b0cd3d455 COMMITS.txt
2
- 6b03af3a1685a1969ff96870ea776537f5f67fd3674fc353880bd088bcef9a9c Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle
3
- 8f307e9f2f16207856ca0b064a765a73bbebc029ad0b0fed61e5975a17e07ab6 Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.patch
 
1
+ a14fcd3747829be98a73a453057bd451a492d87a236c2affcf57db1cbbf18386 COMMITS.txt
2
+ 9cbcbbef5e113e22b753801ee141bd877b20c84f25f15cc159d0ae508aaf4324 Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle
3
+ c0c1446ea2c7334ef8b888f3104ec660d2ab41d2cb08bb9d90a3f589dba040e8 Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.patch
scripts/build-vllm-gfx1151.sh CHANGED
@@ -8,7 +8,7 @@ venv="$install_root/.venv"
8
  source_dir="$install_root/vllm"
9
  index=https://rocm.nightlies.amd.com/whl-multi-arch/
10
  base=d35eb6c44071ea806018841c490f0d2f3219c485
11
- head=388d82de2abe418e73380ba250270d3abc62ac12
12
  bundle="$package_root/runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle"
13
  flash_source="$install_root/flash-attention"
14
  flash_commit=0e60e39473e8df549a20fb5353760f7a65b30e2d
@@ -67,7 +67,7 @@ fi
67
 
68
  git -C "$source_dir" fetch origin "$base"
69
  git -C "$source_dir" fetch "$bundle" \
70
- refs/heads/codex/ling3-gfx1151-rocm715:refs/heads/ciru/ling3-gfx1151-rocm715
71
  git -C "$source_dir" checkout ciru/ling3-gfx1151-rocm715
72
  test "$(git -C "$source_dir" rev-parse HEAD)" = "$head"
73
 
 
8
  source_dir="$install_root/vllm"
9
  index=https://rocm.nightlies.amd.com/whl-multi-arch/
10
  base=d35eb6c44071ea806018841c490f0d2f3219c485
11
+ head=91fab4e6dcaa683911655630dae8a5b140a7cb91
12
  bundle="$package_root/runtime/Ling-3.0-Flash-CIRU-int4-Strix-native-vllm.bundle"
13
  flash_source="$install_root/flash-attention"
14
  flash_commit=0e60e39473e8df549a20fb5353760f7a65b30e2d
 
67
 
68
  git -C "$source_dir" fetch origin "$base"
69
  git -C "$source_dir" fetch "$bundle" \
70
+ refs/heads/ciru/ling3-gfx1151-rocm715:refs/heads/ciru/ling3-gfx1151-rocm715
71
  git -C "$source_dir" checkout ciru/ling3-gfx1151-rocm715
72
  test "$(git -C "$source_dir" rev-parse HEAD)" = "$head"
73