Skip to content

[Engine] cuda(qsa): opt-in 64-slot batching in qsa_decode_attn_slots (STRATA_QSA_ATTN_BATCH64) - #482

Closed
cobra91 wants to merge 1 commit into
simplexai-labs:mainfrom
cobra91:feat/qsa-attn-batch64
Closed

cobra91 wants to merge 1 commit into
simplexai-labs:mainfrom
cobra91:feat/qsa-attn-batch64

Conversation

@cobra91

@cobra91 cobra91 commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow qsa_decode_attn_slots to launch up to 64 homogeneous slots in a single kernel call (gated behind opt-in STRATA_QSA_ATTN_BATCH64=1), instead of capping every call at 8 slots due to the 4 KB CUDA kernel parameter budget.

Changes

  • Compact 64-slot device descriptor (QsaAttnSlotPtrs64): packs only the 5 active pointers per slot (k, v, ks, vs, pages) into a 2,560-byte by-value descriptor (safe under the kernel parameter limit and compatible with CUDA Graph capture), while keeping the existing 8-slot QsaAttnLegacySlots path as the default when STRATA_QSA_ATTN_BATCH64 is unset.
  • 64-slot chunk kernels (attn_chunk_slots64_kernel / attn_chunk_slots64_pre75_kernel): unpack QsaAttnPools in-register per blockIdx.z from QsaAttnSlotPtrs64.
  • Verifier integration (verify.cpp): batch up to 64 slots in qsa_decode_attn_slots when STRATA_QSA_ATTN_BATCH64=1, while keeping qsa_block_scores_slots chunked at 8 rows (its own descriptor limit).
  • Parity & settings: extend qsa_slots_parity to cover >8 up to 64 slots and document STRATA_QSA_ATTN_BATCH64 in settings-register.json.

Verification

  • Built strata and qsa_slots_parity on Windows 11 / CUDA 13.4 (-DSTRATA_GEOMETRY=q4_lite, sm_89;120).
  • Ran qsa_slots_parity.exe with STRATA_QSA_ATTN_BATCH64=1 and STRATA_QSA_ATTN_BATCH64=0 on RTX 5080 (both exited 0).

@VecSzn

VecSzn commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the PR! We are closing this because it only modifies pure upstream strata core files (�erify.cpp, qsa_decode_attn.cu) that are unused by strata-poly. Please submit this upstream to Niko1221/Strata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants