[PR #904] [CLOSED] Verify window: PDL on sm_90+, graph branches, batched Q4_0 KV append and PLE post-ops (bit-identical) #2907

Closed
opened 2026-11-04 02:04:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/904
Author: @Hardin22
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: pr/dense-pdl


📝 Commits (10+)

  • 5a30024 calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)
  • 9f60d13 serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)
  • eb8da1d /metrics: each request's speculative draft counts, and their sums in the totals (#457)
  • 6a09387 setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)
  • d6a91e2 docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)
  • d8d4ad3 Merge branch 'f-135-eng' into rel-0.1.35
  • 7b600d5 Merge branch 'f-135-small' into rel-0.1.35
  • d9ab843 Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it
  • 57bd713 sycl: pipeline the expert cache's profile fill (model load 3-4x faster)
  • e3bdd74 A prompt cancelled mid-read is logged and recorded with the tokens it read (#471)

📊 Changes

1 file changed (+3 additions, -5 deletions)

View changed files

📝 src/core/verify.cpp (+3 -5)

📄 Description

This is the part of the fork's "fewer, fuller launches" work that main doesn't have yet. It comes as two commits, and each piece has its own switch. Every piece keeps the arithmetic of the path it replaces, so the output is unchanged; the checks are below.

  1. Programmatic dependent launch on sm_90+ (STRATA_DF_PDL). A decode window is a long chain of small kernels, and on a fast card many of them finish before the next one has fetched its weights. With PDL, the quantize kernel, the multi-column MMVQ and the multi-row BF16 GEMV load their weights before griddepcontrol.wait.
    • Where it applies: the attribute is only set while capturing, and only when every predecessor of the next node is a kernel (never after a memcpy, memset, host or event node). STRATA_DF_PDL=2 restricts it to single-predecessor edges.
    • When it is on: pdl_supported() is false on HIP and on CUDART < 12.3. It also needs cc_major >= 9 and a binary built for sm_90+ (PTX JIT from older code would lack the wait).
    • Other changes:
      • copy_rows_strided replaces a memcpy2D node.
      • The three PDL kernels drop __restrict__ (llama.cpp's PDL fix), which can change speed but not values.
  2. Graph branches and batched forms:
    • STRATA_DF_BRANCH: the GDN a/b/z, query and indexer-query sides and the step/pos inputs on a side branch. Opt-in since f89d31f: on Linux (open modules, GSP) it stalled with NVML queries between requests (#905).
    • STRATA_DF_QB_Q4, STRATA_DF_KVAPP: the Q4_0 KV's window batched (main still appends per token with --kv q4_0).
    • STRATA_DF_PLE: the PLE post-ops in one pass.

Already in main, so left out: native_swiglu_quantize_q8_1 / sigmoid_scale_rows, fd95405's attention change, the shared-expert branch, and STRATA_PLE_BATCH's projections. I also dropped a one-row-per-warp MMVQ variant, because it did not beat main's ROWS=2.

Measured

Swift 1.5 IQ3_XXS at 160K (q4_0 KV), RTX 4060 Ti + RTX 5080 layer split, with the resident RAM mode (#848), pipelined windows and the async tier (#859, #876). Greedy, five prompts × two rounds, decode tok/s.

run 1 run 2
every switch on (default) 123.5 119.7
every switch off (STRATA_DF_PDL=0 STRATA_DF_BRANCH=0 STRATA_DF_QB_Q4=0 STRATA_DF_KVAPP=0 STRATA_DF_PLE=0) 118.1 117.5

About +3%. PDL only acts on the 5080 (sm_120); the 4060 Ti (sm_89) has none.

Checks

  • Exact pass (STRATA_IQ_MT_MIN=1 --pcie-frac 0 --adapt-every 0, serial loop, 4 prompts × 500 tokens): all switches on and all off give the same text.
    • Against a build without these commits, 2 of 4 differ. The larger binary leaves 2 fewer expert slots on each card (5740 vs 5742, 4762 vs 4764), so a few experts move to the CPU, which rounds them differently.
  • Unit tests pass on both cards (RTX 5080, RTX 4060 Ti):
    • pdl_parity: 0 of 200 replays differ; programmatic edges only go kernel → kernel; also with STRATA_DF_PDL=2.
    • New: verify_batch_parity (every batched form against its per-token path, bitwise).
    • Existing: mmvq_multi_parity, kv_q4_parity, bf16_gemv_parity.

Not tested

  • HIP and CUDA 12.3–12.9 builds were not compiled here.
    • HIP takes the plain launch.
    • griddepcontrol is only compiled under !__HIPCC__ && __CUDA_ARCH__ >= 900.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/904 **Author:** [@Hardin22](https://github.com/Hardin22) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/dense-pdl` --- ### 📝 Commits (10+) - [`5a30024`](https://github.com/Niko1221/Strata/commit/5a3002446dbb9dfcabb7d0bd9f113da90cc2f3c0) calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447) - [`9f60d13`](https://github.com/Niko1221/Strata/commit/9f60d13246e46b02b1dd0841980b4d18b0faaea7) serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448) - [`eb8da1d`](https://github.com/Niko1221/Strata/commit/eb8da1d8c26ec41e6ffb084fdf579dba7cad10bd) /metrics: each request's speculative draft counts, and their sums in the totals (#457) - [`6a09387`](https://github.com/Niko1221/Strata/commit/6a093874fe037020f49bd5cf053879ff6a133c21) setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444) - [`d6a91e2`](https://github.com/Niko1221/Strata/commit/d6a91e2d1770d0f469d6ec15890acc7ee93e764c) docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438) - [`d8d4ad3`](https://github.com/Niko1221/Strata/commit/d8d4ad337d3c98ba21d3bd0af1a16e9177e112b6) Merge branch 'f-135-eng' into rel-0.1.35 - [`7b600d5`](https://github.com/Niko1221/Strata/commit/7b600d55ff801caaaa11542af1523050992e049b) Merge branch 'f-135-small' into rel-0.1.35 - [`d9ab843`](https://github.com/Niko1221/Strata/commit/d9ab8435f654c368c586340d490915f6addf56a3) Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it - [`57bd713`](https://github.com/Niko1221/Strata/commit/57bd713454ddb4b965f994e95d95cacd68c93fb1) sycl: pipeline the expert cache's profile fill (model load 3-4x faster) - [`e3bdd74`](https://github.com/Niko1221/Strata/commit/e3bdd7449223c4305ef53e331538346765855a2c) A prompt cancelled mid-read is logged and recorded with the tokens it read (#471) ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/core/verify.cpp` (+3 -5) </details> ### 📄 Description This is the part of the fork's "fewer, fuller launches" work that main doesn't have yet. It comes as two commits, and each piece has its own switch. Every piece keeps the arithmetic of the path it replaces, so the output is unchanged; the checks are below. 1. **Programmatic dependent launch on sm_90+** (`STRATA_DF_PDL`). A decode window is a long chain of small kernels, and on a fast card many of them finish before the next one has fetched its weights. With PDL, the quantize kernel, the multi-column MMVQ and the multi-row BF16 GEMV load their weights before `griddepcontrol.wait`. - **Where it applies**: the attribute is only set while capturing, and only when every predecessor of the next node is a kernel (never after a memcpy, memset, host or event node). `STRATA_DF_PDL=2` restricts it to single-predecessor edges. - **When it is on**: `pdl_supported()` is false on HIP and on CUDART < 12.3. It also needs `cc_major >= 9` and a binary built for sm_90+ (PTX JIT from older code would lack the wait). - **Other changes**: - `copy_rows_strided` replaces a memcpy2D node. - The three PDL kernels drop `__restrict__` (llama.cpp's PDL fix), which can change speed but not values. 2. **Graph branches and batched forms**: - `STRATA_DF_BRANCH`: the GDN a/b/z, query and indexer-query sides and the step/pos inputs on a side branch. **Opt-in** since f89d31f: on Linux (open modules, GSP) it stalled with NVML queries between requests (#905). - `STRATA_DF_QB_Q4`, `STRATA_DF_KVAPP`: the Q4_0 KV's window batched (main still appends per token with `--kv q4_0`). - `STRATA_DF_PLE`: the PLE post-ops in one pass. Already in main, so left out: `native_swiglu_quantize_q8_1` / `sigmoid_scale_rows`, fd95405's attention change, the shared-expert branch, and STRATA_PLE_BATCH's projections. I also dropped a one-row-per-warp MMVQ variant, because it did not beat main's ROWS=2. ## Measured Swift 1.5 IQ3_XXS at 160K (q4_0 KV), RTX 4060 Ti + RTX 5080 layer split, with the resident RAM mode (#848), pipelined windows and the async tier (#859, #876). Greedy, five prompts × two rounds, decode tok/s. | | run 1 | run 2 | |---|---|---| | every switch on (default) | 123.5 | 119.7 | | every switch off (`STRATA_DF_PDL=0 STRATA_DF_BRANCH=0 STRATA_DF_QB_Q4=0 STRATA_DF_KVAPP=0 STRATA_DF_PLE=0`) | 118.1 | 117.5 | About **+3%**. PDL only acts on the 5080 (sm_120); the 4060 Ti (sm_89) has none. ## Checks - **Exact pass** (`STRATA_IQ_MT_MIN=1 --pcie-frac 0 --adapt-every 0`, serial loop, 4 prompts × 500 tokens): all switches on and all off give the **same text**. - Against a build without these commits, 2 of 4 differ. The larger binary leaves 2 fewer expert slots on each card (5740 vs 5742, 4762 vs 4764), so a few experts move to the CPU, which rounds them differently. - **Unit tests** pass on both cards (RTX 5080, RTX 4060 Ti): - `pdl_parity`: 0 of 200 replays differ; programmatic edges only go kernel → kernel; also with `STRATA_DF_PDL=2`. - New: `verify_batch_parity` (every batched form against its per-token path, bitwise). - Existing: `mmvq_multi_parity`, `kv_q4_parity`, `bf16_gemv_parity`. ## Not tested - HIP and CUDA 12.3–12.9 builds were not compiled here. - HIP takes the plain launch. - `griddepcontrol` is only compiled under `!__HIPCC__ && __CUDA_ARCH__ >= 900`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:04:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2907
No description provided.