Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/docs/numeric/GPU_CHANNELS.md # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / docs / numeric / GPU_CHANNELS.md` 60 lines · 4204 bytes Raw Blame History Rendered 1 # GPU channels: more than one command queue (L136, roadblock R3, OSC-0 decision 12) 2 3 Written before the measurement. The receipt goes in `evidence/q38-channels-*`. 4 5 ## What a channel is 6 7 A channel is one command queue into the GPU: a ring of work entries plus a doorbell. Until now the engine opened one 8 (`src/omega_gpu_platform_linux.c`, `max_queues = 1`), so every job from every caller waited in one line. 9 10 Cost of a second channel (physics `doc/driver-floor` DRIVER_FLOOR.md): one more BLACKWELL_CHANNEL_GPFIFO_A and 11 BLACKWELL_COMPUTE_B in the same KEPLER_CHANNEL_GROUP_A and FERMI_CONTEXT_SHARE_A, one UVM_REGISTER_CHANNEL, one 12 GET_WORK_SUBMIT_TOKEN, all before the single GPFIFO_SCHEDULE. That is setup, paid once at device open. A submission 13 after that is two stores (ring entry, doorbell), the same as channel 0. Physics `feat/gpu-channels` `7476de7` adds this as 14 `nvrm_channel_n`; the platform opens it only when `AIEN_OMEGA_GPU_CHANNELS` is 2..4. Unset, the code path is the 15 single channel exactly. 16 17 ## The arithmetic for one decode token of the 27B (Qwen3.8-27B, FP8 weights, bf16 head) 18 19 - Weights read per token: 26.9 GB. At the memory ceiling of 273 GB/s that is 10.15 tok/s (calc:`41e5e25b`). 20 - The token is a chain: each layer needs the previous layer's output, so layer N+1's weights cannot be "loaded early". 21 On this machine the weights are not copied anywhere before use; the multiply kernel reads them straight from memory. 22 Reading them IS the work. The L2 cache (tens of MB) is far smaller than one layer (~380 MB), so there is nothing to 23 prefetch into. 24 - Timeline receipt `evidence/q38-decode-speed-chip-20261019T0316Z` (4 layers + head): the weight multiplies take 25 18584 of 18866 us; everything else (norms, attention, GDN step, gaps between launches) is 1.49% (calc:`b581cb99`). 26 - The one independent pair inside a token (the small a|b multiply beside the big mix multiply in GDN layers) already 27 runs side by side on ONE channel (`omega_gpu_cmdlist_mark_independent`, `AIEN_OMEGA_Q38_OVERLAP_AB`, default on). 28 The brief's fallback (overlap by reordering on one channel) therefore already exists and is installed. 29 30 So splitting one token across two channels can win at most ~1.5% for one request, minus the cost of the fences that 31 order the two queues. Not worth building first. 32 33 ## Where a second channel could help: two requests at once 34 35 Each weight multiply reaches 193 to 229 GB/s of the 273 GB/s ceiling (same receipt). If a single multiply is limited by 36 how many memory reads one grid keeps in flight, two grids from two requests running at the same time could pull more 37 together. Ceiling of that gain: 273 / 220 = 1.24x aggregate tokens per second (calc:`91c5deff`). Requests do not share 38 weight reads this way; each still reads all 26.9 GB. 39 40 Unknowns, said out loud: 41 1. Whether the GPU runs work from two channels of one channel group at the same time, or takes turns (time slicing). 42 The CUDA guide says separate queues remove false dependencies but "concurrent execution of independent GPU work is 43 not guaranteed". DOCS SILENT on GB10 specifics. 44 2. Whether a WAIT_FOR_IDLE on channel 0 (every dependent launch has one) also waits for channel 1's grids. If it does, 45 the two streams serialise at every barrier. 46 47 ## Prediction (before the measurement) 48 49 Two independent 27B decode streams, 64 layers, 64 steps: 50 - serial (both on channel 0, one after the other): about 2 x 123 ms per step (one stream decodes at 8.13 tok/s on 51 branch qwen38/decode-speed), so ~8.1 tok/s aggregate, the same as one stream. 52 - paired (one per channel, both in flight): between 1.00x and 1.10x of serial throughput. Most likely ~1.0x: each 53 multiply already pulls ~80% of the bandwidth, and unknown 2 may serialise them anyway. 54 - Outputs bit-identical between serial and paired (the streams share only read-only weights). 55 56 ## The bigger lever, for later 57 58 Batching: two requests multiply against the SAME weight read (a matrix times two vectors instead of one). That halves 59 the bytes per token for two requests, ceiling 2x aggregate, and needs a kernel change (GEMV to a thin GEMM), not a 60 channel change. It is the next step for throughput regardless of what the channel receipt says.