<!-- llms-explorer concept facts · https://llms-explorer.com/tree/ds4-tp-big-gate-bulk-exchange-for-prefill-over-r/ · pack 2026-10-05 · ~574 tokens -->

# ds4 TP big-gate bulk exchange for prefill over RDMA

> The big-gate path needs a batch region of at least 64 slots of 16384 bytes or it is unavailable

Parent: [Mac local LLMs: Clusters, RDMA, exo and ds4](https://llms-explorer.com/tree/mac-local-llms-clusters-rdma-exo-ds4/) · 1 facets · 9 facts · page: https://llms-explorer.com/tree/ds4-tp-big-gate-bulk-exchange-for-prefill-over-r/

## Facts

- The big-gate path needs a batch region of at least 64 slots of 16384 bytes or it is unavailable — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- Each big gate swaps a TCP header (magic, layer, tag 0xB16, sequence) first, with the socket timeout raised by 2000 ms for that exchange — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- Payload chunks move in place when both buffers sit inside the registered slab, otherwise they are copied through the slab's batch regions and the window depth is capped by the staging size — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- Bulk work requests are tagged with bit 63 of `wr_id` and warm-up work requests with bit 62 — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- The verify block arms with a drain, layer-0 receives for all rows and a one-byte barrier tagged 0xB5, then runs gates with no handshake — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- In a verify block, layer L+1's receives are posted before layer L's sends so the peer never sends into an unposted queue — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- `DS4_TP_DISABLE_VERIFY_WINDOW` disables the verify window and `DS4_TP_BIG_GATE_DEBUG` prints handshake and transfer timings every 32 gates — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- The verify block ends only when `layers * rows` receives are consumed and all sends are reaped within the gate timeout — [source](https://raw.githubusercontent.com/antirez/ds4/main/ds4_tp.c)
- The ds4 docs say `--dist-prefill-window N` and `--dist-prefill-chunk N` control in-flight chunks for the layer-pipeline mode and advise keeping defaults first; they are not the TP big-gate depth — [source](https://raw.githubusercontent.com/antirez/ds4/main/docs/DISTRIBUTED.md)
