mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4300] [Engine] strata-dsv41: build for Pascal (sm_61) by compiling the WMMA set kernels for sm_70+ only #4990
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#4990
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/4300
Author: @orlyandico
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:sm61-dsv41-wmma-guard📝 Commits (1)
b007a36DeepSeek engine: compile the WMMA set kernels' bodies only for sm_70+ device passes, as pf_wmma (a6bdc3fb): an sm_61 build failed in ds4_gguf.cu / ds4_iq.cu with no nvcuda::wmma there (#4173); tc_ok() never launches them below compute capability 7📊 Changes
2 files changed (+8 additions, -0 deletions)
View changed files
📝
src/dsv41/ds4_gguf.cu(+4 -0)📝
src/dsv41/ds4_iq.cu(+4 -0)📄 Description
Problem and result
strata-dsv41does not build for Pascal (-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=61):ds4_gguf.cuandds4_iq.cuusenvcuda::wmmain the prompt path's tensor-core set kernels (mx_set_tc_kernel,set_tc_kernel), and<mma.h>declares that namespace only for__CUDA_ARCH__ >= 700. With this change the engine builds for sm_61 and runs DeepSeek-V4.1-Flash on 2× Tesla P40.Related discussion
Fixes #4173. No scope agreement sought: a focused build fix.
Approach
The same guard as
pf_wmmaina6bdc3fb: the two kernels' bodies compile only in sm_70+ device passes, and the file-scopenamespace wm = nvcuda::wmma;alias is guarded the same way (the host pass keeps it).tc_ok()already refuses compute capability below 7 at run time, so on a Pascal card the F32 set kernels run, as before; the guarded kernels are never launched there.The guards are always true on sm_70 and later and in the host pass, so the release engines (sm_86 / sm_120, HIP) compile the same code as before. The HIP path is outside the
#if !defined(STRATA_USE_HIP)block and is untouched.Validation
Environment: x9srl, 2× Tesla P40 24 GB (sm_61), Xeon E5-2651 v2 (AVX, no AVX2), 128 GB, Ubuntu 24.04, CUDA 12.3, g++-12. Model: ISTA-DASLab DeepSeek-V4.1-Flash-1017-GSQ-RCO IQ2_XXS (pack
deepseek-v4.1-flash-ist-das-2.00bpw).Passed:
Build at
b007a36d(this branch, on main4b9e05a2):→
strata-dsv41 0.1.51 build b007a36d8. Without the change the same command stops inds4_gguf.cu/ds4_iq.cuon the undefinednvcuda::wmma.cmake --build build-wg --target ds4_iq_test && CUDA_VISIBLE_DEVICES=0 ./ds4_iq_teston a P40:ALL OK. All 7 types(IQ2_XXS, IQ2_XS, IQ2_S, IQ3_XXS, IQ3_S, IQ4_XS, IQ1_M) × token gate_up / down, set gate_up / down and CPU lane are
within tolerance; the set kernels run the F32 path here, as
tc_ok()is false on sm_61.Decode on both P40s, 96 greedy tokens after a 20-token coding question:
Two runs: 1.17 tok/s (cold page cache) and 1.66 tok/s (warm). The text is a sound answer ("# Parsing ISO 8601 Dates in Python …
datetime.fromisoformat()…"). The two runs agree for the first 58 tokens and then reword; the token ids follow where the expert cache places the experts (the CPU lane and the GPU round differently), the same behaviour as a 0.2.4.2 build with a local stub in place of this guard.Multi-arch compile,
-DCMAKE_CUDA_ARCHITECTURES="61;70;86"(otherwise the same command), the engine'sds4_gguf.cu.oandds4_iq.cu.o: no errors.cuobjdump -sassHMMA count per arch:ds4_gguf.cu.osm_61 0,sm_70 192, sm_86 24;
ds4_iq.cu.osm_61 0, sm_70 2304, sm_86 288. The tensor-core kernels are still built forsm_70+ and left out of the sm_61 pass only.
Failed: none observed. The sm_61 pass warns that
kLdTis declared but never referenced (it sits outside the guard).Not run:
still built there; their arithmetic is not exercised.
tests/dsv41/ds4_gguf_test.cu: it has no CMake target or documented build command, sods4_gguf.cu's kernels are not covered by a test run here.Limits
This makes the sm_61 build possible; it does not add Pascal to any package (
packaging/build_dsv41_cuda.shstill notes "the Pascal cuda12 variant has no DeepSeek path"). Decode on this box is limited by the CPU lane and its SSD reads, not by this change. Pascal decode speed is #4174 (-Xptxas -dlcm=ca), a separate PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01X1cLqPe2PZ4sDqfHSEgfLr
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.