Repository navigation
feat: Split pool sample forecasts across all endpoints and drop the single-request utilization stage - #20
Merged
Conversation
…ingle-request utilization stage
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.
Summary
With
JOINTFM_DEPLOYMENT_IDS,forecast_samples(...)now splits every sample request evenly across all reachable endpoints, whatever its size. Before, it split only requests larger than the smallest endpoint'smax_sample_count. Each endpoint still serves at most one of the client's batches at a time, which leaves its remaining request slots free for other callers.The maximum-utilization check loses its
single_requeststage. A pool forecast is now always split, so that stage could no longer send one maximal request. The check now runs onlyconcurrent_saturation, which still fills every advertised slot on every endpoint.Why
The response download, not the GPU, takes most of a hosted sample request's time. Measured on 2026-10-06 against a 4-endpoint pool (
max_sample_count5000 andmax_concurrent_requests2 per endpoint, 732-step history, 92-step horizon), as median wall time:One HTTP stream downloaded at about 4 MB/s, and concurrent streams from separate endpoints overlap up to about 10 MB/s in total. Before this change, a 5,000-sample request went to a single endpoint.
Changes
JointFMClient._sample_batch_sizes): the batch count ismax(ceil(n / cap), min(n, routable endpoints)), and samples are split evenly across the batches. No batch exceeds the cap, every routable endpoint gets a batch, and none is empty (n_samples=1stays one request). A single endpoint splits only above its cap, as before, but now into even batches instead of cap-sized ones.single_requeststage and the pool-failover recording. Failover cannot happen any more, because the saturation burst sends through per-endpoint clients.concurrent_saturationis always present and also runs for a single-slot deployment.docs/api-reference.mdandnotebooks/max_utilization.ipynbare updated.Breaking changes
UtilizationStage.failovers,MaxUtilizationReport.single_requestandMaxUtilizationReport.stages.MaxUtilizationReport.concurrent_saturationis no longerOptional.run_max_utilization_checkno longer requires thejointfm_client.poollogger to emit WARNING records.iusesseed + iand the batch layout changed. The result now also depends on how many endpoints are reachable.Testing
task pre-commitpasses: ruff, ty, typos, nbstripout, and the test suite with coverage.n=3becomes[2, 1]with seeds 7 and 8;n=1stays one request), and 6 concurrent batches on 2 peers never overlap on one peer.Note
Medium Risk
Changes default multi-endpoint sample-forecast routing and reproducibility, with breaking changes to the max-utilization report API; behavior is covered by new tests but affects production forecast outputs for pool users.
Overview
With
JOINTFM_DEPLOYMENT_IDS,forecast_samples(...)now splits every sample request evenly across all routable peers, not only whenn_samplesexceedsmax_sample_count. Batch count ismax(ceil(n / cap), min(n, peer_count)), with batchiusing seedseed + i, so seeded pool results change and depend on how many endpoints are reachable. Each peer still handles at most one of this client's batches at a time (extra batches queue on the per-peer POST lock).run_max_utilization_checkdrops thesingle_requeststage and pool-failover tracking: it only runsconcurrent_saturation, filling every advertised slot viaendpoint_client, so the check is not distorted by automatic sample splitting. Breaking: removedUtilizationStage.failovers,MaxUtilizationReport.single_request, andstages;concurrent_saturationis always present. Docs, notebooks, and tests are updated accordingly.Reviewed by Cursor Bugbot for commit 340abeb. Configure here.