| ILP | TLP | DLP | |
|---|---|---|---|
| Easiest to program | ✅ sequential code | ❌ explicit sync, races | ✅ for regular arrays |
| Most flexible | ✅ unrelated/irregular programs | ||
| Most efficient (tasks/s/area, energy/task) | ✅ one fetch drives many units |
Weaving: the warp is the parallel threads in lockstep; the weft is the instruction sequence across them.
void daxpy(int n, double a,
double *x, double *y) {
for (int i = 0; i < n; i++)
y[i] = a * x[i] + y[i];
}
// host
int nblocks = (n + 255) / 256;
daxpy<<<nblocks, 256>>>(n, 2.0, x, y);
// device: run by every µthread
__device__
void daxpy(int n, double a,
double *x, double *y) {
int i = blockIdx.x * blockDim.x
+ threadIdx.x;
if (i < n) y[i] = a * x[i] + y[i];
}
i < n: 24 threads turned offUR, computed once per warp (S2UR, LDCU, UIADD3 in SASS)Costs of the SIMT illusion
i and checks i < n| Level | Scope |
|---|---|
| Private local memory | Per thread (spills, private stack) |
| Shared memory | Per block: fast on-chip scratchpad for cooperation |
| Global memory | Per application: off-chip DRAM, all blocks |
threadIdx → coalescingDAXPY in PTX (parameter loads trimmed):
mad.lo.s32 %r1, %r3, %r4, %r5; // i = blockIdx.x*blockDim.x + tid setp.ge.s32 %p1, %r1, %r2; // i >= n ? @%p1 bra $L__BB0_2; mul.wide.s32 %rd5, %r1, 8; // byte offset ld.global.f64 %fd2, [%rd6]; // x[i] ld.global.f64 %fd3, [%rd7]; // y[i] fma.rn.f64 %fd4, %fd1, %fd2, %fd3; // a*x[i] + y[i] st.global.f64 [%rd7], %fd4; $L__BB0_2: ret;
if (X[i] != 0) X[i] = X[i] - Y[i]; else X[i] = Z[i];
BSSY opens barrier B1 and names the rejoin addressBSYNC B1: threads meet, then run shared code together// PTX setp.eq.f64 %p2, %fd1, 0d0000000000000000; @%p2 bra $L__BB1_3; // else path ld.global.f64 %fd3, [%rd12]; // then: Y[i] sub.f64 %fd4, %fd1, %fd3; st.global.f64 [%rd1], %fd4; bra.uni $L__BB1_4; $L__BB1_3: ld.global.f64 %fd2, [%rd9]; // else: Z[i] st.global.f64 [%rd1], %fd2; $L__BB1_4: ret;
// SASS, with shared work after the if-else BSSY.RECONVERGENT B1, 0x1b70 // open B1 DSETP.NEU.AND P0, PT, R24, RZ, PT @P0 BRA 0xe40 // split ... // both paths BSYNC.RECONVERGENT B1 // rejoin STG.E.64 desc[UR6][R6.64], R24 // whole warp
| Resource | B300 |
|---|---|
| Compute capability | 10.3 (sm_103) |
| SMs | 148 |
| Registers per SM | 65,536 × 32b (256 KB) |
| Threads per SM | 2,048 (64 warps), ≤ 32 blocks |
| Threads per block | 1,024 |
| Shared memory per SM | 228 KiB (227 KiB per block) |
| L2 | 126.5 MiB |
| HBM | ~268 GiB, 7,680-bit interface |
| Max SM clock / power | 2,032 MHz / 1,100 W |
tcgen05 PTX instructionstcgen05.mma.cta_group.kind [d_tmem], a_desc, b_desc, idesc, …
tcgen05.alloc (32–512 columns, power of 2); moved with tcgen05.ld / tcgen05.cpcta_group::1 one block, or cta_group::2: a pair of blocks on two SMs shares one larger tilef16, tf32, f8f6f4, block-scaled mxf8f6f4, mxf4, mxf4nvf4; no i8 (B200 has it)BSYNC.RECONVERGENT B1, closing the barrier opened by BSSY.RECONVERGENT B1.