[PR #4767] [Engine] sm_70: a Volta defaults table - the B6 multi-column MMVQ rows on by default (V100) #5173

Open
opened 2026-11-07 16:33:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4767
Author: @aleesposito85
Created: 10/31/2026
Status: 🔄 Open

Base: main ← Head: sm70-defaults-b6


📝 Commits (1)

  • 381f0c8 sm_70: a Volta defaults table - the B6 multi-column MMVQ rows on by default (V100)

📊 Changes

1 file changed (+15 additions, -2 deletions)

View changed files

📝 src/core/nv_defaults.cpp (+15 -2)

📄 Description

Problem and result

nv_default_env carries measured per-series tables for sm_86 (Ampere), sm_60 (Pascal) and sm_121 (GB10), but none
for sm_70 (Volta). On a V100 the multi-column B6 MMVQ layout (STRATA_B6_MMVQ_ROWS, bit-exact, opt-in upstream)
therefore stays off even though it is the faster layout on that card — the same default the other cards get.

Before: on sm_70, decode uses the single-column layout unless the user sets STRATA_B6_MMVQ_ROWS=1 by hand.
After: an sm_70 table turns B6 on by default, with STRATA_SM70_PERF=0 as the master off switch, and the
startup line names the card and the switch instead of falling through to "sm_60 (Pascal)":

strata: sm_70 (Volta): 1 exact speed switches on by default (STRATA_SM70_PERF=0 turns them off; a switch you set is kept): B6_MMVQ_ROWS

Result on this V100 (Qwen3.8-Flash-Next IQ3_S, verify window T≈2–3.5): the projection kernels drop 15–22%, but
projections are only ~20% of a decode window, so end-to-end decode moves +1.4% / +1.6%, not the kernel number.

Overlaps with open #3411 ("enable measured V100 performance defaults"), which adds the same
else if (mj == 7 && mn == 0) branch, the same STRATA_SM70_PERF=0 switch and the same startup-line change,
with a 13-switch table that already contains STRATA_B6_MMVQ_ROWS. This PR is the one row of that table that was
measured bit-exact on our V100, not a proposal for a different default. #3411 has been conflicting with main since
21 Oct and no maintainer has commented on scope for either, so the choice is yours: take one table (#3411, with
this folding in as its B6 row), or take the smallest proven change first (this). The open sm_75 analogue is #2197.

Approach

An sm_70 branch sits between the existing sm_60 and sm_121 branches of nv_default_env() and follows the
sm_60/sm_86 shape exactly: off("STRATA_SM70_PERF") returns an empty table, otherwise one row,
{"STRATA_B6_MMVQ_ROWS", "1"}. Only switches measured on this card go in, which is why the table has exactly one
row. apply_nv_defaults()'s startup line gains sm70 in its existing ternary chain (label sm_70 (Volta),
switch STRATA_SM70_PERF).

Compatibility: nothing outside sm_70 changes — the sm_86, sm_60 and sm_121 tables and the else fallback are
untouched, and this touches only src/core/nv_defaults.cpp. A switch the user sets still wins, through the
existing getenv guard in apply_nv_defaults(), so anyone already setting STRATA_B6_MMVQ_ROWS keeps their
value. Like sm_86 and sm_60 (and unlike sm_121) the branch has no STRATA_DEFAULTS=026 gate: B6 predates 0.2.6,
and this only extends which cards get it by default. Layout-only change, bit-exact, no numerics change.

Validation

Environment: one Tesla V100-SXM2-32GB (sm_70), CT 227, engine stopped for the kernel runs. Revision tested is
this branch, 381f0c84, on upstream 870aedd9 (v0.2.8).

Passed:

Kernel A/B, GPU time only, median of 50 calls per case, weights rotated past L2,
/opt/strata-023/build-023/b6_mmvq_bench 50 (the install tree on this host; the B6X kernels themselves are not
changed by this patch, which only selects the switch by default). A = default layout, B = B6, ms per call:

case T=2 T=3 T=4 T=5
gdn qkv Q6_K 0.0584→0.0543 0.0686→0.0573 0.0799→0.0625 0.0860→0.0768
qsa q Q6_K 0.0645→0.0594 0.0748→0.0625 0.0881→0.0676 0.0952→0.0850
gdn out IQ4_XS 0.0225→0.0205 0.0276→0.0246 0.0338→0.0276 0.0389→0.0307
gdn out Q4_K 0.0236→0.0225 0.0287→0.0246 0.0338→0.0287 0.0410→0.0338
head Q5_K 0.9738→0.8448 1.1756→1.0301 1.4807→1.3619 1.8647→1.6374
  • Bitwise: the same bench compares B6 against the default layout with memcmp at every case and width, and
    each against N single-column calls. Every row prints ok ok ok, T=1 to T=8, including the head row.
  • End to end: three interleaved arms (base / B6 / base) on the live engine, configs differing only in
    STRATA_B6_MMVQ_ROWS, IQ3_S abliterated pack, MTP --spec 4, 16 short + 8 long decode samples per arm.
    128-token median 92.6 → 94.5 with the second base arm at 93.7, i.e. +1.4% against the mean of the base arms;
    512-token median 92.8 → 92.1 with the second base arm at 88.5, i.e. +1.6%.
  • Patch build and boot: sm70-defaults-b6 builds as build-s70 (engine f47f7544…, sm_70-only) and boots;
    the startup line quoted above is copied from that boot log.
  • CI on this head: title (title-area.yml), check (intake.yml) and metal-link (metal-build.yml) pass;
    sweep is scheduled-only and skips, as designed.

