mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4174] [Engine] strata-dsv41 on Pascal: build without -Xptxas -dlcm=ca leaves the Q5_K dense GEMV L2-bound (attention 278 -> 34 ms a token on a P40 with it) #1833
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#1833
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?
Originally created by @orlyandico on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4174
Area
[Engine]
Desktop app, Terminal or source?
Source (a build)
What happened
On a Tesla P40 (sm_61) the DeepSeek-V4.1 engine spends most of its GPU time in the dense Q5_K GEMV, which runs at a few percent of the card's bandwidth. Compiling with
-Xptxas -dlcm=ca(global loads cached in L1), as Project Maya's CMake does for every sm_6x build (#212 / #214 there: "decode 1.7-3x, same answers"), fixes it. Strata's CMakeLists.txt has nodlcm(checked on main4b9e05a2), so a Pascal build ofstrata-dsv41gets the L2-only loads.nvprof (trace only) over 96 decoded tokens, default build:
iq::mv_kernel<13, 1>(Q5_K, one column)wait_seq_kernelThat is ~378 ms a token for the 5.3 GB of Q5_K dense weights, ~14 GB/s on a 347 GB/s card. The SASS of that kernel has plain
LDG.Eloads (noLDG.E.CI: the weight pointer comes from theJobsstruct, not aconst __restrict__parameter), and each lane makes ~20 four-byte loads per 32 values, 8 of them the 32-byteqharray that all 8 lanes of a superblock read in full. On GP102 those go to L2 only.DS4_PROF=1, 96 greedy tokens, 4K context,--dspark none --ssd-cache 85, ms per token:-Xptxas -dlcm=ca(The CPU-lane wait grows because the GPU no longer hides it; on this box most of it is SSD reads: 128 GB of RAM for 95 GB of CPU-lane experts plus the Engram table.)
The output is unchanged: the
-dlcm=cabuild's 96 token ids are identical to the default build's at the default 48 GB store. (Default-build runs at different--ssd-cachesizes differ from each other after ~12 tokens, which follows where the experts are placed, CPU lane against GPU, not the flag.)Suggested fix: Maya's block (CMakeLists.txt there, after "Maya: CUDA enabled"), which appends
-Xptxas -dlcm=cato CMAKE_CUDA_FLAGS when any target arch is 6x. It would likely help the Qwen engine's Pascal decode as well, but I have only measured strata-dsv41.Smallest steps or command that reproduce it
Build
strata-dsv41for sm_61 (build line in #4173), once as is and once with"-DCMAKE_CUDA_FLAGS=-Xptxas -dlcm=ca", then for each:and compare the "GPU per token (DS4_PROF)" line and the printed ids.
Reproduction status
Reproduced locally
Strata version
Source
7dd5cf18(0.2.4.2), engine strata-dsv41 0.1.49.2; CMake checked on main4b9e05a2Graphics card, memory and system
2x Tesla P40 24 GB (sm_61, PCIe 3.0 x8) · Xeon E5-2651 v2 (AVX, no AVX2) · 128 GB DDR3 · SATA SSD · Ubuntu 24.04 · CUDA 12.3
Model, size and settings
DeepSeek-V4.1-Flash IST-DAS-2.00bpw (ISTA-DASLab IQ2_XXS) · 4,355 of 15,360 experts in VRAM, 11,005 on the CPU lane · layer split over both GPUs
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.