DeepSeek engine (AMD): a staging ring sized from the VRAM room, and expert-tile knobs for the MarLin work
The prompt path streams the experts the cards cannot hold. ring_mb_auto() gave 16 MB whenever the cards held >= 1/1.3 of the experts, which is exactly this 2.25 bpw cell (126.8 GB of room, 156.3 GB of experts, share 0.769): the stream then had no depth and the expert tiles waited 1.7 s inside a 5.2 s stage. A share of the VRAM room (5%, 400-2000 MB) when any expert spills, 16 MB when they all fit (the 0.2.6 rule, kept for the decode it was chosen for). Measured, 4x R9700, 2.25 plain pack, 6 experts, --dspark off, 8192-token code prompt, ids 5705e1164a: 8K warm 632 -> 675-678 ppts (+6.8%, 5 prompts a run, 3 runs), agent decode 35.9 -> 35.3 tok/s (-1.7%, 4 runs). The profile of the warm pass: expert stage 5185 -> 4034 ms (kernels 3509 -> 2645 ms, the same kernels now that the weights arrive in VRAM ahead of them, waits 1676 -> 1389 ms), everything else equal. Also in this commit (opt-in, defaults byte-identical except the F16 activation path which is bit-identical): - SetArgs::x16: gate/up take the layer's F16 copy of the activations (rows_f16 rounds exactly as the tile's own smem store did) - half the activation bytes, 26% faster gate/up in the standalone bench (box/expert_bench.cpp), +0.3% at the pass level (the stage is stream-bound). - HIPK_CFG 6..11: tile variants for the expert GEMMs (64x128, 32x128, 128x256, 64x128/4 waves, 128/128+down 256, 64x256). 64x128 (cfg 6) is 21% faster than 128x128 in the bench and +0.9% in the pass. - HIPK_DBG 1/2/3: switch the MMA / the decode off in the tiles (the breakdown in 09-marlin-kernel-diary.md). - ds4_iq_hip.inc: a UTF-8 BOM on a source file removed.
This commit is contained in:
1 parent
219beb5736
commit
1e72cdc4b9
6 files changed
+65
-12
No files matched your search
@@ -154,6 +154,10 @@ struct SetArgs {
|
||||
int max_rows = 0; // the most rows one expert of the set has
|
||||
int n_embd = 4096, n_ff = 2048;
|
||||
float limit = 0.0f;
|
||||
// gate / up: the caller's F16 copy of the activations (row_idx picks the rows). The tiles round F32 to F16 for
|
||||
// their shared-memory tile anyway, so the same values come out; this only saves the F32 read of the same rows by
|
||||
// every column block of an expert (18-36 reads of 1.8-3.7 MB on a prompt) - MarLin's "small operand cheap".
|
||||
const uint16_t* x16 = nullptr;
|
||||
};
|
||||
/// h[local row] = FP16 clamped swiglu of gate and up over x[row_idx[local row]] (F32 rows, ldx floats apart).
|
||||
void set_gate_up(const SetArgs& a, const float* x, int ldx, const int* row_idx, uint16_t* h16, int ldh, cudaStream_t s);
|
||||
|
||||
Reference in new issue
Block a user