Failed: none observed.

Not run: HIP and SYCL builds — no such toolchain on this host; nv_defaults.cpp is backend-neutral but only
the CUDA path was exercised here. No second Volta part (V100-PCIE, SXM2-16GB) and no sm_86/sm_60 hardware re-run:
those branches are untouched, and every number above comes from this one card. No multi-GPU or NVLink topology.

Limits

One card, one pack, one set of projection shapes. A different quant mix weights the rows differently: the shared
expert's IQ3_S and IQ4_NL have no B6X specialisation at all, so they are unaffected, and the win is confined to
the Q6_K / Q4_K / Q5_K / IQ4_XS projections.

End-to-end is neutral-to-slightly-positive rather than the kernel delta: the two base arms drifted +1.1% and
−4.7% between repeats on their own, and projections are ~20% of the window. The kernel table is the real effect;
the end-to-end is confirmation, read with that spread in mind.

At T=1 (a call with nothing drafted to verify) the head row is slower, 0.6390 → 0.6789. It is accepted here
for the same reason the shipping sm_86/sm_60 tables accept it: the verify window is where the rows pay, and the
layout is bit-exact either way.

A second 50-rep run of the same bench reproduced the table within ~2%; that pair is the one quoted in the code
comment (head Q5_K at T=2: 0.9523 → 0.8387). Two runs, not one selected run.

Remaining headroom on this card, not part of this PR: the Q5_K head at T=2 runs at ~164 GB/s against a ~750 GB/s
roof, and needs a T=2-tailored multi-row kernel (Volta has 96 KB smem and no ldmatrix).


