Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
383 commits
Select commit Hold shift + click to select a range
168cd33
Serialize model creation with lease eviction
yueming-yuan Sep 14, 2026
4bfb7e4
Submit gateway metadata with checkpoint saves
yueming-yuan Sep 14, 2026
8dfbf92
Format checkpoint metadata changes
yueming-yuan Sep 14, 2026
cca58f6
Settle retries of expired create and sample results
yueming-yuan Sep 14, 2026
cfe4345
Reject unknown sampling sessions as user errors
yueming-yuan Sep 14, 2026
b70ec4c
Format Tinker review fixes
yueming-yuan Sep 14, 2026
698374f
Keep future retention next to retrieval
yueming-yuan Sep 14, 2026
3ac578a
Wire the Tinker gateway to miles
yueming-yuan Sep 4, 2026
74f3353
tinker runtime: real forward-only losses, independent sample seeds
yueming-yuan Sep 9, 2026
80bd5c7
serve: declare the adapter layout to the gateway
yueming-yuan Sep 9, 2026
e8d1a81
Remove unused arguments from MilesBackend
yueming-yuan Sep 9, 2026
a894a4e
Name runtime datum outputs and per-sample seeds
yueming-yuan Sep 9, 2026
33ead83
Trim gateway runtime commentary
yueming-yuan Sep 9, 2026
1b63291
style: format gateway runtime
yueming-yuan Sep 9, 2026
860f044
Pad work units to a multiple of the data-parallel size
yueming-yuan Sep 10, 2026
9ca90a1
Cancel the service loop when the HTTP server exits
yueming-yuan Sep 10, 2026
14c082c
Map stop=[] to ignore_eos
yueming-yuan Sep 10, 2026
4eb8e9c
Pad the batch with zero-loss-mask datums
yueming-yuan Sep 10, 2026
bd59bcf
Classify target modules on their canonical megatron names
yueming-yuan Sep 10, 2026
64ef183
Pass the slot capacity to the gateway config
yueming-yuan Sep 10, 2026
32c9ff0
Supervise the dispatcher together with the HTTP server
yueming-yuan Sep 10, 2026
0c6f370
Carry target_tokens into the trainer batch
yueming-yuan Sep 11, 2026
7e3d2d6
The gateway backend surfaces actor error results and dead workers
yueming-yuan Sep 11, 2026
ad23bf6
Order runtime translation and drop the backend base class
yueming-yuan Sep 11, 2026
e592ee9
Fail an aborted sample instead of reporting it as a stop
yueming-yuan Sep 11, 2026
3f76544
Preserve isolated failures through the Tinker runtime
yueming-yuan Sep 12, 2026
6c4b3da
Forward checkpoint metadata to trainer workers
yueming-yuan Sep 14, 2026
77093e5
Remove the redundant serve-only scheduler bypass
yueming-yuan Sep 14, 2026
9b02d36
Classify the gateway layout by HF target names
yueming-yuan Sep 14, 2026
cf1e360
Add the multi-LoRA Tinker gateway example and tests
yueming-yuan Sep 4, 2026
d0aa4f1
tests: cover the review fixes
yueming-yuan Sep 9, 2026
56f390b
Align gateway tests with datum names and simplified APIs
yueming-yuan Sep 9, 2026
8b606a5
Make gateway error tests exercise the intended requests
yueming-yuan Sep 9, 2026
057dca2
Drop passthrough tests already covered by gateway conversations
yueming-yuan Sep 9, 2026
a3cd289
Give gateway fixtures owned directories and awaited task cleanup
yueming-yuan Sep 9, 2026
9b0cc91
Trim gateway test commentary to the protected properties
yueming-yuan Sep 9, 2026
5f8c2fc
Derive gateway checkpoint paths per run and register launcher snapshots
yueming-yuan Sep 9, 2026
220741c
tests: create the resume-probe model at the rank it asserts
yueming-yuan Sep 9, 2026
174186a
Match the resume probe to its explicit adapter rank
yueming-yuan Sep 9, 2026
53ce2f1
Keep gateway usage in the example and lifecycle semantics in the docs
yueming-yuan Sep 9, 2026
e912bf2
Trim example module descriptions
yueming-yuan Sep 9, 2026
960c53b
Restore the dense TensorData test declaration
yueming-yuan Sep 9, 2026
caec334
style: format gateway test helpers
yueming-yuan Sep 9, 2026
2a419ad
Cover the review fixes in the gateway suite; note the serving-side ti…
yueming-yuan Sep 10, 2026
643b405
Cover the eviction and stop=[] fixes in the gateway suite
yueming-yuan Sep 10, 2026
3d6d3a2
Cover the credential, checkpoint-semantics, and padding-mask fixes
yueming-yuan Sep 10, 2026
9e3075f
Drop tests that restate visible guards
yueming-yuan Sep 10, 2026
4422879
Cover the long-poll, exact-input, and slot-recycling fixes in the gat…
yueming-yuan Sep 10, 2026
4f4d42e
test: the healthy admission submit takes the next ordinal
yueming-yuan Sep 10, 2026
95a5e8d
docs: pin the tinker SDK to the wire schema the gateway implements
yueming-yuan Sep 10, 2026
0e97e22
test: a unit escaping its handler retires the model, not the loop
yueming-yuan Sep 10, 2026
6530fa3
test: requests after eviction carry the reason
yueming-yuan Sep 10, 2026
3ff9d04
Accept the gateway against the official tinker-cookbook recipes
yueming-yuan Sep 10, 2026
92f1739
Name the gateway launcher by its model and the recipe runner by its role
yueming-yuan Sep 10, 2026
693fa19
Rename the example entry points by role
yueming-yuan Sep 10, 2026
fda52d9
Update the gateway tests for explicit target labels
yueming-yuan Sep 11, 2026
3daf7e4
Test the non-global-fatal conversion path and the dead-trainer exit
yueming-yuan Sep 11, 2026
6df195e
Cover the request idempotency keys in the gateway tests
yueming-yuan Sep 11, 2026
6beda75
Move the adam-params contract tests to the decode boundary
yueming-yuan Sep 11, 2026
0d91417
Use an independent backend fake for gateway tests
yueming-yuan Sep 11, 2026
fdc8957
Cover barrier outcome alignment after filtering poisoned slots
yueming-yuan Sep 11, 2026
58bc1ca
Align planner and checkpoint documentation with their contracts
yueming-yuan Sep 11, 2026
11f0289
[multi-lora] Serve LoRA on the output layer (#3210)
yueming-yuan Sep 11, 2026
4a116a6
Cover the abort stop-reason and sampling-session base-model gates
yueming-yuan Sep 11, 2026
8cb0403
Cover ordered failures and isolation boundaries
yueming-yuan Sep 12, 2026
12847d7
Document terminal streams and checkpoint recovery
yueming-yuan Sep 12, 2026
2fac2a8
Align the gateway fake with checkpoint metadata writes
yueming-yuan Sep 14, 2026
44e29ed
Use the slot optimizer registry inherited from the executor
yueming-yuan Sep 14, 2026
c1dc29b
Recognize lm_head as an HF adapter target
yueming-yuan Sep 14, 2026
de6a0b6
Map lm_head consistently across LoRA layouts
yueming-yuan Sep 14, 2026
ec51f80
Match the example client to the gateway adapter layout
yueming-yuan Sep 14, 2026
00da322
Strip trailing whitespace from command recordings
yueming-yuan Sep 14, 2026
5737f0f
Normalize whitespace in launcher snapshots
yueming-yuan Sep 14, 2026
c295325
Normalize whitespace in the new launcher snapshots
yueming-yuan Sep 14, 2026
ef4898d
Remove unrelated launcher snapshot cleanup
yueming-yuan Sep 14, 2026
f449a63
Allow checkpoint publication to reject existing versions
yueming-yuan Sep 14, 2026
21a2d4a
Merge commit 'f449a638669a259c04ef32b3a3388b1b3ce41e93' into HEAD
yueming-yuan Sep 14, 2026
1957542
Publish Tinker adapters through immutable disk snapshots
yueming-yuan Sep 14, 2026
ec26950
Merge commit '19575424b2cdaf4bc25730ccd58a445d8dd262ea' into HEAD
yueming-yuan Sep 14, 2026
ebb635c
Resolve sampler snapshots from committed metadata
yueming-yuan Sep 14, 2026
5aeeeb4
Merge commit 'ebb635cbcb0996bb593636bd2732ffd5bb0ae17d' into HEAD
yueming-yuan Sep 14, 2026
3472ced
Serve Tinker sampling from a frozen base
yueming-yuan Sep 14, 2026
caf711d
Merge commit '3472cedd415e3afb2996e6a5a0c9cc0860b02114' into HEAD
yueming-yuan Sep 14, 2026
0a3fee6
Align gateway tests and docs with disk publication
yueming-yuan Sep 14, 2026
daa110f
Name the LoRA model extension and forward-backward entry point
yueming-yuan Sep 14, 2026
68fecb3
Move multi-LoRA commands into a dedicated actor
yueming-yuan Sep 14, 2026
fc4d784
Format LoRA actor imports
yueming-yuan Sep 14, 2026
f454e8b
Merge the updated LoRA chain into PR #2841
yueming-yuan Sep 14, 2026
1c027b0
Merge the updated LoRA chain into PR #2842
yueming-yuan Sep 14, 2026
5c565b1
Format LoRA actor imports
yueming-yuan Sep 14, 2026
450064c
Merge the updated LoRA chain into PR #2843
yueming-yuan Sep 14, 2026
ad97f0e
Move the publisher into weight_update
yueming-yuan Sep 14, 2026
041368e
Merge the updated LoRA chain into PR #2844
yueming-yuan Sep 14, 2026
6485673
Merge the updated LoRA chain into PR #2845
yueming-yuan Sep 14, 2026
af8ad85
Merge the updated LoRA chain into PR #2849
yueming-yuan Sep 14, 2026
f5b2390
Rename publisher.py to snapshot_publisher.py
yueming-yuan Sep 14, 2026
195319e
Merge the snapshot publisher rename
yueming-yuan Sep 14, 2026
fc3d940
Merge the snapshot publisher rename
yueming-yuan Sep 14, 2026
d734c6e
Merge the snapshot publisher rename
yueming-yuan Sep 14, 2026
3d2dbdd
Let checkpoint IO failures terminate the trainer cell
yueming-yuan Sep 14, 2026
92742a2
Format checkpoint failure cleanup
yueming-yuan Sep 14, 2026
8e5734d
Propagate checkpoint failures through adapter export
yueming-yuan Sep 14, 2026
048c5d1
Merge checkpoint failure propagation into PR #2844
yueming-yuan Sep 14, 2026
166eaa1
Merge checkpoint failure propagation into PR #2845
yueming-yuan Sep 14, 2026
c561011
Align checkpoint failure tests and docs with server shutdown
yueming-yuan Sep 14, 2026
a1d49c4
Format checkpoint failure cleanup
yueming-yuan Sep 14, 2026
7099c92
Name request completion and model closure explicitly
yueming-yuan Sep 15, 2026
1460fa3
Extract stateless checkpoint helpers from TinkerService
yueming-yuan Sep 15, 2026
b328886
Finish batch and barrier requests through one path
yueming-yuan Sep 15, 2026
84a4432
Keep expired-result retry handling in FutureStore
yueming-yuan Sep 15, 2026
e81a5ae
Stop owned background tasks when the dispatcher exits
yueming-yuan Sep 15, 2026
791801d
Order service methods by lifecycle and request flow
yueming-yuan Sep 15, 2026
783fb29
Format Tinker service cleanup
yueming-yuan Sep 15, 2026
75e7bff
Inline the sole training-stream error formatter
yueming-yuan Sep 15, 2026
86eafb7
Simplify checkpoint operation calls
yueming-yuan Sep 15, 2026
a13efa9
Name the future lookup by its retry purpose
yueming-yuan Sep 15, 2026
7cbc9de
Merge Tinker service cleanup into PR #2845
yueming-yuan Sep 15, 2026
4f27baf
Merge Tinker service cleanup into PR #2849
yueming-yuan Sep 15, 2026
cebf761
Publish checkpoint versions through an atomic symlink
yueming-yuan Sep 15, 2026
1fce2bf
Format checkpoint changes
yueming-yuan Sep 15, 2026
93c2314
Merge checkpoint fixes into PR #2843
yueming-yuan Sep 15, 2026
ff86b60
Match the FT harness to the current weight update API
yueming-yuan Sep 15, 2026
84b21c8
Merge checkpoint fixes into PR #2844
yueming-yuan Sep 15, 2026
e43a887
Reject sampler snapshots before training checkpoint load
yueming-yuan Sep 15, 2026
eb23460
Preserve checkpoint links on save and pin versions on load
yueming-yuan Sep 15, 2026
7dea9db
Merge checkpoint fixes into PR #2845
yueming-yuan Sep 15, 2026
708c94a
Merge checkpoint fixes into PR #2849
yueming-yuan Sep 15, 2026
bcb5b0b
Correct the Tinker launcher filename in the README
yueming-yuan Sep 15, 2026
49555e7
Align sampler tests with the extracted checkpoint utility
yueming-yuan Sep 15, 2026
882d9e4
Align gateway tests and docs with versioned checkpoints
yueming-yuan Sep 15, 2026
2579679
Cover process crashes during checkpoint replacement
yueming-yuan Sep 15, 2026
486c18c
Format checkpoint changes
yueming-yuan Sep 15, 2026
846fdab
Reject invalid LoRA ranks before allocating slots
yueming-yuan Sep 15, 2026
e0658c7
Merge LoRA rank validation into PR #2845
yueming-yuan Sep 15, 2026
ab88a2b
Merge LoRA rank validation into PR #2849
yueming-yuan Sep 15, 2026
da2ceea
Verify exact cross-slot checkpoint continuation
yueming-yuan Sep 15, 2026
0b0e5fc
Merge checkpoint continuation coverage into PR #2845
yueming-yuan Sep 15, 2026
069d8f6
Merge checkpoint continuation coverage into PR #2844
yueming-yuan Sep 15, 2026
271d322
Merge checkpoint continuation coverage into PR #2849
yueming-yuan Sep 15, 2026
90f719c
Merge checkpoint continuation coverage into PR #2843
yueming-yuan Sep 15, 2026
7a75275
Format checkpoint continuation test
yueming-yuan Sep 15, 2026
2c945ba
Preserve native loss per_datum metrics
yueming-yuan Sep 15, 2026
8cfff1c
Check nonzero Tinker objectives and analytic gradients
yueming-yuan Sep 15, 2026
7cd7023
style: format loss expectation cases
yueming-yuan Sep 15, 2026
00c7937
Merge loss review fixes into PR #2845
yueming-yuan Sep 15, 2026
32b082d
Merge loss review fixes into PR #2844
yueming-yuan Sep 15, 2026
41e0daf
Validate Tinker checkpoint root before starting workers
yueming-yuan Sep 15, 2026
5880f94
Merge loss review fixes into PR #2849
yueming-yuan Sep 15, 2026
294e5d7
Merge loss review fixes into PR #2843
yueming-yuan Sep 15, 2026
4625566
Merge loss review fixes into PR #2842
yueming-yuan Sep 15, 2026
8955990
Scope resource leases to their owning session
yueming-yuan Sep 15, 2026
9475ad3
style: format session lease changes
yueming-yuan Sep 15, 2026
1fe74e0
Merge session lease isolation into PR #2845
yueming-yuan Sep 15, 2026
ae41a23
Merge session lease isolation into PR #2849
yueming-yuan Sep 15, 2026
88dd91f
Remove session lease regression tests
yueming-yuan Sep 15, 2026
00ab1ab
Merge session lease test removal into PR #2845
yueming-yuan Sep 15, 2026
438f99e
Merge session lease test removal into PR #2849
yueming-yuan Sep 15, 2026
e443363
Bound the default multi-LoRA engine adapter cache
yueming-yuan Sep 15, 2026
ba95400
Merge adapter cache default into PR #2844
yueming-yuan Sep 15, 2026
1b100e9
Merge adapter cache default into PR #2845
yueming-yuan Sep 15, 2026
bc8cb2a
Merge adapter cache default into PR #2849
yueming-yuan Sep 15, 2026
7ab3f4b
Handle omitted optional adapter cache capacity
yueming-yuan Sep 15, 2026
6803e8f
Merge optional cache setting handling into PR #2844
yueming-yuan Sep 15, 2026
941967e
Merge optional cache setting handling into PR #2845
yueming-yuan Sep 15, 2026
0a30510
Merge optional cache setting handling into PR #2849
yueming-yuan Sep 15, 2026
1a80790
Decode Tinker v2 loss configuration values
yueming-yuan Sep 15, 2026
7a8580c
Merge v2 loss config decoding into PR #2845
yueming-yuan Sep 15, 2026
10edeec
Merge v2 loss config decoding into PR #2849
yueming-yuan Sep 15, 2026
b306b10
Clarify the Tinker SDK v2 config format
yueming-yuan Sep 15, 2026
7f0c026
Merge v2 config clarification into PR #2845
yueming-yuan Sep 15, 2026
c1adbfa
Merge v2 config clarification into PR #2849
yueming-yuan Sep 15, 2026
94b4a61
Dispose Tinker controllers when serving exits
yueming-yuan Sep 15, 2026
ed863e8
Merge controller lifecycle cleanup into PR #2849
yueming-yuan Sep 15, 2026
a027534
Align Tinker controller disposal with the training entrypoint
yueming-yuan Sep 15, 2026
a9b85ca
Merge controller disposal alignment into PR #2849
yueming-yuan Sep 15, 2026
3b46fcd
Validate numeric loss configuration before training
yueming-yuan Sep 15, 2026
cf61138
Merge Tinker request fixes into PR #2845
yueming-yuan Sep 15, 2026
3a66d3f
Render missing prompt logprobs in JSON responses
yueming-yuan Sep 15, 2026
2a8aabf
Merge Tinker request fixes into PR #2849
yueming-yuan Sep 15, 2026
ea837dc
Reject invalid sample cardinality before dispatch
yueming-yuan Sep 15, 2026
d2d1347
Honor source credentials when loading checkpoints
yueming-yuan Sep 15, 2026
14acf39
Expose sampling session metadata to SDK clients
yueming-yuan Sep 15, 2026
b1f8733
Merge Tinker compatibility fixes into PR #2845
yueming-yuan Sep 15, 2026
6485bd1
Return gone for unavailable session heartbeats
yueming-yuan Sep 15, 2026
69fb920
Use the SDK sentinel for top-k prompt padding
yueming-yuan Sep 15, 2026
4aa823a
Reject unsupported multi-target and training sampling inputs
yueming-yuan Sep 15, 2026
758c34b
Merge Tinker compatibility fixes into PR #2849
yueming-yuan Sep 15, 2026
424c2cc
Reject unsupported multi-target and training sampling inputs
yueming-yuan Sep 15, 2026
bdd25b1
Document unsupported Tinker inputs in generated docs
yueming-yuan Sep 15, 2026
cf59a13
Use the SDK sentinel for top-k prompt padding
yueming-yuan Sep 15, 2026
3d224bb
Preserve EOS handling for empty stop strings
yueming-yuan Sep 15, 2026
b7f3b1a
style: sort Tinker runtime test imports
yueming-yuan Sep 15, 2026
7bc31e4
Merge input validation into PR #2845
yueming-yuan Sep 15, 2026
da96f16
Merge input validation into PR #2849
yueming-yuan Sep 15, 2026
0bf4fa9
Pass the model vocabulary size to Tinker validation
yueming-yuan Sep 15, 2026
88197f2
Set the vocabulary size in the Tinker test harness
yueming-yuan Sep 15, 2026
ac6343c
Centralize input validation and reject invalid tokens and checkpoint …
yueming-yuan Sep 15, 2026
b4b1ed7
Disable autograd for forward-only loss passes
yueming-yuan Sep 15, 2026
9db2a0a
Merge forward-only autograd fix into PR #2842
yueming-yuan Sep 15, 2026
5c1a7fb
Merge forward-only autograd fix into PR #2845
yueming-yuan Sep 15, 2026
966db04
Merge forward-only autograd fix into PR #2849
yueming-yuan Sep 15, 2026
39ae756
Merge forward-only autograd fix into PR #2843
yueming-yuan Sep 15, 2026
caba021
Merge forward-only autograd fix into PR #2844
yueming-yuan Sep 15, 2026
d9fe2fa
Pin router artifacts for LoRA backfill
yueming-yuan Sep 15, 2026
5ccde8d
Merge router pin into PR #2849
yueming-yuan Sep 15, 2026
9694992
Merge main into PR #2839
yueming-yuan Sep 15, 2026
4a2d856
Merge main cascade into PR #2840
yueming-yuan Sep 15, 2026
24e5d65
Merge main cascade into PR #2841
yueming-yuan Sep 15, 2026
6c01c5e
Merge main cascade into PR #2842
yueming-yuan Sep 15, 2026
280bda2
Merge main cascade into PR #2843
yueming-yuan Sep 15, 2026
f3be62e
Merge main cascade into PR #2844
yueming-yuan Sep 15, 2026
bbdd740
Merge main cascade into PR #2845
yueming-yuan Sep 15, 2026
a544947
Merge main cascade into PR #2849
yueming-yuan Sep 15, 2026
e6fa391
Preserve loss documentation outside Tinker contract changes
yueming-yuan Sep 15, 2026
c8c0e95
Merge loss documentation fix into PR #2842
yueming-yuan Sep 15, 2026
a2ef649
Merge loss documentation fix into PR #2843
yueming-yuan Sep 15, 2026
b73b68b
Merge loss documentation fix into PR #2844
yueming-yuan Sep 15, 2026
32047a5
Merge loss documentation fix into PR #2845
yueming-yuan Sep 15, 2026
dbb651d
Merge loss documentation fix into PR #2849
yueming-yuan Sep 15, 2026
2e7bfed
Name per-model request queues explicitly
yueming-yuan Sep 15, 2026
ac03aa8
Name Tinker request futures explicitly
yueming-yuan Sep 15, 2026
04c6990
Merge Tinker naming cleanup into PR #2849
yueming-yuan Sep 15, 2026
6bc2ac4
Name per-model request queues explicitly
yueming-yuan Sep 15, 2026
6b91725
Name Tinker request futures explicitly
yueming-yuan Sep 15, 2026
7433cdc
Merge Tinker naming cleanup into PR #2845
yueming-yuan Sep 15, 2026
ef2d2dc
Merge request scheduler naming into PR #2849
yueming-yuan Sep 15, 2026
f6e060a
Name the Tinker request scheduler explicitly
yueming-yuan Sep 15, 2026
3a5b666
Merge request scheduler naming into PR #2845
yueming-yuan Sep 15, 2026
48c5702
Rename request scheduler tests
yueming-yuan Sep 15, 2026
50082cd
Clarify Tinker scheduling and request state ownership
yueming-yuan Sep 15, 2026
e2f27b3
Merge Tinker naming cleanup into PR #2845
yueming-yuan Sep 15, 2026
6e84cf2
Keep sample sequence identity in the service
yueming-yuan Sep 15, 2026
cbe505a
Merge Tinker naming cleanup into PR #2849
yueming-yuan Sep 15, 2026
cd1be6f
Align Tinker tests with request state ownership
yueming-yuan Sep 15, 2026
a33aa87
Include target tokens in Tinker test datums
yueming-yuan Sep 15, 2026
1e37c5a
Mock the renamed Tinker trainer call
yueming-yuan Sep 15, 2026
992921b
Include prompt tokens in the shutdown test request
yueming-yuan Sep 15, 2026
98d75dc
Add multi-tenant gateway CI under run-ci-multi-lora
yueming-yuan Sep 15, 2026
435971c
style: Format Tinker CI gateway helper
yueming-yuan Sep 15, 2026
a69d870
Allow the multi-LoRA CI label in comment commands
yueming-yuan Sep 15, 2026
772d40a
Run CI with the PR7 image
yueming-yuan Sep 16, 2026
a6c2bc6
Pin router indexer replay support [skip ci]
yueming-yuan Sep 16, 2026
94bfa08
Merge router pin into PR7 [skip ci]
yueming-yuan Sep 16, 2026
6b99c28
Clean up Tinker gateway test processes [skip ci]
yueming-yuan Sep 16, 2026
76ca4d7
Bound Tinker datums by trainer token capacity [skip ci]
yueming-yuan Sep 16, 2026
7d51791
Merge Tinker token limit into PR7 [skip ci]
yueming-yuan Sep 16, 2026
e69a749
Define Tinker adapter layout through dedicated arguments [skip ci]
yueming-yuan Sep 16, 2026
9f00b27
Prefix Tinker arguments at registration [skip ci]
yueming-yuan Sep 16, 2026
4fc7c98
Restore router installation from rolling wheel releases [skip ci]
yueming-yuan Sep 16, 2026
116f43d
Merge rolling router wheels into PR7 [skip ci]
yueming-yuan Sep 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/policies/comment-command-access.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"run-ci-image",
"run-ci-long",
"run-ci-lora",
"run-ci-multi-lora",
"run-ci-megatron",
"run-ci-miles-plugin",
"run-ci-model-scripts",
Expand Down
153 changes: 31 additions & 122 deletions docs/advanced/lora.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Rollout requests then select the live named adapter with `lora_path`.

Multi-LoRA currently supports disaggregated rollout only and rejects
`--colocate` at launch. Each SGLang engine keeps the base checkpoint resident;
miles selectively exports and NCCL-broadcasts newly loaded or optimizer-stepped
adapters into their corresponding SGLang slots. New or restarted engines receive
every loaded adapter, while unchanged adapters are not resent.
adapter weights reach the engines through explicit pushes: each push registers
an immutable version under its own engine-side name, so in-flight sampling
against an older version is never disturbed.

Model support is therefore a three-way contract rather than a hard-coded
allowlist:
Expand Down Expand Up @@ -68,7 +68,8 @@ full-scale experiment evidence. It is not an exhaustive model whitelist.
| Implementation | Model family | Architecture exercised | Evidence | Notes |
|---|---|---|---|---|
| Bridge | Qwen2.5 0.5B / 3B | Dense | [0.5B CUDA and ROCm E2E](https://github.com/radixark/miles/blob/main/tests/e2e/lora/test_lora_qwen2.5_0.5B.py), [3B disaggregated recipe](https://github.com/radixark/miles/blob/main/examples/lora/run-qwen2.5-3B-megatron-lora-disaggregated.sh) | The simplest starting point; `all-linear` works. |
| Bridge | Qwen3 4B | Dense | [Single-LoRA recipe](https://github.com/radixark/miles/blob/main/examples/lora/run-qwen3-4B-megatron-lora.sh), [AMD launcher](https://github.com/radixark/miles/blob/main/scripts/amd/run_qwen3_4b_lora.py), [multi-LoRA recipe](https://github.com/radixark/miles/tree/main/examples/multi_lora) | The AMD launcher uses Triton attention and LoRA backends. |
| Bridge | Qwen3 4B | Dense | [Single-LoRA recipe](https://github.com/radixark/miles/blob/main/examples/lora/run-qwen3-4B-megatron-lora.sh), [AMD launcher](https://github.com/radixark/miles/blob/main/scripts/amd/run_qwen3_4b_lora.py) | The AMD launcher uses Triton attention and LoRA backends. |
| Bridge | Qwen3-30B-A3B | MoE | [Multi-LoRA gateway example](https://github.com/radixark/miles/tree/main/examples/multi_lora) | Disaggregated Tinker training and versioned sampling. |
| Bridge | GPT-OSS 20B | MoE | [Recipe](https://github.com/radixark/miles/blob/main/examples/lora/run-gpt-oss-20B-megatron-moe-lora.sh), [MoE LoRA E2E](https://github.com/radixark/miles/blob/main/tests/e2e/megatron/model_scripts/test_gpt_oss_20b_moe_lora_ci.py) | Uses the SGLang `triton` LoRA backend. |
| Bridge | Kimi K2.5 | Multimodal MoE + MLA | [16-node recipe](https://github.com/radixark/miles/blob/main/examples/lora/run-kimi-k25-megatron-lora.sh) | Demonstrates shared-outer expert LoRA and an INT4 rollout / fake-QAT setup. |
| Bridge | GLM-5 / 5.1 / 5.2 744B-A40B | MoE + MLA + DSA | [GLM-5.1 launcher](https://github.com/radixark/miles/blob/main/scripts/run_glm5_1_744b_a40b_lora.py), [GLM-5.2 launcher](https://github.com/radixark/miles/blob/main/scripts/run_glm5_2_744b_a40b_lora.py) | CI covers reduced 6-layer / 5-layer checkpoints; historical full-744B results are described below. |
Expand Down Expand Up @@ -289,121 +290,29 @@ stability evidence rather than a released benchmark.

## Multi-LoRA training

### Current dataset-driven backend

The implementation on `main` trains multiple adapters against one shared base
model through the [fully async example](https://github.com/radixark/miles/tree/main/examples/multi_lora).
Each registered adapter supplies its own dataset, reward, rollout batch shape,
rank/alpha, and checkpoint directory, with most fields inheriting process-wide
defaults. LR/WD hyperparameters come from the global CLI; each fixed slot has
its own Adam state and independently clocked scheduler. The trainer coalesces
ready prompt-group slices or partial adapter batches and selectively upserts
only changed adapters into SGLang.

Set the slot capacity with `--multi-lora-n-adapters N`. A bounded run registers
repeatable `--multi-lora-adapter NAME PATH` entries at startup; service mode can
start with empty slots and register adapters through the controller HTTP API.
This path currently forces Megatron-Bridge LoRA and requires disaggregated NCCL
broadcast, PP1, THD, Adam, and no train offload. Shared-outer expert adapters are
unsupported, and MoE expert adapters cannot use FP8/FP4 experts.

Native multi-LoRA is not implied by the native single-adapter work: both current
`main` and the Tinker-oriented branch below still build multi-LoRA through
Megatron-Bridge. Native multi-LoRA is tracked separately in
[issue #2141](https://github.com/radixark/miles/issues/2141).

### Future Tinker-compatible operation backend

[PR #2273](https://github.com/radixark/miles/pull/2273) is the active
Tinker-oriented backend proposal. It changes ownership of the training loop:
instead of the server owning a dataset, reward function, and one-step schedule,
clients submit explicit operations against a registered adapter. Its primary
intended consumer is a Tinker-compatible training service rather than a generic
server-owned dataset scheduler.

```text
Tinker-style client
| register + ordered operations
v
controller / operation ledger
| bind one fixed LoRA slot
v
Megatron-Bridge multi-LoRA trainer
| forward, backward, optimizer, checkpoint
| save_weights_for_sampler publish barrier
v
SGLang router + registration-scoped adapter identity
```

The operation surface separates compute, optimization, and publication:

| Operation | Contract |
|---|---|
| `forward` / `forward_backward` | Return per-datum log probabilities; backward calls accumulate client-scaled gradient sums. |
| `optim_step` | Apply client-supplied Adam parameters and clipping to one slot, with an all-rank non-finite veto. |
| `save_weights_for_sampler` | Publish the latest adapter and complete only after the new serving version is live. |
| `save_state` / `load_state` | Save or restore immutable per-adapter weights and optimizer state behind shape, world-size, and ownership fences. |

The design uses fixed residency rather than transparent LRU eviction. Operations
are strictly serialized per registration, while idempotent retries, gap-buffered
arrival, acknowledgements, and backpressure make execution retry-safe and
order-safe. A registration-scoped serving identity prevents an old request from
using a slot after that slot has been reassigned. Authenticated remote access is
the responsibility of the future frontend, not the Ray operation API in #2273.

The v1 scope in the PR is deliberately narrow: text-only synchronous training,
one shared base model, shifted 1-D targets, `cross_entropy`, importance-sampling,
and PPO losses, per-call Adam, and latest-only sampler weights. Multimodal,
top-K/SDFT targets, CISPO/DRO, asynchronous or pinned-snapshot off-policy
training, and cross-world-size restore are outside v1.

<Warning>
This backend is implemented in an open PR, not released on `main`; the PR
reports H200 validation. PR #2273 provides the operation backend, but its v1
training operations are still exposed through the controller's Ray API. The
stacked [PR #2346](https://github.com/radixark/miles/pull/2346) adds a REST
frontend compatible with the official `tinker==0.24.1` client; its GPU frontend
E2E is still pending. If #2273 lands as proposed, it replaces the current
dataset-driven driver.
</Warning>

## Compatibility and limitations

- **Training backend:** Megatron only; FSDP has no LoRA training path.
- **Implementation path on `main`:** Bridge is the general path; native/raw LoRA
is model-specific to Inkling. General native coverage is pending PR #1792.
- **Remote transport:** NCCL broadcast only, with PP1. P2P/RDMA and disk-delta
reject LoRA.
- **PPO:** shared actor/critic PPO with Bridge LoRA is untested; the critic never
gets adapters.
- **Resume:** miles adapter shards are resumable with the matching parallel
topology. Direct HF PEFT import into the Bridge model is not yet implemented;
native Inkling has a custom importer.
- **Memory optimizations:** `--rematerialize-param-from-master-weight` and
streamed optimizer state on NVMe reject LoRA. Ordinary actor disk offload is a
different feature and is used by the draft agentic recipe.
- **Multi-LoRA:** the current and proposed Tinker operation paths both require
Bridge; native multi-LoRA remains roadmap work. Evaluation, colocate, PP,
train offload, shared-outer experts, and FP8/FP4 MoE expert adapters are not
supported by the current multi-adapter path.
- **Agentic sessions:** the current session integration selects the fixed
`miles_lora` adapter, not a multi-LoRA slot; `--lora-train-only` is also not a
supported combination for this path.

## Internals

- `miles/backends/megatron_utils/bridge_lora_helpers.py` builds and wraps the
general Bridge LoRA model.
- `miles/backends/megatron_utils/lora_utils.py` resolves module names, creates
standard/canonical adapters, and implements adapter checkpoint helpers.
- `miles_plugins/models/inkling/lora.py` implements the native/raw LoRA path
available on current `main`.
- `miles/backends/megatron_utils/update_weight/update_weight_from_tensor.py`
handles colocated adapter export and IPC loading.
- `miles/backends/megatron_utils/update_weight/update_weight_from_distributed/`
gathers and broadcasts adapters to remote SGLang engines.
- `miles/rollout/session/core.py` attaches the single adapter to agentic session
requests.
- `miles/ray/multi_lora/`, `miles/rollout/multi_lora/`, and
`miles/backends/megatron_utils/multi_lora_*.py` implement the multi-adapter
controller, routing, scheduling, optimization, and checkpoint path.
Multi-LoRA training is served through the Tinker protocol: `serve_tinker.py`
turns a miles deployment into a training service where each client drives its
own adapter slot with explicit forward_backward / optim_step operations (the
server owns no datasets or schedules). The gateway lives in `miles/tinker/`,
the slot mechanics in `miles/backends/megatron_utils/lora/`. The dataset-driven
multi-LoRA v1 backend (fully-async driver, adapter controller, per-adapter data
sources) has been removed.

Clients use the official `tinker` SDK with the gateway URL and a distinct API key
per tenant. The key identifies ownership of models, futures, and checkpoints.
Each adapter accumulates gradients until its client submits an optimizer step;
saving weights for sampling publishes an immutable adapter version.

`save_state` saves adapter parameters and optimizer state, including FP32 masters.
It waits for preceding commands but neither steps nor saves pending gradients;
call it after `optim_step` to save the effect of the accumulated training work.
Sampler saves commit an immutable adapter directory on shared storage, without
contacting inference engines. Engines load the same frozen base at startup and
load adapter snapshots from disk on demand. A failed engine load fails sampling
without invalidating the saved snapshot or model training.

Futures, model leases, and sequence deduplication are in memory and are lost on
gateway restart. Saved checkpoints retain their ownership and adapter metadata
and can be used to create a new training or sampling client.

See the [gateway example](/examples/multi-lora) for the launcher and smoke client.
2 changes: 1 addition & 1 deletion docs/developer/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ is loaded only when a run names its import path in a flag (`--spec`, or one of t
per-architecture weight bridges, `megatron_bridge/` the `megatron.bridge` shims, and
`optimizers/` optimizer plugins.

`train.py`, `train_async.py` and `train_multi_lora_async.py` are the entry points. They are
`train.py` and `train_async.py` are the entry points. They are
thin; most logic lives in the modules above.

## A request's life
Expand Down
1 change: 0 additions & 1 deletion docs/developer/contributor-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ welcome: bug reports, doc fixes, new model recipes, full features.
miles/
├── train.py # synchronous entry point
├── train_async.py # fully-async entry point
├── train_multi_lora_async.py # multi-LoRA async entry point
├── miles/ # the package
│ ├── backends/
│ │ ├── megatron_utils/ # Megatron actor, weight sync, checkpointing, fp32 markers
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/index.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading