Repository navigation
Conversation
|
Review: ready. The session key comes from #3041's proof ( Small notes, none blocking:
Host tests:
|
181f288 to
655335a
Compare
bed1a8a to
f9ca20f
Compare
…mpled transition cost Prune inactive DFlash2 sequence rows, skip tap writes when no stream draws a DFlash2 chain (scattering stream means directly via glm_tap_mean_ring without the extra staging copy), and flatten sampled chains across active prefixes on top of PR #3920. Stacked on #3920. Refs #3152
…s, or why it is unknown
… idle manager can take the lock and park on a busy runner
…nner booted under an hour ago still parks
Main 8836b98 keeps cli.zig at 600 lines. The contributor's flag and Args field bring it to 602. Remove two empty separator lines; every non-whitespace source byte is unchanged and both main and witness entries remain in order.
…ord of codes at a time tf_dsv41_route_gate_plan runs the router's matvec, the route and the experts' plan as one launch: groups of 32 columns compute the gate logits (mv.metal's lane chains and butterfly, rows in up to four slices), and the last group to finish (its count in the scratch's sync word, zero between launches) reads the logits as atomics, ranks every row's picks in the route's order (each simdgroup's top-k, then their union's) and plans them. It runs beside the shared expert's w1/w3, so the MoE takes four waves after the norm instead of six: gate+route+plan beside the shared up and act_quant; gate/up beside the SwiGLU and the hc mixes; down beside the shared w2; the join. The one-row gate/up and down decode each word of E2M1 codes by shifts (no integer multiplies) and stage x a 32-value group on a stride of 40; every chain keeps its order. Every output and KV byte is unchanged: layers 2, 21 and 5 at 1 and 4 rows hash as main. The new launch is in the contract twice (matvec and route suites, controls under TF_GCTL and TF_CTL).
…a propose launch in one concurrent encoder With drafts on, the drafter's weights now carry an FP8 copy of the vocabulary head (E4M3 codes, E8M0 scales a 32x32 block, the release's own weight format), quantized from the bf16 head at load in 16 workers (0.2 s, 0.67 GB). The drafter's head runs it on the FP8 rows kernels; the target keeps the bf16 head, so every output token is unchanged and only proposals can move. The propose launch now runs in a concurrent encoder, with a barrier wherever a step reads the one before (wq_a beside the key's wkv, q_norm beside the key's ring write). A new test holds a launch in a concurrent encoder byte-equal to the same launch in a serial one; dropping one barrier makes it fail. M5 Ultra, release checkpoint, five prose prompts, one stream: propose GPU 3.73 -> 3.06 ms a round (FP8 head 3.29, plus the concurrent encoder 3.06); accepted drafts and every reply's hash unchanged.
About 20 ingests a run (of 2,400) waited 40-570 ms between commit and their first GPU instruction, on an idle queue (the target's window had already waited for its own command buffers), while their GPU work took under 1 ms; target command buffers never waited. The drafter's buffers were in no residency set, so macOS let them go between passes and a pass waited while they were made resident again. Pass.init now holds every buffer a pass binds (the drafter's weights and FP8 head, rings, act_quant rows, plan and working buffers, 8 GiB) in one residency set on the engine's queue, released at deinit. M5 Ultra, five prose prompts, one stream: ingest wall 1.9-2.9 -> 0.50 ms mean (GPU 0.26), no waits past 20 ms; greedy 57.1-58.5 -> 59.7-59.9 tok/s, sampled 48.6-49.8 -> 51.6-51.7 tok/s; accepted drafts and every reply's hash unchanged.
…s, wq_b and w2 from 5 rows, narrow ones never The tile's form gave 16 columns only to N of 16384 or more, so wo_b, wo_a's eight groups and the shared w1, w3 and w2 ran 8 columns a threadgroup at 6-16 rows, 30-60% slower than with 16. The form now counts a batch's columns (2048 or more take 16); projections of 2048 or more columns with K not in whole 1024s (wq_b, the index wq_b, w2) take the tile from 5 rows, the others from 6; projections of 1024-2047 columns (wq_a) from 7; and those under 1024 (wkv, the compressor) stay on the row kernel at every row count, where it reads them up to twice as fast. The decode Engram projection takes the tile at the rows it does instead of the row kernel. Every row's bits are the row kernel's, as the tile's contract registrations already prove.
… and read X 8 bytes at a time At 2-6 rows the one-launch row kernel spent its registers on tf_dsv41_w16's sixteen decoded weights a column and on two 16-byte X reads a row, and its time grew with each row. Block e (split 1, two columns a lane) and block f (split 4, four columns a simdgroup) decode one word at a time and read 8 bytes of each row's X where they are used; a lane with a NaN code or a scale past 2^120 takes tf_dsv41_w16's per-code path as before. The chains (k in order from zero), the group butterfly and the tile roots' tree are the whole kernel's, so every output's bits are. Projections with K in whole 1024s and 2048 or more columns take e at 1-5 rows and d above (on cold weights back to back, d was faster than b at 2 rows here too); the others take f at 2-6 rows and b otherwise. The contract gates both blocks (one launch, f32 e and bf16 f) besides the row-invariance probe's every-kind check.
… one line each, as the lean rule asks Four comments (fp8_rows.metal's lean kernel, fp8_rows.zig's Kind, fp8_tile.zig's minRows and the rows contract's Variant) each ran over two lines. The block columns move to their fields and minRows' reasons to its branches; no code changes.
…yer runs, each layer's rows written just before the command buffer that reads it, and the next window's first row's reads start after the picks
…s the list's last, the same list
…d its verify (picks, acceptance, ingest and pass on the GPU) and kept when the host's commit matches; an ingest made before its window's commit is put back where the commit cuts it
…the reply as on Nemotron After a chat reply the server sends a background prompt-only pass over the reply as the next turn's prompt renders it. Flash Next on CUDA did not take it, so every next turn resumed at its history's end and prefilled the reply again. The family now declares warm_quiet, 150 ms as Nemotron's. Its CUDA cache rules then wait for quiet and keep the pass's state one token short of its end, since the MTP head reads one token on. The native CUDA host turns warm turns on when the prompt cache is on and one rank serves. The family keeps and resumes states at any row, so the pass needs no message-start cuts. With --tp the store's warm rule is off and the server sends no pass. The pass gives way to real work. Its whole-prompt prefill asks before each chunk whether to step aside, and when it does it keeps the state it reached. Its chunks take the busy chunk's rows, 1,536 by default, where a one-stream server's solo pass takes 8,192, so a request that arrives waits for at most that many rows. The lane host now also counts another request's prompt that is still filling a chunk a round as work. Before, a pass taken beside one saw no queued request and no decoding stream. It waited out its quiet on the lane thread while that prompt stood still, then ran whole. Warm passes on every host with a fill queue now give way sooner, and replies are unchanged. Requests that are not warm passes take the same path and the same rows as before. Warm states go through the store's budget and eviction like every other mark. Host tests: a warm pass taken while a request's prompt is filling runs no chunk, or yields at its first, and the request finishes. On main's lane host the pass ran whole and the test fails with expected .cancelled, found .length. A Flash Next CUDA warm pass steps aside before its first chunk through the real lane opener, and Flash Next's CUDA cache rules keep warm marks.
…ged, on today's main Skip Flash Next CUDA image warm passes before cache admission edits flashnext/cuda_lanes.zig and its admission test after the earlier re-pin; their gradient-serving rows take the files' sha256 on main 7b2717a. Notes unchanged.
…37 settings, 25 switches)
41177ae added tools/test_ci_workflow_conditions.py, which reads the workflow files with yaml.safe_load. The pytest job's venv installs only pytest, so collection fails with ModuleNotFoundError on every GitHub pytest run.
…tocol byte The TCP links between the ranks of a multi-GPU group took whichever host connected first. Both ends now send a fresh nonce and an HMAC-SHA256 over the nonces, the link, the rank and the group size, on the bootstrap, the liveness lines, the HIP link and the Flash Next pair. A connection that fails is closed and cannot stop the group. Ranks with no key meet on one host only. TF_RANK_SECRET_FILE or --rank-secret names the key file. Later frames are not signed and the links are not encrypted.
… gets 2 s - The key file opens through symbolic links, as secret mounts give it; the type and mode checks still run on the opened file, so a link to a file others can read is refused. - Rank keys need 32 bytes after trailing whitespace. The shared loader takes the minimum from its caller: rank links pass 32 and the stage ring keeps its 16, so every stage ring that starts today keeps starting. - A missing, different or short key's error names serve --rank-secret FILE and a one-line command that makes a key. - Rank 0 logs each refused connection with the peer's address and the reason. - An acceptor waits 2 s for the hello, so a silent connection no longer holds the serial accept for the whole 10 s budget. - The Flash Next CUDA rank device test passes the new secret argument to Link.open.
test-gradient-serving pins the bytes of the maintained serving sources; the train CI for this branch (#3168) stopped at zig/src/cuda/root.zig, but four differ: - zig/src/cuda/root.zig: tp_line.zig's tests are imported. - zig/src/cuda/tp_watch.zig, zig/src/families/flashnext/cuda_rank_engine.zig and cuda_rank_wire.zig: rank connections prove a shared key before their first protocol byte (b83c447). Each row takes its file's new hash, with the change named beside it.
…records The proof showed which process connected, and then the ROCm ranks' command link ran in clear text: a host on the path read rank 0's words and could change them. Both ends now seal every byte after the proof in ChaCha20-Poly1305 records under keys derived from the proof's session key, one for each direction, with the record's place in its direction as the nonce. A record altered, replayed, moved, sent back or sealed under another key does not open, and the link closes. rank_seal.zig holds the record layer for the other rank links to use. The CUDA control links and the NCCL, RCCL and RDMA traffic are still clear.
…nk in sealed records After the proof the Flash Next pair's control link ran in clear text, so a host on the path read the frame headers and the forward frames' token ids and could change them. Both ranks now send every byte after the proof in the rank seal's ChaCha20-Poly1305 records. A record that does not open ends the link. A test's socket pair, on which no proof ran, has no seal and stays clear. The tensor-parallel bootstrap, plan and liveness links and the NCCL traffic are still clear.
…t's key has 32 bytes
…and plan links in sealed records
…d prompt token ids over NCCL
655335a to
89fb2fb
Compare
What this changes
Before: after the key proof the tensor-parallel bootstrap, fate and plan links ran in clear text. A host on the path read the ranks' settings, the NCCL id rank 0 broadcasts, every round plan and every failure reason, and a byte it changed in a plan was taken as sent. After: on a group with a key, every byte the socket helpers move on those connections is a ChaCha20-Poly1305 record under the proof's session key, and a record that does not open closes the link.
SECURITY.mdasks for private reports, so there is no public issue.atc overlap --json: not run.Checks on this head
181f288fcdafed704bdd01f5ff2ec09d0ea54f2fpython3 tools/zig/lean_check.py, on the base and on this head: 345 on the base, 345 on this head, 0 new.zig fmt --checkandgit diff --check: passzig build test-rank-auth-host test-tp test-tp-fate-host: 22/22 steps succeeded; 178/181 tests passed (3 skipped)zig build check-native-cuda-host compile-flashnext-mtp-parity-host compile-glm-native-open: 11/11 steps succeededzig build test-cuda-host: 391/391 steps succeeded; 6261/6303 tests passed (42 skipped)zig build native: 66/66 steps succeededzig build test-golden test-server-security test-pull-security: 76/76 steps succeeded; 34/34 tests passedsecurity: a host on the path reads none of a keyed group's settings, plans or failure reasonssecurity: a byte changed on a keyed group's plan link ends the link, and no plan is taken from itsecurity: a new socket whose number a sealed one had carries its bytes as they arerank seal: a record that arrives a few bytes at a time opens once it is whole, and not beforesecurity: a record altered on its way, or a head no record has, is refused piece by piece toozig build testand every step that runs on a GPU were not run: this Mac's GPU was serving a model, and no CUDA hardware was available.Receipt
--tpgroup and every family that opens the fabric's bootstrap, on a group with a key. A group with no key stays on one host and its bytes are unchanged.TF_RANK_SECRET_FILE.Checklist
sock.sealcalls in the bootstrap switched off, the relay reads the settings, the plan and the failure reason, and a changed plan byte is taken: both relay tests fail.For a change that reaches inference:
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Not measured: no served run.Notes for the reviewer
sock.zig's helpers, keyed by the socket. The bootstrap adds a connection's seal right after its proof, so the hello, the blobs, the fate frames, the plans and the DeepSeek session words that use the plan socket all cross sealed with no change in their callers.planlink.zignow sends its length throughsock.sendMoreinstead of its ownsend.sock.acceptandsock.connectdrop any seal listed under a new socket's number, so a number that is reused never inherits one.tcp-host, the test tool that moves tensors on the plan socket with its own reads and writes, now refuses to run on a keyed group.Suggested changelog line
Tensor parallelism: on a group with a key, every byte after the key proof crosses the bootstrap, fate and plan links in sealed records.