[GH-ISSUE #305] Feature request: support sm_70 (V100 / T4) - the attention kernels already have pre-Ampere paths #150

Closed
opened 2026-11-04 01:40:27 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @zipenghao on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/305

Summary: Strata's installer and build system reject anything below sm_80, but the
kernels appear to have pre-Ampere code paths. Could sm_70 (V100, T4) be supported?

What I hit

setup.sh stops with "not supported - older than the RTX 30 series" on a V100, and
CMakeLists.txt has a matching arch guard. So the published install path is closed
before anything else happens - including before the model download starts.

Why I think it is close to working

The attention kernels carry #if __CUDA_ARCH__ >= 800 guards, but they do have older
branches underneath: qsa_select.cu, qsa_prompt_attn.cu and native_qsa_score.cu
all fall back, and those paths work on sm_70 (slower, but correct). With these opened
I got a fully working, numerically correct install:

  1. the installer's arch gate (setup.py, gpu_problem)
  2. the CMake arch guard
  3. the device qualification check in src/core/device.cu
  4. Q6_K dispatch in the IQ expert kernels (src/kernels/cuda/iq_kernels.cu)
  5. multi-shard GGUF discovery - see below
  6. HF_ENDPOINT override for tools/mtp_fetch.py

Point 5 is worth separating out, because I think it is an actual bug rather than a
platform issue: --gguf-dir builds the shard list as exactly
<model>-00001-of-00002.gguf and <model>-00002-of-00002.gguf. Artifacts named
differently or sharded differently (e.g. Unsloth's -00001-of-00003) are not found.
Deriving the count from the -0000N-of- part of the filename, as the engine and
tools/iq_pack.py already do, would make it work.

decode 43.4 tok/s (MTP --spec 2 --spec-min-p 0.5, Chinese, draft acceptance 77-78%)
decode, no MTP 35.2 tok/s
prefill 865 tok/s on a 117,088-token prompt (135 s)
context 131072, verified with a needle at ~58K tokens, right at the layer-split boundary

The CPU is the bottleneck on this machine (no AVX-512, no VNNI): the expert pool is
~70% of each decode step. A CPU with AVX-512 should be considerably faster.

What I am asking

  1. Would you consider accepting sm_70, and if so, would you gate it as "best effort"
    rather than in the main support matrix?
  2. What would you need from me to make it safe - a CI job on sm_70 hardware I do not
    have, or is a documented "this is what I measured" enough?
  3. Should the --gguf-dir shard-count fix (point 5) go in regardless of the platform
    question? It is independent of GPU architecture.

Related: #303 (garbled output on the same setup).

Patches and full write-up: https://github.com/zipenghao/strata-v100-sm70

Note: this report and the linked patches were drafted with AI assistance; all numbers
above were measured manually on the hardware listed.

Originally created by @zipenghao on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/305 **Summary:** Strata's installer and build system reject anything below sm_80, but the kernels appear to have pre-Ampere code paths. Could sm_70 (V100, T4) be supported? ## What I hit `setup.sh` stops with "not supported - older than the RTX 30 series" on a V100, and `CMakeLists.txt` has a matching arch guard. So the published install path is closed before anything else happens - including before the model download starts. ## Why I think it is close to working The attention kernels carry `#if __CUDA_ARCH__ >= 800` guards, but they do have older branches underneath: `qsa_select.cu`, `qsa_prompt_attn.cu` and `native_qsa_score.cu` all fall back, and those paths work on sm_70 (slower, but correct). With these opened I got a fully working, numerically correct install: 1. the installer's arch gate (`setup.py`, `gpu_problem`) 2. the CMake arch guard 3. the device qualification check in `src/core/device.cu` 4. `Q6_K` dispatch in the IQ expert kernels (`src/kernels/cuda/iq_kernels.cu`) 5. multi-shard GGUF discovery - see below 6. `HF_ENDPOINT` override for `tools/mtp_fetch.py` Point 5 is worth separating out, because I think it is an actual bug rather than a platform issue: `--gguf-dir` builds the shard list as exactly `<model>-00001-of-00002.gguf` and `<model>-00002-of-00002.gguf`. Artifacts named differently or sharded differently (e.g. Unsloth's `-00001-of-00003`) are not found. Deriving the count from the `-0000N-of-` part of the filename, as the engine and `tools/iq_pack.py` already do, would make it work. ## Measured on 2x V100-SXM2-16GB (PCIe, no NVLink), Xeon E5-2680 v4 | | | |---|---| | decode | 43.4 tok/s (MTP `--spec 2 --spec-min-p 0.5`, Chinese, draft acceptance 77-78%) | | decode, no MTP | 35.2 tok/s | | prefill | 865 tok/s on a 117,088-token prompt (135 s) | | context | 131072, verified with a needle at ~58K tokens, right at the layer-split boundary | The CPU is the bottleneck on this machine (no AVX-512, no VNNI): the expert pool is ~70% of each decode step. A CPU with AVX-512 should be considerably faster. ## What I am asking 1. Would you consider accepting sm_70, and if so, would you gate it as "best effort" rather than in the main support matrix? 2. What would you need from me to make it safe - a CI job on sm_70 hardware I do not have, or is a documented "this is what I measured" enough? 3. Should the `--gguf-dir` shard-count fix (point 5) go in regardless of the platform question? It is independent of GPU architecture. Related: #303 (garbled output on the same setup). Patches and full write-up: https://github.com/zipenghao/strata-v100-sm70 *Note: this report and the linked patches were drafted with AI assistance; all numbers above were measured manually on the hardware listed.*
Author
Owner

@SingingFrog7 commented on GitHub (Oct 1, 2026):

On the latest version, it seems like appending "-DSTRATA_EXPERIMENTAL_SM60=ON", to the cmake_build calls' parameters in setup.py makes it support SM70 witout other changes? I'll be testing the same thing on a similar setup soon, I'll report what I have then

<!-- gh-comment-id:5925174865 --> @SingingFrog7 commented on GitHub (Oct 1, 2026): On the latest version, it seems like appending `"-DSTRATA_EXPERIMENTAL_SM60=ON",` to the `cmake_build` calls' parameters in `setup.py` makes it support SM70 witout other changes? I'll be testing the same thing on a similar setup soon, I'll report what I have then
Author
Owner

@backstable commented on GitHub (Oct 1, 2026):

Independent confirmation from a different single-GPU machine — same conclusion, and on this one only the three arch gates needed changing.

Hardware (different from the 2× V100 / Xeon E5-2680 v4 above)

GPU 1× Tesla V100-SXM2-16GB, compute capability 7.0, PCIe 3.0 ×16, 16384 MiB (no NVLink, no second card)
CPU AMD Ryzen 5 5600X (6C/12T) — AVX2 only, no AVX-512
Driver / kernel 580.173.02 / 7.0.0-34-generic
Engine 0.1.30, pack iq3_xxs, --kv int8, --spec 4 --spec-min-p 0.5, --max-context 131072, --prompt-cache-root 64

What we needed to change

Only the two version gates — setup.py:339 (gpu_problem) and CMakeLists.txt:86, both 75 → 70:

-    if(_base LESS 75 AND NOT STRATA_EXPERIMENTAL_SM60)
+    if(_base LESS 70 AND NOT STRATA_EXPERIMENTAL_SM60)

Not src/core/device.cu — and this is worth correcting, because your list and ours both started out with it. In 0.1.30 the < 75 runtime check there lives in device_info(), and the only caller is src/core/device_main.cpp:34 — which CMakeLists.txt:174 builds as a separate strata-device diagnostic executable. The engine never calls it, so the engine does not need that line changed. We have a 0.1.27 build on this machine whose device.cu still reads < 75 and which started and served nineteen times without complaint — that is the empirical form of the same statement.

We also did not have to touch src/kernels/cuda/iq_kernels.cu (your point 4) on 0.1.30 — the iq3_xxs pack builds and runs as-is. So on this model and this engine version the whole change is two lines, which we hope makes the "best effort" case easier to argue.

Per the maintainer's note on #236 — sm_70 stays community-tested behind -DSTRATA_EXPERIMENTAL_SM60=ON, and 0.1.31 makes that flag admit Volta — we intend to drop the patch and use the flag once 0.1.31 is out, rather than carry a fork.

Measured (single V100, 0.1.30)

strata generate: PCIe probe: 13.1 GB/s host->device -> pcie_frac 0.28 (default 0.55)
strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows)
strata generate: expert cache auto: 8.74 GiB free, 700 MiB reserved (+184 MiB for the draft head) -> 3630 slots
strata generate: expert cache 4852 slots, 7.87 GiB of VRAM
strata serve: 475 MiB of VRAM free with everything loaded
Metric Value
decode 44–55 tok/s typical, 62.3 tok/s peak on short prompts
draft acceptance (--spec 4) 68–82 %
prefill, cold 985–1161 tok/s on 30k–66k-token prompts
prefill, 589-token prompt 145 tok/s
checkpoint reuse 87,719-token prompt → 87,535 reused (99.8 %), 184 read in 2.0 s

Sustained real traffic at 82–88k context, single card, no layer split:

prompt 85683 tokens = 84726 reused +  957 read in 3306 ms (289.5 tok/s), 359 generated in  7847 ms (45.7 tok/s), drafts accepted 232 of 331
prompt 87165 tokens = 86342 reused +  823 read in 3265 ms (252.0 tok/s), 533 generated in 11249 ms (47.4 tok/s), drafts accepted 327 of 464
prompt 87719 tokens = 87535 reused +  184 read in 1996 ms ( 92.2 tok/s), 299 generated in  6747 ms (44.3 tok/s), drafts accepted 161 of 275

Four notes on the numbers:

  • One Volta-specific line in the startup log that does not appear on Ampere runs, worth knowing about if sm_70 ever becomes documented "best effort" territory: native embedding: cannot pin 260 MiB, nor place it in VRAM. The engine degrades gracefully — everything else (cudaHostRegister PORTABLE on the arena, the MTP draft head, the expert-cache prefill, session capture) comes up clean — but that is the one line to expect on this hardware.
  • The CPU is very likely the bottleneck here too, as in your case: 6 cores of Zen 3 doing the non-resident expert work, AVX2 only. We have not instrumented the decode step to confirm the share, so treat that as an inference from the core count rather than a measurement.
  • We have not run a needle-in-a-haystack check; your 58K needle result is the only correctness evidence on that front, and it would be good to have a second one.
  • Stability, same machine, same day: the 0.1.27 log shows 19 engine restarts; on 0.1.30 we have had 0 since the upgrade. (The 0.1.27 deaths were the cancel bug that 0.1.28 fixed — see below.)

One new thing that is not about sm_70

While diagnosing a client-facing error on this install we found that when the engine dies, the server keeps engine.max_context == 0 and the next request comes back as a 400 reading

prompt (41732 tokens) leaves no room to answer in the context (0)

which blames the prompt for what is actually "the engine is restarting". Filed separately with the code path and a suggested one-line-ish fix: #. Worth a look because it is what a user sees after any engine death, on any architecture.

And to bring this issue back to its question 3 — the --gguf-dir shard-count fix — nobody has answered whether it should land irrespective of the platform question, and it is still present in 0.1.30 (setup.py:2091 builds exactly two names, while tools/iq_pack.py:86 already derives the count from the filename). PR with a minimal scoped patch: #.


<!-- gh-comment-id:5925696949 --> @backstable commented on GitHub (Oct 1, 2026): Independent confirmation from a **different single-GPU machine** — same conclusion, and on this one only the three arch gates needed changing. ## Hardware (different from the 2× V100 / Xeon E5-2680 v4 above) | | | |---|---| | GPU | **1×** Tesla V100-SXM2-16GB, compute capability **7.0**, PCIe **3.0 ×16**, 16384 MiB (no NVLink, no second card) | | CPU | AMD Ryzen 5 5600X (6C/12T) — **AVX2 only, no AVX-512** | | Driver / kernel | 580.173.02 / 7.0.0-34-generic | | Engine | **0.1.30**, pack `iq3_xxs`, `--kv int8`, `--spec 4 --spec-min-p 0.5`, `--max-context 131072`, `--prompt-cache-root 64` | ## What we needed to change **Only the two version gates** — `setup.py:339` (`gpu_problem`) and `CMakeLists.txt:86`, both `75 → 70`: ```diff - if(_base LESS 75 AND NOT STRATA_EXPERIMENTAL_SM60) + if(_base LESS 70 AND NOT STRATA_EXPERIMENTAL_SM60) ``` **Not `src/core/device.cu`** — and this is worth correcting, because your list and ours both started out with it. In 0.1.30 the `< 75` runtime check there lives in `device_info()`, and the only caller is `src/core/device_main.cpp:34` — which `CMakeLists.txt:174` builds as a **separate `strata-device` diagnostic executable**. The engine never calls it, so the engine does not need that line changed. We have a 0.1.27 build on this machine whose `device.cu` still reads `< 75` and which started and served nineteen times without complaint — that is the empirical form of the same statement. We also did **not** have to touch `src/kernels/cuda/iq_kernels.cu` (your point 4) on 0.1.30 — the `iq3_xxs` pack builds and runs as-is. So on this model and this engine version the whole change is two lines, which we hope makes the "best effort" case easier to argue. Per the maintainer's note on #236 — sm_70 stays community-tested behind `-DSTRATA_EXPERIMENTAL_SM60=ON`, and 0.1.31 makes that flag admit Volta — we intend to drop the patch and use the flag once 0.1.31 is out, rather than carry a fork. ## Measured (single V100, 0.1.30) ``` strata generate: PCIe probe: 13.1 GB/s host->device -> pcie_frac 0.28 (default 0.55) strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows) strata generate: expert cache auto: 8.74 GiB free, 700 MiB reserved (+184 MiB for the draft head) -> 3630 slots strata generate: expert cache 4852 slots, 7.87 GiB of VRAM strata serve: 475 MiB of VRAM free with everything loaded ``` | Metric | Value | |---|---| | decode | **44–55 tok/s** typical, 62.3 tok/s peak on short prompts | | draft acceptance (`--spec 4`) | 68–82 % | | prefill, cold | **985–1161 tok/s** on 30k–66k-token prompts | | prefill, 589-token prompt | 145 tok/s | | checkpoint reuse | 87,719-token prompt → **87,535 reused (99.8 %)**, 184 read in 2.0 s | Sustained real traffic at 82–88k context, single card, no layer split: ``` prompt 85683 tokens = 84726 reused + 957 read in 3306 ms (289.5 tok/s), 359 generated in 7847 ms (45.7 tok/s), drafts accepted 232 of 331 prompt 87165 tokens = 86342 reused + 823 read in 3265 ms (252.0 tok/s), 533 generated in 11249 ms (47.4 tok/s), drafts accepted 327 of 464 prompt 87719 tokens = 87535 reused + 184 read in 1996 ms ( 92.2 tok/s), 299 generated in 6747 ms (44.3 tok/s), drafts accepted 161 of 275 ``` Four notes on the numbers: - **One Volta-specific line in the startup log** that does not appear on Ampere runs, worth knowing about if sm_70 ever becomes documented "best effort" territory: `native embedding: cannot pin 260 MiB, nor place it in VRAM`. The engine degrades gracefully — everything else (`cudaHostRegister PORTABLE` on the arena, the MTP draft head, the expert-cache prefill, session capture) comes up clean — but that is the one line to expect on this hardware. - The CPU is very likely the bottleneck here too, as in your case: 6 cores of Zen 3 doing the non-resident expert work, AVX2 only. We have **not** instrumented the decode step to confirm the share, so treat that as an inference from the core count rather than a measurement. - We have **not** run a needle-in-a-haystack check; your 58K needle result is the only correctness evidence on that front, and it would be good to have a second one. - Stability, same machine, same day: the 0.1.27 log shows **19 engine restarts**; on 0.1.30 we have had **0** since the upgrade. (The 0.1.27 deaths were the cancel bug that 0.1.28 fixed — see below.) ## One new thing that is not about sm_70 While diagnosing a client-facing error on this install we found that when the engine dies, the server keeps `engine.max_context == 0` and the **next** request comes back as a `400` reading ``` prompt (41732 tokens) leaves no room to answer in the context (0) ``` which blames the prompt for what is actually "the engine is restarting". Filed separately with the code path and a suggested one-line-ish fix: **#<TBD>**. Worth a look because it is what a user sees after any engine death, on any architecture. And to bring this issue back to its question **3** — the `--gguf-dir` shard-count fix — nobody has answered whether it should land irrespective of the platform question, and it is still present in 0.1.30 (`setup.py:2091` builds exactly two names, while `tools/iq_pack.py:86` already derives the count from the filename). PR with a minimal scoped patch: **#<TBD>**. ---
Author
Owner

@SingingFrog7 commented on GitHub (Oct 1, 2026):

I have similar generation results (50~60 t/s) on a 2x V100-PCIE-16GB machine, 2x E5-2630 v4, 64GB RAM, but prefill seems way slower (~320t/s), not sure what is causing this in my case

<!-- gh-comment-id:5925879670 --> @SingingFrog7 commented on GitHub (Oct 1, 2026): I have similar generation results (50~60 t/s) on a 2x V100-PCIE-16GB machine, 2x E5-2630 v4, 64GB RAM, but prefill seems way slower (~320t/s), not sure what is causing this in my case
Author
Owner

@Niko1221 commented on GitHub (Oct 1, 2026):

sm_70 is admitted by the experimental build flag since 0.1.31 (-DSTRATA_EXPERIMENTAL_SM60=ON; CUDA 12.x, not in the ready-made engine), and setup support for it is coming in 0.1.32. Setup's --gguf-dir will also take any shard count. Closing as answered.

<!-- gh-comment-id:5925964876 --> @Niko1221 commented on GitHub (Oct 1, 2026): sm_70 is admitted by the experimental build flag since 0.1.31 (`-DSTRATA_EXPERIMENTAL_SM60=ON`; CUDA 12.x, not in the ready-made engine), and setup support for it is coming in 0.1.32. Setup's `--gguf-dir` will also take any shard count. Closing as answered.
Author
Owner

@zipenghao commented on GitHub (Oct 10, 2026):

Update from your point of view - this reporter is now on 0.1.34 with STRATA_EXPERIMENTAL_SM60=1 and no source patches at all for the platform. The flag is all it took, exactly as @backstable described; my earlier patch set is retired apart from one Q6_K hunk (below, unrelated to the arch gate).

Two things I hit that are about the artifact rather than the card, and that cost me an hour. They are reproducible on any GPU, so reporting them here rather than opening a separate issue - happy to split them out if that is cleaner.

1. --native is pointed at the wrong shard for a 3-shard split. setup.py picks shards[0], which is correct for the 2-shard GSQ-RCO files. Unsloth's split puts the metadata in -00001-of-00003 (10.9 MB, zero tensors) and every tensor in shards 2-3, so the engine starts and then exits:

strata generate: native embedding: token_embd.weight is absent, of another shape, or of a type without a GPU dequantizer

Repointing --native at -00002-of-00003.gguf fixes it; the vision block's model is happy with shard 1, since it only reads the KV metadata. This is the same shard the engine reports as at when it finds the tensor, so the fix could be to pick the first shard that actually carries tensors.

2. --compat-bf16 is required for UD-IQ3_XXS but is only wired to the unsloth family. iq_pack.py stops with blk.N.hc_attn_down.weight is Q8_0, but the engine requires BF16; use --compat-bf16 - 195 tensors, 1.20 GiB. FAMILIES["unsloth"]["pack_args"] already carries --compat-bf16, but that family only lists UD-Q4_K_XL / UD-IQ4_XS, so an UD-IQ3_XXS user has to run iq_pack.py by hand and then re-run setup so it picks the pack up. Not an error, just a gap between what the packer needs and what setup will pass.

One patch I still carry (offering it if useful): UD-IQ3_XXS also stores token_embd.weight / output.weight as Q6_K, which is not in is_iq(), so embed_type_supported() refuses it. Four hunks in src/kernels/cuda/iq_kernels.cu - a dq_q6_k dequantiser following ggml's Q6_K layout, case 14 in dq_dispatch, 14 in is_iq(), and case 14 in iq_row_bytes. It is the same Q6_K arithmetic as dequant.hpp's dequantize_q6_K, and it reproduces the layout of the one I have been running since 0.1.24. Say the word and I will open it as a PR; the reason I am not assuming you want it is that 0.1.35+ does not list UD-IQ3_XXS as supported at all, so adding a kernel for it may be the wrong priority.

Numbers on the community build, for the matrix: 2x V100-SXM2-16GB, IQ3_XXS, --spec 2, context 131072 - 33.4 tok/s end-to-end on short Chinese prompts, expert cache 8765 slots across the two cards, prefill 305 tok/s on a ~1K-token prompt, and one scanned A4 journal page read correctly (journal, volume/issue, page, table title, all three columns, drug names by syndrome).

<!-- gh-comment-id:6092035513 --> @zipenghao commented on GitHub (Oct 10, 2026): Update from your point of view - this reporter is now on **0.1.34** with `STRATA_EXPERIMENTAL_SM60=1` and **no source patches at all** for the platform. The flag is all it took, exactly as @backstable described; my earlier patch set is retired apart from one Q6_K hunk (below, unrelated to the arch gate). Two things I hit that are about the *artifact* rather than the card, and that cost me an hour. They are reproducible on any GPU, so reporting them here rather than opening a separate issue - happy to split them out if that is cleaner. **1. `--native` is pointed at the wrong shard for a 3-shard split.** `setup.py` picks `shards[0]`, which is correct for the 2-shard GSQ-RCO files. Unsloth's split puts the metadata in `-00001-of-00003` (10.9 MB, **zero tensors**) and every tensor in shards 2-3, so the engine starts and then exits: ``` strata generate: native embedding: token_embd.weight is absent, of another shape, or of a type without a GPU dequantizer ``` Repointing `--native` at `-00002-of-00003.gguf` fixes it; the vision block's `model` is happy with shard 1, since it only reads the KV metadata. This is the same shard the engine reports as `at` when it finds the tensor, so the fix could be to pick the first shard that actually carries tensors. **2. `--compat-bf16` is required for `UD-IQ3_XXS` but is only wired to the `unsloth` family.** `iq_pack.py` stops with `blk.N.hc_attn_down.weight is Q8_0, but the engine requires BF16; use --compat-bf16` - 195 tensors, 1.20 GiB. `FAMILIES["unsloth"]["pack_args"]` already carries `--compat-bf16`, but that family only lists `UD-Q4_K_XL` / `UD-IQ4_XS`, so an `UD-IQ3_XXS` user has to run `iq_pack.py` by hand and then re-run setup so it picks the pack up. Not an error, just a gap between what the packer needs and what setup will pass. **One patch I still carry** (offering it if useful): `UD-IQ3_XXS` also stores `token_embd.weight` / `output.weight` as **Q6_K**, which is not in `is_iq()`, so `embed_type_supported()` refuses it. Four hunks in `src/kernels/cuda/iq_kernels.cu` - a `dq_q6_k` dequantiser following ggml's Q6_K layout, `case 14` in `dq_dispatch`, `14` in `is_iq()`, and `case 14` in `iq_row_bytes`. It is the same Q6_K arithmetic as `dequant.hpp`'s `dequantize_q6_K`, and it reproduces the layout of the one I have been running since 0.1.24. Say the word and I will open it as a PR; the reason I am not assuming you want it is that 0.1.35+ does not list `UD-IQ3_XXS` as supported at all, so adding a kernel for it may be the wrong priority. Numbers on the community build, for the matrix: 2x V100-SXM2-16GB, IQ3_XXS, `--spec 2`, context 131072 - **33.4 tok/s** end-to-end on short Chinese prompts, expert cache 8765 slots across the two cards, prefill 305 tok/s on a ~1K-token prompt, and one scanned A4 journal page read correctly (journal, volume/issue, page, table title, all three columns, drug names by syndrome).
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#150
No description provided.