mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4767] [Engine] sm_70: a Volta defaults table - the B6 multi-column MMVQ rows on by default (V100) #5173
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
381f0c8sm_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_envcarries measured per-series tables for sm_86 (Ampere), sm_60 (Pascal) and sm_121 (GB10), but nonefor 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=1by hand.After: an sm_70 table turns B6 on by default, with
STRATA_SM70_PERF=0as the master off switch, and thestartup line names the card and the switch instead of falling through to "sm_60 (Pascal)":
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 sameSTRATA_SM70_PERF=0switch 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 wasmeasured 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 thesm_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 onerow.
apply_nv_defaults()'s startup line gainssm70in its existing ternary chain (labelsm_70 (Volta),switch
STRATA_SM70_PERF).Compatibility: nothing outside sm_70 changes — the sm_86, sm_60 and sm_121 tables and the
elsefallback areuntouched, and this touches only
src/core/nv_defaults.cpp. A switch the user sets still wins, through theexisting
getenvguard inapply_nv_defaults(), so anyone already settingSTRATA_B6_MMVQ_ROWSkeeps theirvalue. Like sm_86 and sm_60 (and unlike sm_121) the branch has no
STRATA_DEFAULTS=026gate: 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 upstream870aedd9(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 notchanged by this patch, which only selects the switch by default). A = default layout, B = B6, ms per call:
memcmpat every case and width, andeach against N single-column calls. Every row prints
ok ok ok, T=1 to T=8, including the head row.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%.
sm70-defaults-b6builds asbuild-s70(enginef47f7544…, sm_70-only) and boots;the startup line quoted above is copied from that boot log.
title(title-area.yml),check(intake.yml) andmetal-link(metal-build.yml) pass;sweepis scheduled-only and skips, as designed.Failed: none observed.
Not run: HIP and SYCL builds — no such toolchain on this host;
nv_defaults.cppis backend-neutral but onlythe 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.