[PR #233] GLM prompt: the DSA indexer's scores on FP16 tensor cores - dsa_index 824 -> 494 ms on a 27K prompt #411

Closed
opened 2026-10-29 21:25:06 +07:00 by bsakaguchi · 0 comments
Owner

Original Pull Request: https://github.com/mw00/project-maya/pull/233

State: closed
Merged: Yes


This moves the prompt path's DSA indexer scores (dsa_score) onto FP16 tensor cores.

The new dsa_score_tc_kernel keeps the FP32 tiled kernel's tile: 4 tokens' 128 (token, head) query rows against 64 pools, k = 128. Both operands are staged as FP16 in shared memory. Eight warps each compute 16 rows x 64 pools with WMMA m16n16k16 and FP32 sums. The epilogue (relu(dot) * w summed over the 32 heads) runs in FP32, as before.

It is the default on CUDA. STRATA_GLM_DSA_SCORE=1 keeps the FP32 tiled kernel and =0 the warp kernel. HIP is unchanged.

Measured on Maya-S24, one V100 32 GB, a 27K-token prompt with a needle (cooled runs). This branch, rebased on main 3650d0d:

dsa_index 27K prompt Needle
STRATA_GLM_DSA_SCORE=1 (FP32 tiled) 823.8 ms 43.9 s answered
default (tensor cores) 493.5 ms 43.5 s answered

Two earlier rounds on my branch: dsa_index 826 / 826 -> 495 / 495 ms and prompt 36.9 / 37.0 -> 36.6 / 36.6 s. Greedy tokens stayed within GLM's normal run-to-run spread.

The gain is small, since the indexer is about 2% of a 27K prompt on this card. I only measured it on Volta. It would be worth a check on a newer card.

**Original Pull Request:** https://github.com/mw00/project-maya/pull/233 **State:** closed **Merged:** Yes --- This moves the prompt path's DSA indexer scores (`dsa_score`) onto FP16 tensor cores. The new `dsa_score_tc_kernel` keeps the FP32 tiled kernel's tile: 4 tokens' 128 (token, head) query rows against 64 pools, k = 128. Both operands are staged as FP16 in shared memory. Eight warps each compute 16 rows x 64 pools with WMMA m16n16k16 and FP32 sums. The epilogue (relu(dot) * w summed over the 32 heads) runs in FP32, as before. It is the default on CUDA. `STRATA_GLM_DSA_SCORE=1` keeps the FP32 tiled kernel and `=0` the warp kernel. HIP is unchanged. **Measured** on Maya-S24, one V100 32 GB, a 27K-token prompt with a needle (cooled runs). This branch, rebased on main 3650d0d: | | dsa_index | 27K prompt | Needle | |---|---|---|---| | `STRATA_GLM_DSA_SCORE=1` (FP32 tiled) | 823.8 ms | 43.9 s | answered | | default (tensor cores) | **493.5 ms** | **43.5 s** | answered | Two earlier rounds on my branch: dsa_index 826 / 826 -> 495 / 495 ms and prompt 36.9 / 37.0 -> 36.6 / 36.6 s. Greedy tokens stayed within GLM's normal run-to-run spread. The gain is small, since the indexer is about 2% of a 27K prompt on this card. I only measured it on Volta. It would be worth a check on a newer card.
bsakaguchi 2026-10-29 21:25:06 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#411
No description provided.