Cute Dsl Qsa Sparse Runner#
-
class CuteDslQsaSparsePrefillRunner#
Sparse attention with one CTA per query token and KV head.
Public Functions
-
CuteDslQsaSparsePrefillRunner() = delete#
Public Static Functions
- static bool canImplement(
- int32_t numQHeads,
- int32_t numKVHeads,
- int32_t headDim,
- int32_t poolHeadDim,
- int32_t smVersion,
- trt_edgellm::DataType dataType
Returns whether the paged QSA AOT family covers this shape on this SM.
- static bool preflight(
- trt_edgellm::DataType dataType,
- cudaStream_t stream
Loads the paged prefill variant for this dtype before CUDA graph capture.
- static bool run(
- trt_edgellm::DataType dataType,
- QsaSparsePrefillParams const ¶ms
Launches all prefill queries against their individual causal index lists.
-
CuteDslQsaSparsePrefillRunner() = delete#
-
class CuteDslQsaSparseDecodeRunner#
Runner for the single-launch split-K QSA sparse decode kernel.
Public Functions
-
CuteDslQsaSparseDecodeRunner() = delete#
Public Static Functions
- static bool canImplement(
- int32_t numQHeads,
- int32_t numKVHeads,
- int32_t headDim,
- int32_t poolHeadDim,
- int32_t smVersion,
- trt_edgellm::DataType dataType
- static bool preflight(
- trt_edgellm::DataType dataType,
- cudaStream_t stream
Ensures the decode variant is loaded (CUDA-graph-capture aware).
- static bool run(
- trt_edgellm::DataType dataType,
- QsaSparseDecodeParams const ¶ms
-
CuteDslQsaSparseDecodeRunner() = delete#
-
struct QsaSparsePrefillParams#
Initial and continuation prefill queries attend to individual causal token-index lists.
Q/O are [batchSize, seqLen, numQHeads, headDim]. The pool and page table use the decode layout; columns [headDim, poolHeadDim) are never read.
indicesis [batchSize, seqLen, topK], with causal token ids followed by -1.queryLengthsis [batchSize]; padded query rows store exact zeros without reading their Q, index list, or KV data.Public Members
-
void const *qPtr = {}#
-
void const *kvPoolPtr = {}#
-
int32_t const *pageTable = {}#
-
int32_t const *indices = {}#
-
int32_t const *queryLengths = {}#
-
void *oPtr = {}#
-
int32_t batchSize = {}#
-
int32_t seqLen = {}#
-
int32_t numQHeads = {}#
-
int32_t numKVHeads = {}#
-
int32_t headDim = {}#
-
int32_t poolHeadDim = {}#
-
int32_t numFlatPages = {}#
-
int32_t maxPagesPerSeq = {}#
-
int32_t topK = {}#
-
float attentionScale = {}#
-
cudaStream_t stream = {}#
-
void const *qPtr = {}#
-
struct QsaSparseDecodeParams#
Per-launch parameters for the QSA split-K sparse DECODE kernel.
One query token per sequence:
qPtr/oPtrare [batchSize, 1, numQHeads, headDim]. K/V come from the paged pool [2*numPages, 128, numKVHeads, poolHeadDim] throughpageTable[batchSize, 2, maxPagesPerSeq] (V page ids pre-offset by +numPages); only columns [0, headDim) of each row are read — the tail carries the QSA indexer state.indicesis [batchSize, 1, topK] Int32 (-1 padded).contextLengthsis the TOTAL per-sequence length including the new token.partialO(fp32 [batchSize*numKVHeads*kMaxSplits, kPartialRows, headDim]),partialStats(fp32 [batchSize*numKVHeads*kMaxSplits, 2, kPartialRows]) andsplitCounters(int32 [batchSize*numKVHeads]) live in plugin workspace; counters MUST be zero on entry (the kernel release-resets them, but fresh workspaces start as garbage).Public Members
-
void const *qPtr = {}#
-
void const *kvPoolPtr = {}#
-
int32_t const *pageTable = {}#
-
int32_t const *indices = {}#
-
int32_t const *contextLengths = {}#
-
void *oPtr = {}#
-
float *partialO = {}#
-
float *partialStats = {}#
-
int32_t *splitCounters = {}#
-
int32_t batchSize = {}#
-
int32_t numQHeads = {}#
-
int32_t numKVHeads = {}#
-
int32_t headDim = {}#
-
int32_t poolHeadDim = {}#
-
int32_t numFlatPages = {}#
2 * numPages (both planes)
-
int32_t maxPagesPerSeq = {}#
-
int32_t topK = {}#
-
float attentionScale = {}#
-
cudaStream_t stream = {}#
-
void const *qPtr = {}#