Issue files (.scratch/issues/20-29): retrospective specs for all work done in the current sprint — hardening, route-timeout, start-layer protocol, heartbeat stats, availability map, rolling RPM, smart assignment, throughput routing, routing tests, relay outbound client. ADRs (docs/adr/0011-0014): 0011 — Auto-shard from memory budget and tracker network assignment 0012 — X-Meshnet-Start-Layer overlapping shard execution protocol 0013 — Rolling RPM statistics, smart assignment scoring, throughput routing 0014 — Relay outbound client for NAT/internet pipeline hops prd.json: US-020 through US-029 added, all marked done. ralph_progress.py now shows 29/29 complete (100%). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
1.3 KiB
Markdown
30 lines
1.3 KiB
Markdown
# US-022 — X-Meshnet-Start-Layer: overlapping shard execution protocol
|
||
|
||
Status: done
|
||
Priority: High
|
||
Stage: Implemented
|
||
|
||
## Context
|
||
|
||
Two nodes may register overlapping shard ranges (node A: 0–15, node B: 12–23) to increase
|
||
redundancy or to enable partial-model nodes to form a complete route. Without coordination,
|
||
node B would re-run layers 12–15 on top of activations that already include them, producing
|
||
wrong output.
|
||
|
||
The `X-Meshnet-Start-Layer` header tells each downstream node which model layer the incoming
|
||
activation tensor represents, so the node skips layers it has already been told to skip.
|
||
|
||
## Decision
|
||
|
||
Option A: tracker injects `start_layer` into `X-Meshnet-Route` hops at proxy time. The head
|
||
node passes it per-hop as `X-Meshnet-Start-Layer`. No peer-to-peer negotiation needed.
|
||
|
||
## Acceptance criteria
|
||
|
||
- [ ] Tracker `_handle_proxy_chat` builds route hops with `start_layer` = `covered_up_to + 1`
|
||
- [ ] `_handle_binary_forward` reads `X-Meshnet-Start-Layer` and passes it to `backend.forward_bytes`
|
||
- [ ] `_get_remaining_route` parses `start_layer` from injected header and from `/v1/route` slow-path
|
||
- [ ] `TorchModelShard.forward_bytes` accepts optional `start_layer` and skips layers below it
|
||
- [ ] Test: overlapping two-node route produces correct output without double-computing layers
|
||
- [ ] `python -m pytest` passes
|