🔄 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/4767 **Author:** [@aleesposito85](https://github.com/aleesposito85) **Created:** 10/31/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `sm70-defaults-b6` --- ### 📝 Commits (1) - [`381f0c8`](https://github.com/Niko1221/Strata/commit/381f0c84dc650e192926e7008680e73e8dfa287e) sm_70: a Volta defaults table - the B6 multi-column MMVQ rows on by default (V100) ### 📊 Changes **1 file changed** (+15 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/core/nv_defaults.cpp` (+15 -2) </details> ### 📄 Description ## Problem and result `nv_default_env` carries measured per-series tables for sm_86 (Ampere), sm_60 (Pascal) and sm_121 (GB10), but none for sm_70 (Volta). On a V100 the multi-column B6 MMVQ layout (`STRATA_B6_MMVQ_ROWS`, bit-exact, opt-in upstream) therefore stays off even though it is the faster layout on that card — the same default the other cards get. **Before:** on sm_70, decode uses the single-column layout unless the user sets `STRATA_B6_MMVQ_ROWS=1` by hand. **After:** an sm_70 table turns B6 on by default, with `STRATA_SM70_PERF=0` as the master off switch, and the startup line names the card and the switch instead of falling through to "sm_60 (Pascal)": ```text strata: sm_70 (Volta): 1 exact speed switches on by default (STRATA_SM70_PERF=0 turns them off; a switch you set is kept): B6_MMVQ_ROWS ``` Result on this V100 (Qwen3.8-Flash-Next IQ3_S, verify window T≈2–3.5): the projection kernels drop 15–22%, but projections are only ~20% of a decode window, so end-to-end decode moves +1.4% / +1.6%, not the kernel number. ## Related discussion **Overlaps with open #3411** ("enable measured V100 performance defaults"), which adds the same `else if (mj == 7 && mn == 0)` branch, the same `STRATA_SM70_PERF=0` switch and the same startup-line change, with a 13-switch table that already contains `STRATA_B6_MMVQ_ROWS`. This PR is the one row of that table that was measured bit-exact on our V100, not a proposal for a different default. #3411 has been conflicting with main since 21 Oct and no maintainer has commented on scope for either, so the choice is yours: take one table (#3411, with this folding in as its B6 row), or take the smallest proven change first (this). The open sm_75 analogue is #2197. ## Approach An sm_70 branch sits between the existing sm_60 and sm_121 branches of `nv_default_env()` and follows the sm_60/sm_86 shape exactly: `off("STRATA_SM70_PERF")` returns an empty table, otherwise one row, `{"STRATA_B6_MMVQ_ROWS", "1"}`. Only switches measured on this card go in, which is why the table has exactly one row. `apply_nv_defaults()`'s startup line gains `sm70` in its existing ternary chain (label `sm_70 (Volta)`, switch `STRATA_SM70_PERF`). Compatibility: nothing outside sm_70 changes — the sm_86, sm_60 and sm_121 tables and the `else` fallback are untouched, and this touches only `src/core/nv_defaults.cpp`. A switch the user sets still wins, through the existing `getenv` guard in `apply_nv_defaults()`, so anyone already setting `STRATA_B6_MMVQ_ROWS` keeps their value. Like sm_86 and sm_60 (and unlike sm_121) the branch has no `STRATA_DEFAULTS=026` gate: B6 predates 0.2.6, and this only extends which cards get it by default. Layout-only change, bit-exact, no numerics change. ## Validation Environment: one Tesla V100-SXM2-32GB (sm_70), CT 227, engine stopped for the kernel runs. Revision tested is this branch, `381f0c84`, on upstream `870aedd9` (v0.2.8). **Passed:** Kernel A/B, GPU time only, median of 50 calls per case, weights rotated past L2, `/opt/strata-023/build-023/b6_mmvq_bench 50` (the install tree on this host; the B6X kernels themselves are not changed by this patch, which only selects the switch by default). A = default layout, B = B6, ms per call: | case | T=2 | T=3 | T=4 | T=5 | |---|---|---|---|---| | gdn qkv Q6_K | 0.0584→0.0543 | 0.0686→0.0573 | 0.0799→0.0625 | 0.0860→0.0768 | | qsa q Q6_K | 0.0645→0.0594 | 0.0748→0.0625 | 0.0881→0.0676 | 0.0952→0.0850 | | gdn out IQ4_XS | 0.0225→0.0205 | 0.0276→0.0246 | 0.0338→0.0276 | 0.0389→0.0307 | | gdn out Q4_K | 0.0236→0.0225 | 0.0287→0.0246 | 0.0338→0.0287 | 0.0410→0.0338 | | head Q5_K | 0.9738→0.8448 | 1.1756→1.0301 | 1.4807→1.3619 | 1.8647→1.6374 | - **Bitwise:** the same bench compares B6 against the default layout with `memcmp` at every case and width, and each against N single-column calls. Every row prints `ok ok ok`, T=1 to T=8, including the head row. - **End to end:** three interleaved arms (base / B6 / base) on the live engine, configs differing only in `STRATA_B6_MMVQ_ROWS`, IQ3_S abliterated pack, MTP `--spec 4`, 16 short + 8 long decode samples per arm. 128-token median 92.6 → 94.5 with the second base arm at 93.7, i.e. **+1.4%** against the mean of the base arms; 512-token median 92.8 → 92.1 with the second base arm at 88.5, i.e. **+1.6%**. - **Patch build and boot:** `sm70-defaults-b6` builds as `build-s70` (engine `f47f7544…`, sm_70-only) and boots; the startup line quoted above is copied from that boot log. - **CI on this head:** `title` (title-area.yml), `check` (intake.yml) and `metal-link` (metal-build.yml) pass; `sweep` is scheduled-only and skips, as designed. **Failed:** none observed. **Not run:** HIP and SYCL builds — no such toolchain on this host; `nv_defaults.cpp` is backend-neutral but only the CUDA path was exercised here. No second Volta part (V100-PCIE, SXM2-16GB) and no sm_86/sm_60 hardware re-run: those branches are untouched, and every number above comes from this one card. No multi-GPU or NVLink topology. ## Limits One card, one pack, one set of projection shapes. A different quant mix weights the rows differently: the shared expert's IQ3_S and IQ4_NL have no B6X specialisation at all, so they are unaffected, and the win is confined to the Q6_K / Q4_K / Q5_K / IQ4_XS projections. End-to-end is neutral-to-slightly-positive rather than the kernel delta: the two base arms drifted +1.1% and −4.7% between repeats on their own, and projections are ~20% of the window. The kernel table is the real effect; the end-to-end is confirmation, read with that spread in mind. At T=1 (a call with nothing drafted to verify) the head row is **slower**, 0.6390 → 0.6789. It is accepted here for the same reason the shipping sm_86/sm_60 tables accept it: the verify window is where the rows pay, and the layout is bit-exact either way. A second 50-rep run of the same bench reproduced the table within ~2%; that pair is the one quoted in the code comment (head Q5_K at T=2: 0.9523 → 0.8387). Two runs, not one selected run. Remaining headroom on this card, not part of this PR: the Q5_K head at T=2 runs at ~164 GB/s against a ~750 GB/s roof, and needs a T=2-tailored multi-row kernel (Volta has 96 KB smem and no `ldmatrix`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5173
No description provided.