Skip to content

Sync with upstream main, add Inkling-2-Mini TorchTitan full-FT, Tinker SDK 0.40.1, score_centering + TIS, and clean R3 - #24

Open
ApGa wants to merge 1386 commits into
apga/devfrom
apga/sync-inkling-sc-tinker040
Open

ApGa wants to merge 1386 commits into
apga/devfrom
apga/sync-inkling-sc-tinker040

Conversation

@ApGa

@ApGa ApGa commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Syncs apga/dev with upstream radixark/miles main, brings in upstream PR #4981 (Inkling-2-Mini TorchTitan support), upgrades the Tinker gateway to SDK 0.40.1, and adds full fine-tuning + score_centering + TIS/MIS + clean handle-less R3 support for both Muse-Glimmer-30B and Inkling-2-Mini:

  • Upstream sync + Inkling-2-Mini (PR #4981):
    • Reconciles apga/dev with upstream radixark/miles main while preserving full-FT, R3, CP, fused FP32 LM head, MTP, and Muse-Glimmer-30B support.
    • Integrates Inkling-2-Mini TorchTitan looped MoE model support.
  • Tinker SDK 0.40.1 & clean handle-less R3:
    • Implements create-via-load (POST /api/v1/load_weights) and protobuf-compatible sampling/training endpoints.
    • Resolves rollout routing replay (R3) server-side by (tenant, tokens) without requiring client-side SampleResponse monkey-patches.
  • score_centering + TIS/MIS & SGLang top-K logprob cache:
    • Implements score_centering_loss_function with fused_lm_head.selected_logprobs and TopkCache populated via --rollout-top-logprobs-num.
    • Enables --rollout-top-logprobs-num 32 on Muse ABCI presets.
  • Inkling-2-Mini TorchTitan full-FT executor & 128K gateway/preset:
    • Adds FullTorchTitanTinkerTrainRayActor and miles/backends/torchtitan_utils/full/model.py (DCP save/load for both AdamW and DistMuon+AdamW, pre/post row_norm_projection, non-finite veto).
    • Adds examples/tinker/run_inkling2_mini_gateway.py and deploy/abci/presets/inkling-2-mini-128k.env configured for 128K context (--context-len 131066, --seq-length 131072, --max-tokens-per-gpu 131067, --max-tokens-per-datum 131067, --rollout-top-logprobs-num 32).

Verification

  • pytest tests/fast/tinker/: 309 passed.
  • Inkling & score_centering fast tests: 94 passed.
  • ruff check clean on all modified and added files.

guapisolo and others added 30 commits October 29, 2026 00:58
…#4531)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…535)

Signed-off-by: rockdu <kangrdu@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: rockdu <kangrdu@gmail.com>
Co-authored-by: Kangrui Du <89372739+Rockdu@users.noreply.github.com>
Co-authored-by: Jiajun Li <guapisolo@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jiajun Li <guapisolo@gmail.com>
wl45361 and others added 30 commits November 23, 2026 17:25
Co-authored-by: guapisolo <guapisolo@gmail.com>
Co-authored-by: guapisolo <guapisolo@gmail.com>
…13) (#4887)

Signed-off-by: Zhongdongming Dai <zhongdongmin@nvidia.com>
Co-authored-by: guapisolo <guapisolo@gmail.com>
Co-authored-by: guapisolo <guapisolo@gmail.com>
…the admin API key on admin routes (#5043)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ls on torchtitan (#4957)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Implement FullTorchTitanTinkerTrainRayActor and full/model.py on top of TitanTrainer so serve_tinker.py --train-backend torchtitan --tinker-train-mode full can train Inkling-2-Mini with score_centering, R3 replay, gradient accumulation across Tinker units, pre/post row_norm_projection, non-finite step veto, and DCP state save/load (supporting both AdamW and DistMuon+AdamW).
…pture in Muse presets

Add examples/tinker/run_inkling2_mini_gateway.py and deploy/abci/presets/inkling-2-mini-64k.env for TorchTitan full-FT serving with TopkCache (--rollout-top-logprobs-num 32) and optional R3, and enable --rollout-top-logprobs-num 32 on the Muse-Glimmer-30B presets for score_centering + TIS.
Default run_inkling2_mini_gateway.py to 131066 context (+6 SGLang margin
= 131072, TorchTitan --seq-length rounded up to a 128-token block
multiple >= max_tokens_per_gpu, 131067 max tokens per GPU/datum) and
replace deploy/abci/presets/inkling-2-mini-64k.env with
inkling-2-mini-128k.env.
…ay options

- Register one Replay stream per looped pass visit in TorchTitan routing_replay
  (48 streams across 24 physical routers for Inkling-2-Mini: prelude 0..5,
  core 6..17 x 3 passes -> 6..41, postlude 18..23 -> 42..47).
- Track active loop pass via loop_pass(pass_idx) inside Inkling2Model._run_layer
  (including inside torch.utils.checkpoint closure) so both forward and
  reverse-order activation-checkpointed backward recompute select the exact
  per-pass Replay stream without drift.
- Update BaseReplayManager.prune_to_model for tuple-stored looped replays,
  TorchTitan actor warmup routed_experts_shape to use router_num_streams, and
  routing_cache.extract_routing_shape (used by serve_tinker) to unwrap
  hf_config.text_config and expand loop_config num_passes.
- Add --hardware cuda|rocm (Triton attention/MoE + disable custom all-reduce
  for AMD MI355X/ROCm), --dp-replicate-size, and auto-scaled unit_token_budget
  to examples/tinker/run_inkling2_mini_gateway.py.
- Add CPU unit tests covering looped forward, AC reverse-order backward,
  consumption_guard, prune_to_model, and nested looped routing shape extraction.
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.