Token-lane block for the RDNA4 native-FP8 layers: enc1, dec1 and the enc3 tube

swin_tok.h passes the weights as the first WMMA operand and the activations as the second, so each GEMM's encoded result is already the next one's operand and stays in registers (swin_block.h transposes every result through LDS). One wave owns one 4x4 window for the whole block: norms, attention and the MLP need no LDS and no barriers; only the patch expand and the patch merge go through an e4m3 image in LDS. Outputs are bit-identical to swin_block.h (swapped WMMA operand roles, verified on an RX 9070 XT and on recorded launches). mix2 rounds in place (accumulator is addend and destination, no copy per pair). -DSWIN_NO_TOKEN_LANES builds these layers from swin_block.h again; enc2 and dec2 are unchanged. RX 9070 XT accuracy set, 2560x1440 render: whole evaluation 8.56 -> 7.18 ms.
This commit is contained in:
woutermans committed 2026-10-06 22:10:41 +02:00
1 parent 7c60d53cd0
commit a7d565d1cd
7 files changed
+730

No files matched your search

+8
View File
@@ -1124,3 +1124,11 @@ template <int S> __device__ __forceinline__ int prep_slot_claim(uint64_t* keys,
__syncthreads(); \
} \
}
// RDNA4 native FP8: a module that defines SWIN_TOKEN_LANES is built from the token-lane block instead
// (swin_tok.h: one wave per window, transposed GEMMs, results stay in registers)
#if defined(SWIN_A8) && defined(SWIN_TOKEN_LANES)
#include "swin_tok.h"
#undef SWIN_MODULE_W
#define SWIN_MODULE_W(NAME, C, NH, NWAVES, NPM, TUBE, PARAMS, CIN) SWIN_TOK_MODULE(NAME, C, NH, NPM, TUBE, PARAMS, CIN)
#endif