Skip to content

feat: shard rollout-bound route trace payloads - #62

Draft
0z5a wants to merge 3 commits into
ViperEkura:mainfrom
0z5a:codex/draft-rollout-route-sharded-transport
Draft

0z5a wants to merge 3 commits into
ViperEkura:mainfrom
0z5a:codex/draft-rollout-route-sharded-transport

Conversation

@0z5a

@0z5a 0z5a commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Depends on #63 (rollout identity), transitively #64 (RouteTraceV0).

Exact-head confirmation (2026-09-05)

python -m pytest -p no:cacheprovider -q tests/ at
953c7714ecb5ee3526193bf5fcf2112e74514777: 757 passed, 57 skipped in 63.65s, container exit 0.
This final run retained its log independently of SSH connectivity. It used
the CPU-only environment described below; GPU tests remain skipped.

Add deterministic bounded byte shards for rollout-bound RouteTrace artifacts,
authenticate shards/items, validate assigned subsets, and reconstruct the exact
batch. Bound manifest/shard/item/total sizes and reject malformed, noncanonical,
corrupted, missing/reordered, cross-batch and trailing data.

Rank assignment is generic round-robin. Actual distributed tests use 2 or 4
ranks only. No network selection, model capture, replay, admission policy or
default training behavior changes are included.

Revision and dependency

  • Base: main e1e533c88e74efab4f379d6ccbc830c2b3e698e2.
  • Head/review increment: 953c7714ecb5ee3526193bf5fcf2112e74514777.
  • Depends on rollout identity bea9ecf71f623d7b78aa2baed59646be871af19c
    (codex/draft-rollout-route-identity), which depends on RouteTraceV0.
    Review the increment after those dependencies; main-based diff includes them.
  • No open PR provides this bounded route transport framing/verification layer.

Validation

  • python -m pytest -p no:cacheprovider -q tests/trainer/test_rollout_route_trace.py tests/trainer/test_rollout_route_transport_benchmark.py: 19 passed at 7d54a9ac100341febf90c2bc5b4d1020005234e4, including CPU Gloo 2/4 ranks.
  • Latest main replay has an identical Python tree; changed-file Ruff 0.14.7
    import/format and git diff --check passed.
  • Original pre-rebase full suite: 747 passed, 50 skipped (historical only).
  • Fresh exact-head full-suite confirmation is recorded below when available.
    Initial collection lacked httpx2; a retry lost SSH before returning a final
    result. Neither is counted as a successful full run.

CPU image astrai-test:cu128, Python 3.12.3, torch 2.11.0+cu128, pytest 8.3.5.
No GPUs exposed; httpx2 2.12.0 added only in the disposable test container.

Historical benchmark (pre-rebase)

CPU framing only, L20 host: IDs B=8 G=8 P=512 R=1024 L=40 K=22 E=512,
2 MiB / 8-item caps: 115,434,944 -> 115,472,769 bytes (+0.032767%), 64 shards;
build median 244,604 us, verify-all 1,153,011 us, reconstruct 1,143,879 us.
These numbers exclude actual networking and training throughput.

Review status

AI assistance was used. Keep Draft for human line-by-line review, dependency
review and CI; no fresh GPU or end-to-end performance claim is made.

0z5a added 3 commits September 5, 2026 22:19
- bind policy, model, router, checkpoint, token, and kernel semantics
- encode compact IDs in a checksummed fail-closed safetensors artifact
- add pure route-drift diagnostics and a codec-only benchmark
- keep capture, transport, replay, admission, and training unchanged

Benchmark: NVIDIA L20, PyTorch 2.11.0+cu128, codec-only synthetic 8192x40x22 trace, 512 experts, median of 50 after 5 warmups
- ID storage: 57671680 -> 14417920 bytes (0.250x, -75.0%)
- freeze a per-response trace grid behind exact token and behavior identities
- reject policy, ordering, padding, boundary, and cache mutations
- preserve the existing rollout path when trace artifacts are absent
- add deterministic binding and validation benchmarks

Benchmark: NVIDIA L20, PyTorch 2.11.0+cu128, synthetic B=2 G=2 P=512 R=1024 L=40 K=22 E=512, median of 5 binds and 50 validations after 5 warmups
- CPU IDs: 7.215 MB artifact, 83.732 ms/bind, 0.871 ms/validation
- GPU-resident IDs+weights+margin: 14.753 MB artifact, 103.433 ms/bind, 1.206 ms/validation
- split bound rollout artifacts into deterministic authenticated frames
- enforce byte, item, manifest, and total receive limits
- reject corrupt, incomplete, reordered, and cross-batch shard sets
- assign shards generically with real two- and four-rank Gloo coverage

Benchmark: CPU, PyTorch 2.11.0+cu128, synthetic B=8 G=8 P=512 R=1024 L=40 K=22 E=512 IDs, median of 3 after 1 warmup
- 115434944 payload -> 115472769 transport bytes (+0.0328%)
- build: 244604 us median; verify all: 1153011 us median
- reconstruction: 1143879 us median; 64 shards at 2 MiB cap
@ViperEkura
ViperEkura force-pushed the main branch 2 times, most recently from e7237f6 to 093c57e Compare September 8, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant