summaryrefslogtreecommitdiffstats
path: root/tools/cuda-ab/transformer_mt.cu
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-18 15:03:17 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-18 15:03:17 -0400
commite398de4cf68ffd0f43e0b1692b08b2726457fad4 (patch)
tree6f6f247d01c17523a05ed9e36ea3d650ba580305 /tools/cuda-ab/transformer_mt.cu
parent5df50190fad0fb57174acd30c89dc090c037f315 (diff)
downloadopen-iov-e398de4cf68ffd0f43e0b1692b08b2726457fad4.tar.gz
open-iov-e398de4cf68ffd0f43e0b1692b08b2726457fad4.zip
cuda-ab: ctaid_probe (CTA-coordinate + A-row reader) + GEO geometry print in transformer_mt
The vGPU GR engine's failing chains are correct for the by=0 band and replicate one tile for rows >= 16 with the QMD geometry and the input recs proven clean, so the remaining hypothesis is engine-side CTA-coordinate behaviour. ctaid_probe reads it directly in two phases on the exact (16,4,1)/(16,16,1) geometry: Phase 1 coord_map writes by*10000+bx*100+ty*10+tx per element (int32 64x256) and reports per-band row0 plus a bad count - a collapsed or wrong CTAID.Y shows instantly. Phase 2 arow_read writes A[(by*16+ty)*256+(bx*16+tx)] with A[i]=i, so a correct engine reads each band's own rows; a collapsed row register reads one band's rows everywhere. transformer_mt prints its per-chain geometry (GEO lines) for the host-side GRID-WIT comparison. Runtime <10 s. Built with nvcc -O2 --cudart=static -arch=sm_75 (deterministic static runtime).
Diffstat (limited to 'tools/cuda-ab/transformer_mt.cu')
-rw-r--r--tools/cuda-ab/transformer_mt.cu8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/cuda-ab/transformer_mt.cu b/tools/cuda-ab/transformer_mt.cu
index ffd23aa..5cfe55e 100644
--- a/tools/cuda-ab/transformer_mt.cu
+++ b/tools/cuda-ab/transformer_mt.cu
@@ -142,6 +142,14 @@ static void launch_chain(cudaStream_t st, const float *x, struct attn_bufs b,
dim3 g1(DH / TILE, SEQ / TILE);
dim3 g2(SEQ / TILE, SEQ / TILE);
dim3 tb(TILE, TILE);
+ static int chain_n;
+
+ /* r226 GRID-WIT: the exact geometry every chain launch uses, so the
+ * host-side QMD geometry capture (GRID-WIT in vgsp) can be compared
+ * against what the client actually launched. Chains 0..2 are the
+ * multi-stream class, 3..7 the 5-launch loop. */
+ printf("GEO chain=%d gemm_nn grid=(%u,%u,1) block=(%u,%u,1) gemm_nt grid=(%u,%u,1) softmax grid=(64,1,1) block=(64,1,1)\n",
+ chain_n++, g1.x, g1.y, tb.x, tb.y, g2.x, g2.y);
gemm_nn<<<g1, tb, 0, st>>>(x, wq, b.q, SEQ, DH, DH);
gemm_nn<<<g1, tb, 0, st>>>(x, wk, b.k, SEQ, DH, DH);