mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 19:04:50 +07:00
[GH-ISSUE #212] Speed report: 1 / 2 / 3x Tesla P40 (Pascal, sm_61) - Maya-S24 28 tok/s and Maya-L 17 tok/s on two P40s, once global loads are cached in L1 (-Xptxas -dlcm=ca, 1.7-3x decode) #84
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#84
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 @Jw88888 on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/212
A speed report for Tesla P40s, which are below Maya's supported GPUs (compute capability 6.1; the setup asks for 7.0+). The engine builds for sm_61 with three small compile guards, and runs Maya-L and Maya-S24 on one, two and three P40s.
At first decode was slow (Maya-L 5.8 tok/s on one P40). A profile showed the dense Q6_K GEMV running at about a quarter of the card's memory bandwidth. The cause: GP102 caches global loads in L2 only unless told otherwise, and the GEMVs' many small loads miss L1. Building with
-Xptxas -dlcm=camade decode 1.7-3x as fast, with the same answers. Related: #189 reports three P40s with Maya-S24 at 9.2 tok/s, which matches what I measured without the flag (9.6, then 8.1). The flag may be the answer to its first question. It also mentions an experimental Pascal build (-DSTRATA_EXPERIMENTAL_SM60=ON); I could not find that option in this repository, so this report uses the guards below.maya-report.txtis at the end, collapsed:./maya.sh --reportafter a--benchof Maya-S24 on two P40s with the flag (28.1 tok/s).The machine
8931339, plus the guards and flag below (local)--prefill auto,--kv-streaming on, the shipped expert profile, no vision. Every off-card expert fits in the RAM tier (0 disk reads a token)STRATA_GLM_SLOT_DIR(the NFS share is read-only)How it was built and started
Architecture:
CMAKE_CUDA_ARCHITECTURES=nativewithCUDA_VISIBLE_DEVICESon a P40, asmaya.py'sarch_setting()does for V100s (CMake refuses an explicit arch below 75).Three guards for sm_70+ features (20 lines):
glm_batch.cu: the bodies ofmla_attn_tc_kernelandmla_attn_tc_reg_kernel(wmma) compile to nothing for__CUDA_ARCH__ < 700.mla_attnalready takes the F32 kernel whenmajor < 7, so neither is ever launched there.elementwise.cu(doorbell_wait_kernel) andverify_kernels.cu(wait_flag_ge_kernel,wait_flag_ge_or_kernel):__nanosleepis sm_70+, so below that the wait is a plain spin.Nothing else failed to compile, and the rest of the GLM path took its existing fallbacks (the log says
prompt attention on the F32 coreson every card).-DCMAKE_CUDA_FLAGS=-Xptxas -dlcm=ca: global loads cached in L1. Volta and newer do this by default; GP102 (like GP104) caches global loads in L2 only, unless a load goes through the read-only path.Why the report says "not compiled yet" and "model ?": the setup refuses the card (
MIN_CC), so the configs were written by hand from working ones and the server started directly (serve/server.py --engine strata --config ...). That is also why--reportfinds noMAYA-BUILD.jsonand noinstallerblock../maya.sh --bench --config <cfg>works as is.Why the flag: the profile
nsys profile -t cudaaround./maya.sh --bench, Maya-L on one P40, without the flag:mv_kernel_t<14>(Q6_K) was 51% of GPU time: about 150 calls a token at 563 µs each, so ~84 ms of a ~150 ms token. That is a quarter or less of what the P40's 347 GB/s allows for the dense weights.moe_fetch_kernel(17%),moe_cpu_wait_kernel(7%) andmoe_gate_up_kernel<21>(IQ3_S, 7%).The kernels' loads are small (
get_int_b2, scales, the q8_1 activations every warp reads). Served from L2 each time on GP102, they starve the dot products. (The engine crashed insidelibcuptinear the end of the profiled run; the report was written. Profiling only.)./maya.sh --benchOne, two and three P40s. One and two GPUs use the x16 cards (GPU 1, GPUs 1+2); three include the x8 card. Each cell is decode for the three questions, then the mean, in tok/s.
-dlcm=caSame answers: I checked greedy chat answers from both builds (Maya-S24, one P40, three prompts of up to 200 tokens). All three are identical to the character, at 5.3-5.5 and 14.9-16.7 tok/s. The flag only changes where loads are cached, not the arithmetic.
Where the experts sat on two P40s, both models (
glm fast:lines):Settings tried without the flag (no gain)
A separate harness: Maya-L on three P40s, a fresh engine start per row, six chat prompts of 350 tokens, greedy, thinking low. Baseline 8.38 tok/s. Everything else landed within about 2% of it:
STRATA_GLM_CPU_LANE14 / 26: 8.47 / 8.43; 30 was clearly worse at 6.38.STRATA_GLM_VRAM_EVICT=lru: 8.37.STRATA_GLM_SPEC_HEAD=2: 8.24.STRATA_GLM_MTP_KEEP4 / 6 / 8: 8.35 / 8.30 / 8.26.--kv int8: 8.28.What I did not measure
If this is of interest, I can open a PR with the three guards and the flag applied only to sm_6x builds. The setup's
MIN_CCwould still refuse the card, so it would need a decision on whether Pascal is offered at all.maya-report.txt@mw00 commented on GitHub (Oct 16, 2026):
Thanks for the careful profile and the clean A/B, @Jw88888. Yes - we'll offer Pascal (compute capability 6.x) as experimental. We'll review and test your #214 (the three guards and
-Xptxas -dlcm=cafor sm_6x builds) for the next release, and post here when it is in.@mw00 commented on GitHub (Oct 16, 2026):
v1.1.14 is out: it builds and sets up Pascal cards as experimental - your guards and L1 flag (#214), and the setup accepts compute capability 6.x. Please update and tell us how it goes on your P40s.
@mw00 commented on GitHub (Oct 20, 2026):
Thank you, @Jw88888 - your two-P40 numbers (with the L1 flag that shipped in v1.1.14) are now in the README's speed table.