Repository navigation
Experiment (not for merge): forward compressed training requests to the engine - #155
Closed
micahtyong wants to merge 4 commits into
Closed
micahtyong wants to merge 4 commits into
micahtyong wants to merge 4 commits into
Conversation
The frontend server set only a routing region, so Modal could start its containers in any region. Each training request makes several Modal Dict and function-call round trips and an engine call, so a frontend on another continent added seconds per training step. Run it in the configured region, or us-east when none is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Forward requests used the JSON executor path: the engine serialized every token and label to JSON for the backend, and the result came back as JSON through the engine and frontend before being re-encoded as protobuf. Route them through the same binary batch transport and protobuf results as forward_backward, and batch queued forward requests together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Densify CSR tensors and reshape labels with numpy instead of per-element Python loops, and pause cyclic GC while the nested label rows are built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frontend decompressed each zstd forward_backward body to read its model id and then sent the uncompressed bytes to the engine, about 7x more data on the frontend-to-engine hop. Send the client's compressed body instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
micahtyong
force-pushed
the
micah/perf-4b/O2-vectorize-rows
branch
8 times, most recently
from
October 28, 2026 21:57
011c7f0 to
8a31b44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experiment (not for merge).
Summary
The frontend decompresses each zstd
forward_backwardbody so it can read the model id, then sends the uncompressed bytes on to the engine. For 128 examples with [seq, 5] labels that is 4.2 MB instead of 0.6 MB. This change sends the client's compressed body and lets the engine decompress it.It made no measurable difference with the frontend and trainer in the same region, so it is kept as a draft. It may help when a trainer runs in a different region from the frontend.
E2E results
Same setup as #152; 16 steady steps.
Before WandB / After WandB
forward_backwardsubmit🤖 Generated with Claude Code