Repository navigation
Conversation
…nels empty below sm_53 The experimental build (-DSTRATA_EXPERIMENTAL_SM60=ON) compiles src/prefill/moe_ws_down.cu for every architecture it targets. Its kernels use half-precision arithmetic (HFMA2), which ptxas accepts from sm_53, so a Maxwell build (-DCMAKE_CUDA_ARCHITECTURES=52, the recipe in docs/OLDER_GPUS.md) stopped with "Feature 'f16 arithemetic and compare instructions' requires .target sm_53 or higher". The kernels only run on a GP100 (ws::mode() is 0 on any other card), so below sm_53 the device pass is now left empty and the host code is unchanged. The device code for sm_60 and newer is identical. Refs Niko1221#3218 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
The Maxwell (sm_52) recipe in
docs/OLDER_GPUS.mddoes not build on currentmain(870aedd):stops in
CMakeFiles/strata_mmq.dir/src/prefill/moe_ws_down.cu.owith 400 errors of the formmoe_ws_down.cu(the GP100 weight-stationary down kernels) uses HFMA2, which ptxas accepts from sm_53. With this change thebuild completes and the engine runs on a Tesla M40 (sm_52).
Related discussion
Refs #3218 (lower the architecture floor for Maxwell). The sm_52 floor itself is already in
CMakeLists.txt(61ede87); thisonly fixes the compile error that remains behind it. No scope change:
setup.pystill refuses Maxwell, as in c966d7a ("Maxwell gets a warning withthe build recipe, not an env switch"), and the closed Maxwell PRs (#3595, #3596) are not revived.
Approach
moe_ws.hppsays these kernels are for GP100 only, andws::mode()returns 0 on any other card, so on sm_52 they are neverlaunched. The file is wrapped in
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 530: the device pass is empty below sm_53,the host pass (launch code, which
prefill.cpplinks against) is unchanged. 530 is the ISA limit ptxas reports, not a tuningchoice. I checked the other three
moe_ws*.cufiles: they compile unguarded for sm_52, so they are left alone.Validation
Environment: Tesla M40 24 GB (sm_52), driver 580.159.03, Ubuntu 24.04 VM, gcc 13.3, CUDA 12.9.86, cmake 4.4.4, Strata
main870aedd plus this commit. Setup's own build of the engine was used for the run below; to let setup accept a 5.2 card I changed
sm60_card()locally. That change is not part of this PR.Passed:
moe_ws*.cufor sm_52 on its own with the build'sexact flags:
moe_ws.cu,moe_ws_gu_iq2.cu,moe_ws_gu_iq3.cucompile;moe_ws_down.cufails (400 ptxas errors).-DSTRATA_EXPERIMENTAL_SM60=ON, arch 52) completes and links, with all fourmoe_ws*.cuobjects rebuilt.moe_ws_down.cufor sm_61, sm_75 and sm_86 with the build's flags, before and after, givesidentical
cuobjdump -sassinstruction streams (12384 / 16160 / 16240 instructions).was correct, and
is_prime(n)came back as a complete, correct function. One run each,temperature0; the 140-token code answer took 9.7 send to end. That is a smoke test, not a benchmark under the community protocol.
Failed: nothing else observed. (Before the change: the build failure above.)
Not run:
sm_60+ unchanged by construction, and the SASS check above covers sm_61/75/86 only.
STRATA_BUILD_TESTS=ON.Limits
Maxwell is still only a hand build; this does not change
setup.pyor add a ready-made engine.Prepared with Claude Code (AI-assisted): the diff is 8 lines in one file; the commands and results above were run on the machine described.
🤖 Generated with Claude Code