mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#258
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 @gravitomagnetic on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/542
sm_120 + IQ packs: ~4x prefill regression 0.1.34–0.1.36 — the #420
fits()gate silently disables MMQ when libcudart's ABI is mismatched (smpboreads 1)Reported by gravitomagnetic. Same machine and config as my community benchmark (RTX 5090, 1M-context agent workload). This one comes with a root cause and a reproduction that needs no GPU workload at all.
Symptom
Cold prefill drops ~4x from 0.1.32 onward; decode is unaffected. Engine-reported
timings, medians of 3 cold runs (unique-salted prompts), same box, same config:The startup log on the slow engines prints, per IQ type:
"1 bytes of shared memory per block" — an RTX 5090 reports 101,376. That impossible value is the whole story.
Setup
-DCMAKE_CUDA_ARCHITECTURES=120, nvcc from a CUDA 13.4 kit--max-context 1048576 --rope-scaling yarn --rope-scale 4 --kv int8 --kv-resident 32768 --expert-cache 7500 --mtp --spec 4, prefillautoRoot cause
My 13.4 kit had a dangling
libcudart.sosymlink (the kit shipped onlylibcudart_static.a). CMake's FindCUDAToolkit therefore resolved cudart to the system's CUDA 12.4libcudart.so.12— and every engine binary I built (0.1.31 through 0.1.36) carriesNEEDED libcudart.so.12while its host code was compiled against 13.x headers.cudaGetDevicePropertiesfills a struct whose layout changed between 12.4 and 13.x. Reads land at wrong offsets. A probe linked against the engine's ownlibstrata_mmq.a(which containssrc/prefill/ggml_cuda_host.cu'sggml_cuda_info()) shows:(
nsm=1,integrated=1— all garbage. The enum-basedcudaDeviceGetAttributecalls on the same old runtime return the truth:smpbo=101376,nsm=170.)mmq::fits()(#420, commit8404117) comparesmmq_get_nbytes_shared(config)(~41–48 KB) againstinfo.devices[id].smpbo. Withsmpboreading 1, it returns false for every IQ type, and all expert products silently take the dequant-FP16 fallback — the 4x prefill regression.Why 0.1.31 was unaffected: its MMQ decision is the compile-time type list in
supported(); it never readssmpbo. The ABI mismatch was latent in all my builds; the #420 runtime gate is what weaponized it.Reproduction (no model, no workload)
Compile a probe that calls
ggml_cuda_info()and printsdevices[0].smpbo, linked againstlibstrata_mmq.a+libggml-base.a, built with a toolkit whoselibcudart.soresolves to an older runtime than the headers.smpboreads 1; replicating thefits()loop returns false for iq3_s/iq3_xxs/iq2_s/iq4_xs at 1280 and 5120 rows. Relinked against the matchinglibcudart.so.13:smpbo=101376,fits()=truefor all twelve combinations.The fix, locally
Repaired the kit symlink and rebuilt with
-DCUDAToolkit_ROOT=<kit>(without it CMake still finds the system 12.4 dev symlink).NEEDED libcudart.so.13→ full speed restored (last table row).Why this matters upstream
The trigger here was my broken kit, but the failure mode is nasty in general:
cudaDeviceGetAttributefor exactly this ABI fragility.src/prefill/ggml_cuda_host.cu/moe_mmq.cu:cudaDeviceGetAttribute(ABI-stable) instead ofcudaGetDeviceProperties, or at least forcc,nsm,smpbo;smpbo < 8192ornsm == 0on any CUDA card is physically impossible — log a loud "compiled against newer CUDA headers than the libcudart you linked (ABI mismatch?)" warning instead of the misleading "MMQ has no tile" line;mmq_get_nbytes_sharedvalue in the fallback message so the comparison is auditable.Happy to test any candidate patch on this box — the probe and the 3-run cold-prefill harness are reproducible in minutes.
@gravitomagnetic commented on GitHub (Oct 2, 2026):
In plain English, I was experiencing dramatically slow prefill with Strata builds post-0.1.31. Strata diagnosed and corrected the issue for my local implementation of 0.1.36.
@Niko1221 commented on GitHub (Oct 3, 2026):
Thanks, excellent root-causing. Fixed in 0.1.38:
ggml_cuda_info()now reads cc,smpbo,smpb, the SM count, the warp size, integrated and cooperative launch throughcudaDeviceGetAttribute, so a mismatched libcudart can no longer turn MMQ off. A matched build reads the same values as before.-DCUDAToolkit_ROOT).@gravitomagnetic commented on GitHub (Oct 5, 2026):
Closing the loop from the reference box: re-probed 0.1.39 with the same cold-prompt protocol used in this issue's measurements (unique-salt prompts, 3-run medians, engine-reported timings, quiet server).
Regression fully closed — and 0.1.39 now exceeds the 0.1.31 baseline at 32K (+9%) and 128K (+5%). Config: RTX 5090, IQ3_S 1M ctx YaRN×4, kv int8, spec 4, ring default-on,
STRATA_NO_LARGEPAGES=1(#771 guard). Details in the bench report comment on #466. Thanks for shipping thecudaDeviceGetAttributefix — the probe on the new build was the acceptance test we asked for.