Skip to content

feat: bind route traces to rollout identity - #63

Draft
0z5a wants to merge 2 commits into
ViperEkura:mainfrom
0z5a:codex/draft-rollout-route-identity
Draft

0z5a wants to merge 2 commits into
ViperEkura:mainfrom
0z5a:codex/draft-rollout-route-identity

Conversation

@0z5a

@0z5a 0z5a commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Depends on #64 (RouteTraceV0).

Exact-head confirmation (2026-09-05)

python -m pytest -p no:cacheprovider -q tests/ at
bea9ecf71f623d7b78aa2baed59646be871af19c: 749 passed, 57 skipped in 54.96s, 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.

Bind an immutable per-response RouteTraceV0 grid to the exact rollout policy,
tokens, masks, behavior logprobs, token boundaries and response order. Validate
bindings at scoring/cache boundaries and fail closed on mutation or mismatch.
RawRollout.route_trace_batch=None preserves existing behavior.

No model route capture, replay, dispatch, reward/objective or admission change
is included. This is attribution validation, not a transport implementation.

Revision and dependency

Validation

  • python -m pytest -p no:cacheprovider -q tests/moe tests/trainer/test_rollout_route_trace.py tests/trainer/test_rollout_route_trace_benchmark.py tests/trainer/test_rollout.py: 88 passed on replay head bcfcaaade7d46abddba20c5b8b9ab33d326f62c0.
  • Latest main replay has an identical Python tree; changed-file Ruff 0.14.7
    import/format and git diff --check passed.
  • Historical original full suite: 739 passed, 50 skipped (not current-head evidence).
  • Fresh full-suite confirmation is recorded below when available. An initial
    attempt failed collection because the image lacked httpx2; after installing
    it another SSH connection expired before returning a final result, so that
    attempt is not reported as passing.

CPU image astrai-test:cu128, Python 3.12.3, torch 2.11.0+cu128, pytest 8.3.5.
No GPU was exposed. httpx2 2.12.0 is a disposable-container test dependency.

Historical benchmark (pre-rebase)

Synthetic B=2 G=2 P=512 R=1024 L=40 K=22 E=512 on L20 host:
CPU IDs 7.215 MB, 83.732 ms/bind and 0.871 ms/validation median;
GPU rich routes 14.753 MB, 103.433 and 1.206 ms. This starts from materialized
routes and excludes generation, transport, replay, scoring and training.

Review status

AI assistance was used. Keep Draft for human line-by-line review, dependency
review and CI. No current-head GPU or training-throughput claim is made.

0z5a added 2 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
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