Archived
the four-rank sparse decode takes its fused gate row too
--debug-graph on the real container at --tp 4 was red on exactly one op: thirteen device bands, all of them attn_paged_gate_quant, refused with 'gqa == 12, have 6'. The row table registered the fused sparse-decode leg only at the two-rank ratio, so at four ranks the block declared a fused op nothing served. That was my reading of v1, and it was wrong in a way that is not neutral: the block declares the fused op beside the unfused pair EITHER way, so an unregistered geometry is not a quiet fallback, it is a device hole -- a band a request can land in whose step then fails at issue rather than at declare. The kernel already exists. r4d_attn_paged_gqa8.hip pastes the _gq entry points onto R4D_ATTN_GQA, so the gqa6-bs4 unit has exported them since it was written; the build's libr4d.so has r4d_rad_attn_decode_gq_h256_gqa6_fp8 and _bf16 in its symbol table. Unlike all_gather, this leg needed a row registered, not a kernel written. q_len <= 10 rather than <= 5 is the same q_len*gqa <= 64 at six queries a position; the verify bound moves with the ratio and nothing else. TP2 cannot regress: the rows carry C_EQ(gqa, 6) against a world-2 query that carries 12.
This commit is contained in:
1 parent
8f795c1022
commit
146318894d
2 files changed
+54
-4
No files matched your search
+45
-4
@@ -2215,10 +2215,12 @@ static const RadConstraint cAttnDecodeGqH256G12Bf16[] = {
|
||||
* seven positions -- which gqa12 hands to the prefill kernel -- is a decode launch here. The page
|
||||
* stays 4 because it is the model's indexer's block size, not a consequence of the parallelism.
|
||||
*
|
||||
* NO `attn_paged_gate_quant` ROW AT THIS GEOMETRY. The body instantiates the `_gq` entry points at
|
||||
* every ratio, but v1 of this port registers none of them as a row, so the sparse path's gate and
|
||||
* quantiser resolve to the standalone pair declared beside the probe. That is the design, not an
|
||||
* omission. */
|
||||
* THE `attn_paged_gate_quant` ROWS ARE HERE TOO (see attn_decode_gq_h256_gqa6_fp8kv). Registering
|
||||
* them costs nothing the plain legs don't already pay -- the body instantiates the `_gq` entry
|
||||
* points at EVERY ratio, so this leg needs a row and not a kernel -- and NOT registering them is
|
||||
* not neutral: the block declares the fused op beside its unfused pair either way, so an
|
||||
* unregistered geometry is a device band with nothing behind it, reported as a hole a request can
|
||||
* fall into. The unfused pair still runs whenever the fused row does not resolve, unchanged. */
|
||||
static const RadConstraint cAttnPrefillH256G6Bs4Fp8[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 6), C_EQ("block_size", 4),
|
||||
C_EQ("causal", 1), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "fp8_e4m3"),
|
||||
@@ -2235,6 +2237,18 @@ static const RadConstraint cAttnDecodeH256G6Bs4Bf16[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 6), C_EQ("block_size", 4),
|
||||
C_GE("causal", 0), C_LE("q_len", 10), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "bf16"),
|
||||
};
|
||||
/* The gate and the quantiser as the merge's epilogue, at the four-rank ratio: the gqa12 pair's
|
||||
* constraints with the ratio and the verify width moved together (`q_len <= 10`, not `<= 5`). */
|
||||
static const RadConstraint cAttnDecodeGqH256G6Bs4Fp8[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 6), C_EQ("block_size", 4),
|
||||
C_GE("causal", 0), C_LE("q_len", 10), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "fp8_e4m3"),
|
||||
C_EQ("group", 128), C_IN("act", "sigmoid"),
|
||||
};
|
||||
static const RadConstraint cAttnDecodeGqH256G6Bs4Bf16[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 256), C_EQ("gqa", 6), C_EQ("block_size", 4),
|
||||
C_GE("causal", 0), C_LE("q_len", 10), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "bf16"),
|
||||
C_EQ("group", 128), C_IN("act", "sigmoid"),
|
||||
};
|
||||
static const RadConstraint cAttnPrefillH128G8Fp8[] = {
|
||||
C_EQ("window", 0), C_EQ("head_dim", 128), C_EQ("gqa", 8), C_EQ("block_size", 16),
|
||||
C_EQ("causal", 1), C_IN("q_dtype", "bf16"), C_IN("kv_dtype", "fp8_e4m3"),
|
||||
@@ -3609,6 +3623,33 @@ static const RadKernelInfo kKernels[] = {
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged, nullptr, nullptr, r4d_rad_attn_decode_h256_gqa6_bf16_describe },
|
||||
|
||||
/* The TP4 leg's sparse decode WITH the gate and the quantiser in the merge, as the gqa12 pair
|
||||
* above. Two launches where the unfused path is three, once a layer, at the shape TP4 serves every
|
||||
* decode step of this model. */
|
||||
{ "attn_decode_gq_h256_gqa6_bs4_fp8kv", "attn_paged_gate_quant", "attn",
|
||||
"paged split-KV decode attention with the output gate and the fp8 quantiser in the merge",
|
||||
"attn_decode_h256_gqa6_bs4_fp8kv's geometry; gate_quant_fp8 over the merged (token, head) rows: "
|
||||
"sigmoid only, group 128, the gate 16-byte aligned with a pitch of 8, the codes 8-byte aligned",
|
||||
"bf16 query, fp8-e4m3 kv cache, bf16 gated out, E4M3 codes with an f32 scale per 128 columns",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_DECODE,
|
||||
ROW(cAttnDecodeGqH256G6Bs4Fp8), ROW(tAttnSplit), nullptr,
|
||||
nullptr, nullptr, r4d_rad_attn_decode_gq_h256_gqa6_fp8, r4d_rad_attn_decode_h256_gqa6_scratch,
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged_gate_quant, nullptr, r4d_fuse_attn_paged_gate_quant,
|
||||
r4d_rad_attn_decode_gq_h256_gqa6_fp8_describe },
|
||||
|
||||
{ "attn_decode_gq_h256_gqa6_bs4_bf16kv", "attn_paged_gate_quant", "attn",
|
||||
"paged split-KV decode attention with the output gate and the fp8 quantiser in the merge",
|
||||
"attn_decode_h256_gqa6_bs4_bf16kv's geometry; gate_quant_fp8 over the merged (token, head) rows: "
|
||||
"sigmoid only, group 128, the gate 16-byte aligned with a pitch of 8, the codes 8-byte aligned",
|
||||
"bf16 query, bf16 kv cache, bf16 gated out, E4M3 codes with an f32 scale per 128 columns",
|
||||
RAD_DOMAIN_DEVICE, R4D_PRIO_ATTN_DECODE,
|
||||
ROW(cAttnDecodeGqH256G6Bs4Bf16), ROW(tAttnSplit), nullptr,
|
||||
nullptr, nullptr, r4d_rad_attn_decode_gq_h256_gqa6_bf16, r4d_rad_attn_decode_h256_gqa6_scratch,
|
||||
nullptr, nullptr,
|
||||
r4d_shape_attn_paged_gate_quant, nullptr, r4d_fuse_attn_paged_gate_quant,
|
||||
r4d_rad_attn_decode_gq_h256_gqa6_bf16_describe },
|
||||
|
||||
{ "attn_prefill_h128_gqa8_fp8kv", "attn_paged", "attn",
|
||||
"paged causal attention, query-tiled (prefill / chunked prefill)",
|
||||
"head_dim 128, 8 queries per kv head, paged block 16, varlen",
|
||||
|
||||
Reference in new issue
Block a user