mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4376] [Engine] dsv41: the WMMA expert kernels compile on pre-Volta cards #5027
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#5027
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/4376
Author: @lyesrock
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:feature/dsv41-pascal-sm61📝 Commits (1)
5484f76DeepSeek engine: the WMMA expert kernels compile on Pascal and other pre-Volta cards - crt/mma.h declares nvcuda::wmma only for sm_70+, so the wmma bodies of mx_set_tc_kernel and set_tc_kernel sit under an CUDA_ARCH >= 700 guard inside the kernel (the device passes below 700 compile an empty one, the same guard as src/prefill/gdn_chunk.cu's); tc_ok() already keeps those cards on the F32 paths, so answers are unchanged; builds strata-dsv41 on sm_61 (2x Tesla P40)📊 Changes
2 files changed (+15 additions, -6 deletions)
View changed files
📝
src/dsv41/ds4_gguf.cu(+9 -4)📝
src/dsv41/ds4_iq.cu(+6 -2)📄 Description
Problem and result
The DeepSeek-V4.1 engine (
strata-dsv41) does not compile on pre-Volta cards:mx_set_tc_kernel(src/dsv41/ds4_gguf.cu) andset_tc_kernel(src/dsv41/ds4_iq.cu) namenvcuda::wmmawith no arch guard, andcrt/mma.hdeclares those names only for__CUDA_ARCH__ >= 700. On sm_61 (e.g. 2x Tesla P40) the build fails on thenvcuda::wmmadeclarations before producing any binary. With this change the same source builds on sm_61 and the engine starts and answers there.Related discussion
none
Approach
The wmma body of the two kernels sits under
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700inside the kernel, so device passes below sm_70 compile an empty one; thenamespace wmalias and thekLdTconstant move inside the guard. This is the patternsrc/prefill/gemm.cuandsrc/prefill/gdn_chunk.cualready use. No values change:tc_ok()(ds4_gguf.cu,ds4_iq.cu) already keeps cards below sm_70 on the F32 kernels (mx_set_kernel,set_kernel), so the tensor-core kernels are never launched there. It is a compilation fix, not a perf change.Validation
All runs ours, one box: 2x Tesla P40 (sm_61), Xeon E5-2620 v4, 92 GiB RAM, Linux; revision 9e0a7319 (this branch, rebased on
5e8a4cca).Passed:
cmake -G Ninja -S . -B build-dsv41-sm61 -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DSTRATA_BUILD_DSV41=ON -DSTRATA_EXPERIMENTAL_SM60=ON -DSTRATA_NATIVE_EXPERTS=ON -DSTRATA_PORTABLE=ON -DCMAKE_CUDA_ARCHITECTURES=61 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc -DCUDAToolkit_ROOT=/usr/local/cuda-12.9 -DSTRATA_GGML_DIR=third_party/llama.cpp '-DCMAKE_INSTALL_RPATH=$ORIGIN'thenninja -C build-dsv41-sm61 strata-dsv41: links with 0 errors;build-dsv41-sm61/strata-dsv41 --versionprintsstrata-dsv41 0.1.52 build 9e0a73199.-DCMAKE_CUDA_ARCHITECTURES=89-real -DCMAKE_CUDA_COMPILER=/usr/local/cuda-13.0/bin/nvcc -DCUDAToolkit_ROOT=/usr/local/cuda-13.0(noSTRATA_EXPERIMENTAL_SM60) thenninja ... strata-dsv41: links with 0 errors.deepseek-v4.1-flash-ist-das-2.25bpw, context 16384,--tp 2: one OpenAI chat request (temperature 0,max_tokens 64) answered "The capital of France is Paris." Coherent output: compilable and functional, not a speed measurement.Failed: none observed. (The same sm_61 build without the guard is the failure described under Problem and result:
nvcuda::wmmais not declared bycrt/mma.hbelow sm_70.)Not run: HIP and SYCL builds (the touched code sits inside
#if !defined(STRATA_USE_HIP), CUDA only); speed measurements (the guarded kernels are never launched on these cards, so nothing measurable changes); a real sm_70 card (the guard covers it, none at hand).Limits
On a device pass below sm_70 the two kernels compile to empty bodies; launching one there would be a silent no-op, but
tc_ok()keeps those cards on the F32 paths, so that launch cannot happen. Running the pack on 2x P40 stays bound by the rules and memory bandwidth of a Pascal box; this PR only makes the build possible.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.