Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
52fe76a
fix(megatron): restore cuda patch target in validate_args
Yangruipis Apr 29, 2026
d20dd64
chore(data): remove unused prompt helpers
dirtyDan0 Apr 29, 2026
cbd1895
fix(data): avoid prompt mutation in reads
dirtyDan0 May 2, 2026
95d39be
fix(megatron): wait for previous eval on final training step
NINGBENZHE May 7, 2026
eb89a0d
feat(megatron): upgrade to Megatron-Bridge mainline
Yangruipis May 7, 2026
338324b
feat(models): add Qwen3.6-35B-A3B support with MoE expert detection
Yangruipis May 8, 2026
1bb19f4
feat(metrics): report reward dict fields
dirtyDan0 May 9, 2026
aef19c6
fix(deepeyes): collapse duplicate image_pad tokens before load_mm_data
Yangruipis May 9, 2026
79b764c
fix(megatron): GDN torch.compile + Qwen3.6 unsplit forward
Yangruipis May 11, 2026
0d0dcfe
fix(qwen3.6): fp16 support and related fixes
Yangruipis May 12, 2026
2a24010
feat(genrm): support shared-GPU colocate with rollout
Yangruipis May 12, 2026
cf776b4
fix(device): avoid gloo dist backend on CPU-only Ray driver
Yangruipis May 13, 2026
8407f9d
feat(glm5): support glm5 model and parameterize env variables
NINGBENZHE May 13, 2026
710d50f
chore(docker): switch torch_memory_saver to redai-infra fork
NINGBENZHE May 13, 2026
851c2ac
refactor(scripts): separate MODEL_DIR/DATA_DIR/EXP_DIR
Yangruipis May 14, 2026
6ffee26
chore(deepeyes): remove duplicate rollout gpus-per-engine arg in deep…
dirtyDan0 May 11, 2026
d9089f7
fix(deepeyes): preserve multimodal sample state
dirtyDan0 May 18, 2026
7359829
feat(async): auto-enable true-on-policy mode and skip actor_fwd
NINGBENZHE May 20, 2026
e9639a1
fix: resume bug if num_rollout changed
Yangruipis May 20, 2026
8442731
fix(slime-sync): port 8 upstream slime fixes
li126com May 21, 2026
a17e9b9
fix: add qwen3.6 async image example and rollout healthcheck retry fo…
Yangruipis May 21, 2026
a5af22e
feat(data): add custom-prompt-path and image-resize-scale-factor
yxyOo May 21, 2026
8fa57a4
feat(training): add hybrid training mode
yxyOo May 21, 2026
d9be1bc
feat: add eval for multimodal
liujia-cc May 22, 2026
73d78e0
feat(visualize): add rollout result viewer (web + TUI)
Yangruipis May 22, 2026
430c1f4
fix(scripts): split MODEL_DIR/EXP_DIR/DATA_DIR init
Yangruipis May 23, 2026
56b1773
fix(CE): restore openr1 script to fix CE error
liujia-cc May 25, 2026
213863e
chore(deepeyes): align datasets with main script
dirtyDan0 May 25, 2026
f77758c
docs(hybrid): add bilingual hybrid training guide
yxyOo May 22, 2026
c695ce5
feat(megatron): dump provider config as json
Yangruipis May 25, 2026
62a0e0a
docs(readme): document hybrid execution mode
yxyOo May 26, 2026
3b1f339
perf(megatron): warm HF ckpt page cache before bridge load
Yangruipis May 27, 2026
c632ba9
feat(megatron): wire VPP training
Yangruipis May 27, 2026
61d77bf
fix(deepeyes): repair rollout recovery paths
dirtyDan0 May 27, 2026
3c5967e
feat(kimi-k2.6): add INT4 QAT training support
NINGBENZHE May 28, 2026
b690511
fix(megatron): idempotent grad/param sync setup
yxyOo May 28, 2026
852ddf6
Low Precision Training Support
May 28, 2026
21758b1
fix(megatron): skip IPC route for hybrid weight sync
May 28, 2026
ec92a90
docs: add Kimi K2.6 to model tables and Skills section
NINGBENZHE May 28, 2026
4bf681f
fix(sglang): backport mamba pool sizing #24244
Yangruipis May 29, 2026
62a92e8
fix: ci tests
Yangruipis May 29, 2026
555ea80
docs: add projects built upon Relax
Yangruipis May 29, 2026
45c1677
fix(gitleaks): tighten secret allowlists
Yangruipis Jun 1, 2026
09fa804
fix(scripts,ci): clean up dir vars and narrow gitleaks scope
Yangruipis Jun 1, 2026
52f6d6a
feat(perf): replace FLOPS calculation with verl-style FlopsCounter an…
NINGBENZHE Jun 1, 2026
d9441d8
feat(weight-update,scripts): add Qwen3.5-397B support and unify bridg…
NINGBENZHE Jun 1, 2026
69a696c
fix(megatron): use global_param_name and tqdm progress bar
Yangruipis Jun 1, 2026
c19d9ef
fix(R3): shape mismatch when cp > 1
liujia-cc Jun 2, 2026
2ee5140
fix(weight-sync): use node_id to detect colocated rollout engines
yxyOo Jun 2, 2026
2323ceb
perf(megatron-loss): scale logits per-chunk to avoid OOM
Yangruipis Jun 2, 2026
1079893
fix(misc): tui bug
Yangruipis Jun 3, 2026
ac55f1c
fix(flops): handle CPU peak detection
Yangruipis Jun 3, 2026
69f910a
[NPU] Support qwen3-4B dapo full async mode on Ascend NPU (#36)
meiqingsui Jun 3, 2026
a650d4a
fix(args): validate rollout batch sizing
Yangruipis May 30, 2026
d925047
Revert "Merge branch fix/wuhuan/tiny_bugs into dev"
Yangruipis Jun 1, 2026
1857260
fix: fix resume start step from 0, beacase of start_rollout_id is not…
NINGBENZHE Jun 5, 2026
ab679a1
feat(agentic): add agentic rollout
dirtyDan0 Jun 5, 2026
b9450a3
feat(metrics): add multimodal and agent rollout metrics
Yangruipis Jun 8, 2026
98e9855
fix(sft): use self.healthy for actor handle to preserve Base._healthy…
Yangruipis Jun 10, 2026
d16c25e
chore(rollout): align generation runtime behavior
dirtyDan0 Jun 10, 2026
2890680
fix(sft): use self.healthy for actor handle to preserve Base._healthy…
Jun 10, 2026
370414e
chore(scripts): cap OMP/MKL/BLAS threads in Ray runtime env
xiaoliang0601 Jun 10, 2026
e5c7f62
feat: support per-sample apply_chat_template_kwargs
NINGBENZHE Jun 10, 2026
d463d0d
feat(sft): support OpenAI-style tool_calls + tool role in chat data
Yangruipis Jun 11, 2026
bc7d5e6
perf(stream-dataloader): NCCL-stream multimodal inputs
yxyOo Jun 12, 2026
04642a6
fix(stream-dataloader): broadcast multimodal inputs over CP before TP/PP
yxyOo Jun 12, 2026
5547eca
fix(entrypoint): avoid suiciding self when cleaning old ray jobs
Yangruipis Jun 12, 2026
3a3b80e
fix: test failed for python3.10
Yangruipis Jun 13, 2026
aa05058
fix(test): kill ray workers for each testcase
Yangruipis Jun 13, 2026
638866e
feat(models): support dots.mocr training (#42)
Yangruipis Jun 13, 2026
7af7bf9
feat(rollout): support async over-sampling in fully-async mode
NINGBENZHE Jun 15, 2026
68ae62a
fix(rollout): handle abort with eos
dirtyDan0 Jun 15, 2026
adde31a
feat(weight-conversion): add Qwen3 VL MoE converter
Yangruipis Jun 15, 2026
5da77c6
docs(readme): update community links and add docker badge
Yangruipis Jun 15, 2026
f8455a2
fix(ray): spread scheduling and stale-job cleanup
NINGBENZHE Jun 17, 2026
bb05453
fix: enable logprob maxtoken and adjust param to increase gpu utils
liujia-cc Jun 17, 2026
ed5d8e7
chore(scripts): tune qwen35-9b hybrid-async config
yxyOo Jun 17, 2026
5e8876b
chore(scripts): tune qwen35-9b hybrid-async config
yxyOo Jun 17, 2026
49812ff
feat(rollout): support reasoning and tool call parsers
dirtyDan0 Jun 18, 2026
26a450a
fix(registry): override StrEnum.__str__ for Python 3.10 colocate dete…
yeqinghe609 Jun 23, 2026
9a191dd
fix(args): validate rollout batch sizing
Yangruipis May 30, 2026
1c7eaae
Revert "Merge branch fix/wuhuan/tiny_bugs into dev"
Yangruipis Jun 1, 2026
511ac02
perf(dataloader): skip GPU round-trips for trivial parallel groups
yxyOo Jun 18, 2026
7ececdf
fix(sft): exit on data errors and bound TQ wait
Yangruipis Jun 18, 2026
d3e99bf
chore(rollout): align generation runtime behavior
Yangruipis Jun 22, 2026
5cc260c
feat: add npu ci
NINGBENZHE Jun 22, 2026
eeffd0e
feat(model): add qwen3.5-27B example
Yangruipis Jun 22, 2026
2845de6
fix(tools): auto-disable MTP in bridge convert
yxyOo Jun 23, 2026
0090a5f
feat(mtp): add qwen35 mtp 8gpu script (mtp rollout + train)
li126com Jun 24, 2026
77d9e59
feat(algorithm): integrate CISPO algorithm
fxsc03 Jun 24, 2026
380e7c7
fix: batch size of sft bench
Yangruipis Jun 25, 2026
5c0bb0d
feat(megatron): fully-async dynamic-batch streaming for PP/DP
NINGBENZHE Jun 26, 2026
7521df2
ci(gitleaks): scan tracked files
Yangruipis Jun 26, 2026
d0f9449
fix(rollout): guard context before append
dirtyDan0 Jun 27, 2026
93144fa
transferqueue lazy import
GUOGUOPOT Jun 27, 2026
d32fa9b
fix(requirements): fixed pyarrow version at 14.0.2 to match numpy<2
yuanlehome Jun 29, 2026
cb43be3
feat(sft): chunked logits & fused grouped gemm
xiaoliang0601 Jun 29, 2026
5ad58f2
fix(scripts,ci): clean up dir vars and narrow gitleaks scope
Yangruipis Jun 1, 2026
70b4bac
Revert "Merge branch fix/tfq_lazy_import into dev"
Yangruipis Jun 29, 2026
e9ea9ee
fix(tools): force contiguous tensors in bridge HF export
Yangruipis Jun 29, 2026
b06b31b
fix(controller): hint tq upgrade on missing sampler
Yangruipis Jun 29, 2026
f860ad3
feat(skills): add GitHub sync workflow
Yangruipis Jun 29, 2026
fe564fe
fix(rollout): set SGLANG TP imbalance check via ENABLE
yxyOo Jun 30, 2026
bbdaaf7
fix(test): test cases stale state
Yangruipis Jun 30, 2026
7ad441c
fix(test): github unittests
Yangruipis Jun 30, 2026
b620106
fix(wandb): add wandb init (#55)
grootZ Jul 1, 2026
20b3925
feat(klx):add klx XPU training support for Qwen3-4B, Qwen3.5-9B and Q…
yeqinghe609 Jul 1, 2026
242e2b8
feat(npu): add NPU training support for Qwen3-4B and Qwen3.5-9B in fu…
hbamboo Jul 1, 2026
1cabd3e
fix(megatron-fp16): avoid assert crash & double grad scaling under fp…
jamesruio Jul 3, 2026
fa7d16c
docs: fix stale branch name in raw GitHub link (#59)
YowatariChiaki Jul 5, 2026
f2cfef5
fix(rollout): SGLang PD bootstrap TP size inference (#61)
anranxia Jul 7, 2026
11d0215
fix(agentic): surface agent subprocess errors in driver log
Yangruipis Jun 26, 2026
9843b12
feat(megatron): split rollout mini batches
NINGBENZHE Jun 29, 2026
89701fc
fix(entrypoint,tools): harden multinode worker join & expose GPUs in …
Yangruipis Jun 29, 2026
b19dd12
fix(genrm): prevent colocate OOM and unblock judge concurrency
yxyOo Jul 1, 2026
6b5d68a
feat: adopt qs_inject shim for tensorboard SummaryWriter
Yangruipis Jul 3, 2026
3026fbb
feat(deepeyes-v2-agentic): DeepEyes V2 example on the agentic stack
Yangruipis Jul 3, 2026
9405dfe
feat: support partial_rollout with dynamic_global_batch_size
liujia-cc Jul 3, 2026
68ce1eb
fix(rollout): pass image config to agentic
dirtyDan0 Jul 4, 2026
f366bc6
fix: fix CE gbs not set
NINGBENZHE Jul 6, 2026
10a9b6d
feat(genrm): two-phase colocate GenRM via defer + swap
Yangruipis Jul 6, 2026
a70015b
feat(sft): support & reproduce redaccel cot compression
xiaoliang0601 Jul 6, 2026
f18b76a
feat(router): add sticky-session routing
flyinglandlord Jul 6, 2026
0a3632a
fix(wandb): initialize tracking after Serve
Yangruipis Jul 7, 2026
654d7b6
fix(test): CI collection and add GitHub sync gate (#62)
Yangruipis Jul 7, 2026
bf72f18
fix(sglang-nonfp8): catch broad Exception for fp8 ue8m0 imports to su…
yeqinghe609 Jul 9, 2026
371ada5
fix(klx-scripts): Update qwen3/qwen3.5 training scripts for klx (#60)
fenta Jul 9, 2026
72e92cf
fix(megatron): sync conditional vision branch
NINGBENZHE Jun 30, 2026
a8cb7cd
docs(scripts): remove misleading comments in convert_torch_dist_to_hf…
xiaoliang0601 Jul 7, 2026
7df195e
feat(opd): add core distillation plumbing
kkyyxhll Jul 8, 2026
be657fe
fix(deepeyes-v2): eliminate rollout hang and cancel storms
Yangruipis Jul 8, 2026
853cb02
fix(controller): reset sglang router on global restart
Yangruipis Jul 9, 2026
1ea3325
fix(megatron): resolve PP≥2 NCCL P2P deadlock with same-peer / SPMD skew
Yangruipis Jul 9, 2026
83e9093
fix(sglang): pin genRM moe_dense_tp_size to avoid corrupt weights
yuanlehome Jul 10, 2026
89499c2
feat(megatron): support dynamic_context_parallel
liujia-cc Jul 10, 2026
fe53a02
docs(dynamic-cp): add feature guide
Yangruipis Jul 10, 2026
cb1d51a
fix: docker build error for documents
Yangruipis Jul 10, 2026
5bb3f7e
docs(sync-github): base-locate via cherry-pick tails on both sides
Yangruipis Jul 11, 2026
9f8ecee
feat(npu): add Qwen3.5-35B-A3B training scripts and NPU infrastructur…
hbamboo Jul 14, 2026
ddfedcd
fix: async reward computation streamed prompt groups (#65)
mununumu Jul 16, 2026
8b23346
docs(deepeyes-v2): add adaptation pitfalls guide
Yangruipis Jul 11, 2026
7a0d52f
feat(opd): add core distillation plumbing
fxsc03 Jul 13, 2026
cd0b760
support qwen3.6 multimodal qat
GUOGUOPOT Jun 22, 2026
4f2a97b
refactor(warmup): extend HF page-cache warmup to genrm and teacher
Yangruipis Jul 10, 2026
7f5ac76
fix(rollout): throttle data-system wait log
Yangruipis Jul 13, 2026
a19a39e
refactor(utils): merge relax.tools into relax.utils
Yangruipis Jul 13, 2026
1c247ef
feat(sglang): upgrade to v0.5.12.post1-cu129
yuanlehome Jul 9, 2026
197cef2
chore: uncommit kimi 2-layer smoke launcher and sglang upgrade-plan d…
yuanlehome Jul 14, 2026
3598a26
feat(quant-cast): add streaming FP8 export
Yangruipis Jul 15, 2026
5855d64
fix(distributed): use version parse for pg_options name
Jul 15, 2026
3de9a89
fix(sft): multimodal data process
GUOGUOPOT Jul 15, 2026
f0cdde4
fix(multimodal): eager-decode images to survive fd close on flaky NFS
xiaoliang0601 Jul 15, 2026
fac6ba0
fix(sft): preserve Qwen tool-call thinking
Yangruipis Jul 16, 2026
143e72e
fix(examples): correct CISPO script paths and disable KL loss (#72)
fxsc03 Jul 17, 2026
f061244
fix(deps): pin FastAPI for Ray Serve (#74)
Yangruipis Jul 17, 2026
a8f8802
fix(opd): fix opd scripts (#70)
kkyyxhll Jul 20, 2026
b055f8d
docs(installation): update official image (#75)
Yangruipis Jul 20, 2026
1094df9
feat(models): qwen3-0.6B.sh (#79)
Baiiiii126 Jul 22, 2026
05fc68f
chore(opd): update Math OPD training recipe (#84)
kkyyxhll Jul 25, 2026
cbf09f0
fix(training): handle unknown GPU metrics (#80)
Dayuxiaoshui Jul 27, 2026
3a123d5
fix(streaming): per-window quota to fix DP-imbalance deadlock
NINGBENZHE Jul 20, 2026
b7194e7
feat(arguments): check TransferQueue version for fully-async
NINGBENZHE Jul 20, 2026
13c5075
feat(model): support lora training for dense model
GUOGUOPOT Jul 21, 2026
3b1db0f
feat(rollout): support multi-record exports
dirtyDan0 Jul 22, 2026
42dda50
fix(peft): clearer error when Megatron-Bridge lacks PEFT
Yangruipis Jul 22, 2026
c422eba
feat(ppo): add PPO algorithm end-to-end
Yangruipis Jul 23, 2026
3f3f606
feat(sft): support 128K Qwen3.5 397B training
Yangruipis Jul 23, 2026
73a8b87
fix(megatron): tolerate missing MTP export keys
NINGBENZHE Jul 23, 2026
787b80f
fix(megatron): correct GDN context-parallel all-gather grads & guards
NINGBENZHE Jul 24, 2026
8a2d2e0
fix(ci): isolate Megatron-free tests
Yangruipis Jul 27, 2026
42f53f8
fix(convert): reconcile HF export index and supplement missing MTP (#…
circleLZY Jul 28, 2026
022ff82
【No.11】test(data): add unit tests for seqlen_balancing partitions (#90)
Saddss Jul 29, 2026
d0c79ab
test(data): cover multimodal prompt length filtering (#103)
xiaoh1024 Jul 29, 2026
b65b2ac
【No.16】feat(data): configurable media-encoding thread pool via --enco…
Saddss Jul 29, 2026
cfebed8
test(training): cover GRPO return and KL utils (#128)
Dayuxiaoshui Jul 29, 2026
e8eefc9
【No.10】 test(rewards): add DAPO math utils coverage (#94)
howtomakeaname Jul 29, 2026
5260b36
feat(rewards): format-aware reward router with registry and fallback …
DreamEnding Jul 30, 2026
5ebed6c
feat(klx): add qwen35-35B-vl, qwen36-35B support and performance opti…
grootZ Jul 30, 2026
87e1452
feat(rewards): run sync custom rewards in worker pool (#181)
sidneychang Jul 30, 2026
d310482
feat(rollout): Optimize multi-turn Rollout request scheduling (#127)
overloadedHenry Jul 30, 2026
c83741d
perf(megatron): backport upstream frozen-weight DGRAD fold to the ima…
leohuang257 Jul 30, 2026
b25f8fd
test(multimodal): cover image preprocessing utilities (#107)
MaybeIcanShow Jul 30, 2026
ef60b8f
fix(megatron): make FP16 optimizer settings configurable (#146)
huxy1225-cloud Jul 31, 2026
278c1e0
feat(sdpo): add SDPO-lite training path
ZiyiTsang Jul 31, 2026
30b74af
feat(megatron): add selective CPU offload as an alternative to torch_…
yeqinghe609 Aug 3, 2026
64b68e5
feat(examples): integrate nemo-gym agentic environments (#179)
Yangruipis Aug 3, 2026
864857f
feat(sdpo): add Relax-SDPO training path
ZiyiTsang Aug 4, 2026
0e06348
fix(genrm): stabilize GenRM colocate init and offload
NINGBENZHE Jul 27, 2026
4c52f6a
feat: migrate ark feature and fix to dev
li126com Jul 27, 2026
3bb8a1f
fix(checkpoint): alias renamed transfer_queue enum
yxyOo Jul 28, 2026
25ac0ac
fix(sft): support dynamic CP evaluation
Yangruipis Jul 28, 2026
4761069
feat(mopd): 9B recipe + data-prep/reward fixes
fxsc03 Jul 29, 2026
fbe4046
fix(sglang): detect dead engines when flushing cache
li126com Jul 30, 2026
18968fb
fix(sft): support inline image URL inputs
Yangruipis Jul 30, 2026
1591881
fix(rollout): retry get() like post() so a transient router disconnec…
yuanlehome Jul 30, 2026
9431128
fix(deps): pin fastapi==0.136.0 to fix agentic 422
yuanlehome Jul 30, 2026
fd77086
feat(utils): centralize environment variable access
li126com Jul 31, 2026
89cf658
fix(dcs): keep training alive when a scale-out rollout engine dies
RexFlux Jul 31, 2026
4954568
feat(training): add Qwen3.5-35B-A3B VPP script
yuanlehome Aug 3, 2026
b9fb758
feat(example): add mini-swe-agent example
yxyOo Aug 3, 2026
6f79010
fix(sglang): support DP-aware router workers
yuanlehome Aug 3, 2026
719309b
feat(service): affinitize baseline roles to stable worker-group via c…
RexFlux Aug 4, 2026
e9a4870
fix(opd): fix opd scripts (#70)
NINGBENZHE Aug 4, 2026
22c64e9
fix(ci): skip optional backend test deps
NINGBENZHE Aug 4, 2026
8893612
test(megatron): guard unavailable backend import
ZiyiTsang Aug 4, 2026
e63049c
【No.017】Replace DeepEyes processor file override with dynamic registr…
A-Words Aug 4, 2026
f5ba4ab
test(sdpo): refine SDPO validation baseline
ZiyiTsang Aug 5, 2026
6cc82d2
feat(sdpo): add EMA teacher weight updates
ZiyiTsang Aug 5, 2026
69c4e37
fix(sdpo): finalize EMA teacher publishing
ZiyiTsang Aug 5, 2026
6954be4
fix(sdpo): complete teacher publish flow
ZiyiTsang Aug 6, 2026
8d200e9
merge: finalize SDPO EMA teacher path
ZiyiTsang Aug 6, 2026
902ebb0
merge: sync upstream main
ZiyiTsang Aug 6, 2026
4152ed6
refactor(opd): reuse feedback and generic loss
ZiyiTsang Aug 6, 2026
8cda947
Merge remote-tracking branch 'upstream/main' into sdpo
ZiyiTsang Aug 6, 2026
0982fa7
feat(klx): add qwen35-9B-vl script (#249)
yeqinghe609 Aug 6, 2026
4c2f8b9
feat(rl): implement REINFORCE++ variants with global normalization (#…
zheself Aug 6, 2026
82b7117
fix(sdpo): derive project root in settings
ZiyiTsang Aug 6, 2026
e9cd530
Merge remote-tracking branch 'upstream/main' into sdpo
ZiyiTsang Aug 10, 2026
efff599
feat(opd): add SDPO feedback plumbing
ZiyiTsang Aug 10, 2026
19d687a
docs: add Relax-SDPO README
ZiyiTsang Aug 10, 2026
0d0f08c
fix(opd): align SDPO with upstream math
ZiyiTsang Aug 10, 2026
becf6a4
refactor(opd): gate OPD sample mask into loss masks instead of denomi…
ZiyiTsang Aug 11, 2026
812fe06
docs(sdpo): polish SDPO example README for new users
ZiyiTsang Aug 11, 2026
85355d8
feat(sdpo): switch example launchers to EMA teacher and auto-enable t…
ZiyiTsang Aug 11, 2026
ac7670d
chore(sdpo): simplify launcher context config and drop cuda-graph dis…
ZiyiTsang Aug 11, 2026
abaf55d
refactor(sdpo): unify env config in env.yaml
ZiyiTsang Aug 16, 2026
47329b1
feat(sdpo): implement METH distillation decision matrix
ZiyiTsang Aug 17, 2026
5ad1497
refactor(sdpo): default example launchers to static teacher update
ZiyiTsang Aug 17, 2026
8986ec7
# 🐛 fix
ZiyiTsang Aug 18, 2026
439486b
feat(sdpo): upgrade all launchers to 4-GPU TP=4 colocate
ZiyiTsang Aug 18, 2026
857b3fe
refactor(sdpo): revert megatron internals to PR base
ZiyiTsang Aug 19, 2026
d31dc3b
refactor(sdpo): strip EMA teacher path and redundant validation
ZiyiTsang Aug 19, 2026
9d26fd9
chore(sdpo): remove REVIEWER_RESPONSE.md from PR branch
ZiyiTsang Aug 19, 2026
df8f29d
fix(sdpo): repair eval data args in launchers
ZiyiTsang Aug 21, 2026
3c5b995
chore(sdpo): tune launchers (env source, rollout/eval scaling)
ZiyiTsang Aug 22, 2026
f93473f
Merge remote-tracking branch 'upstream/main' into sdpo
ZiyiTsang Aug 22, 2026
ff7d1f2
fix(sdpo): keep configs/env.yaml tracked, align .gitignore with upstream
ZiyiTsang Aug 22, 2026
9da912b
style: apply pre-commit formatting fixes from upstream merge
ZiyiTsang Aug 22, 2026
3201cb9
chore: drop unnecessary copyright header from tensor_backper.py and t…
ZiyiTsang Aug 22, 2026
5a83435
fix(examples): pairwise tooluse reward scoring
ZiyiTsang Aug 24, 2026
75c74fc
refactor(opd): per-algorithm feedback strategies
ZiyiTsang Aug 24, 2026
139cd93
refactor(opd): unify feedback strategies
ZiyiTsang Aug 24, 2026
1026a77
Merge remote-tracking branch 'upstream/main' into sdpo
ZiyiTsang Aug 26, 2026
edf2d80
fix(ci): stub sglang modules in opd teacher colocate arguments tests
ZiyiTsang Aug 26, 2026
4c2864e
refactor(opd): drop dead code and ghost test attrs
ZiyiTsang Aug 27, 2026
8f4b9a2
feat(sdpo): unify 4xgpu launchers and params
ZiyiTsang Aug 27, 2026
f8054a1
refactor(opd): drop redundant state.feedback alias
ZiyiTsang Aug 30, 2026
adcefb8
revert(opd): keep existing recipes unchanged
ZiyiTsang Aug 30, 2026
155c4e0
feat(opd): add --opd-feedback-kwargs binding
ZiyiTsang Aug 30, 2026
0d50b1f
style(sdpo): fix pre-commit formatting violations
ZiyiTsang Aug 30, 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
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ SGLANG_ARGS=(
--sglang-mem-fraction-static 0.8
--sglang-load-format dummy
--sglang-enable-weights-cpu-backup
--sglang-disable-cuda-graph
)

RESOURCE_JSON="{\"actor\": [1, ${ACTOR_GPUS}], \"rollout\": [1, ${ROLLOUT_GPUS}], \"teacher\": [1, ${TEACHER_GPUS}]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ SGLANG_ARGS=(
--sglang-max-running-requests 128
--sglang-load-format dummy
--sglang-enable-weights-cpu-backup
--sglang-disable-cuda-graph
)

PARTIAL_ROLLOUT_ARGS=(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ SGLANG_ARGS=(
--sglang-mem-fraction-static 0.7
--sglang-load-format dummy
--sglang-enable-weights-cpu-backup
--sglang-disable-cuda-graph
)

RESOURCE_JSON="{\"actor\": [1, ${ACTOR_GPUS}], \"rollout\": [1, ${ROLLOUT_GPUS}], \"teacher\": [1, ${TEACHER_GPUS}]}"
Expand Down
416 changes: 416 additions & 0 deletions examples/on_policy_distillation/sdpo/README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/on_policy_distillation/sdpo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (c) 2026 Relax Authors. All Rights Reserved.

"""Minimal static-teacher SDPO examples for Relax."""
261 changes: 261 additions & 0 deletions examples/on_policy_distillation/sdpo/prepare_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
# Copyright (c) 2026 Relax Authors. All Rights Reserved.

"""Prepare the reference SDPO SciKnowEval and ToolAlpaca data for Relax."""

from __future__ import annotations

import argparse
import json
import logging
import random
from pathlib import Path
from typing import Any, Iterable


logger = logging.getLogger(__name__)
TARGET_DOMAINS = frozenset({"Chemistry", "Physics", "Biology", "Materials"})


def _read_jsonl(path: Path) -> list[dict[str, Any]]:
with path.open(encoding="utf-8") as handle:
return [json.loads(line) for line in handle if line.strip()]


def _read_rows(path: Path) -> list[dict[str, Any]]:
if path.suffix.lower() in {".jsonl", ".json"}:
if path.suffix.lower() == ".jsonl":
return _read_jsonl(path)
text = path.read_text(encoding="utf-8").strip()
try:
value = json.loads(text)
except json.JSONDecodeError:
return _read_jsonl(path)
return value if isinstance(value, list) else [value]
if path.suffix.lower() == ".parquet":
import pyarrow.parquet as parquet

return parquet.read_table(path).to_pylist()
raise ValueError(f"Unsupported input format: {path}")


def _canonical_domain(value: Any) -> str:
normalized = str(value or "").strip().casefold()
if normalized == "material":
return "Materials"
return normalized.capitalize()


def _json_text(value: Any) -> str:
if isinstance(value, str):
return value
return json.dumps(value, ensure_ascii=False, sort_keys=True)


def _normalize_sciknoweval_row(
row: dict[str, Any],
*,
source_split: str,
domain: str | None,
) -> dict[str, Any] | None:
if row.get("dataset") == "sciknoweval" and isinstance(row.get("prompt"), str) and "answer" in row:
normalized_domain = _canonical_domain(domain)
if normalized_domain not in {"Chemistry", "Physics", "Biology", "Materials"}:
return None
prompt = str(row["prompt"]).strip()
system = str(row.get("system") or "").strip()
if system:
prompt = f"{system}\n\n{prompt}"
answer = row.get("answer", "")
metadata = {
"data_source": "sciknoweval",
"source_split": source_split,
"domain": normalized_domain,
"task_type": str(row.get("kind", "mcq")),
"answer_key": answer,
"source_index": row.get("idx"),
}
return {"prompt": prompt, "label": _json_text(answer), "metadata": metadata}

details = row.get("details") or {}
if not isinstance(details, dict) or str(details.get("level", "")).upper() != "L3":
return None

source_domain = _canonical_domain(row.get("domain"))
if source_domain not in TARGET_DOMAINS:
return None

choices = row.get("choices") or {}
choice_lines = [
f"{label}: {text}" for label, text in zip(choices.get("label") or [], choices.get("text") or [], strict=False)
]
prompt_value = row.get("prompt", {})
prompt_default = prompt_value.get("default", "") if isinstance(prompt_value, dict) else prompt_value
question = str(row.get("question") or prompt_default).strip()
prompt = question
if choice_lines:
prompt = f"{question}\n\n" + "\n".join(choice_lines)
prompt += "\n\nReason carefully and provide the final answer."

normalized_domain = source_domain
answer = row.get("answerKey") or row.get("answer", "")
metadata = {
"data_source": "sciknoweval",
"source_split": source_split,
"domain": normalized_domain,
"task_type": str(row.get("type", "unknown")),
"answer_key": answer,
}
return {"prompt": prompt, "label": _json_text(answer), "metadata": metadata}


def _normalize_tool_row(row: dict[str, Any], *, source_split: str, dataset: str) -> dict[str, Any] | None:
if row.get("dataset") == "tooluse" and isinstance(row.get("prompt"), str) and "answer" in row:
answer = row.get("answer", "")
try:
golden_answer = json.loads(answer) if isinstance(answer, str) else answer
except json.JSONDecodeError:
golden_answer = answer
prompt = str(row.get("prompt", "")).strip()
metadata = {
"data_source": "tooluse",
"source_split": source_split,
"task_type": str(row.get("kind", "tooluse")),
"golden_answer": golden_answer,
"source_index": row.get("idx"),
}
return {"prompt": prompt, "label": _json_text(answer), "metadata": metadata}

if dataset != "toolalpaca" or "golden_answer" not in row:
return None

name = str(row.get("name", "")).strip()
description = str(row.get("description", "")).strip()
documentation = str(row.get("nl_documentation", "")).strip()
instruction = str(row.get("instruction", row.get("prompt", ""))).strip()
prompt = (
"You are given an API specification and a user request. Select the correct tool and "
"emit the tool call using exactly:\n"
"Action: <tool name>\nAction Input: <JSON object>\n\n"
f"Tool name: {name}\n"
f"Tool description: {description}\n"
f"Tool documentation:\n{documentation}\n\n"
f"User request:\n{instruction}"
)
golden_answer = row.get("golden_answer") or []
metadata = {
"data_source": "toolalpaca",
"source_split": source_split,
"task_type": "tool_call",
"golden_answer": golden_answer,
}
return {"prompt": prompt, "label": _json_text(golden_answer), "metadata": metadata}


def _normalize_relax_row(row: dict[str, Any], *, source_split: str) -> dict[str, Any] | None:
if not isinstance(row.get("prompt"), str) or "label" not in row:
return None
metadata = row.get("metadata")
if not isinstance(metadata, dict):
metadata = {}
metadata = dict(metadata)
metadata.setdefault("source_split", source_split)
return {"prompt": row["prompt"], "label": row["label"], "metadata": metadata}


def normalize_rows(
dataset: str,
rows: Iterable[dict[str, Any]],
*,
source_split: str,
domain: str | None = None,
) -> list[dict[str, Any]]:
"""Convert one supported source schema into Relax's prompt-data schema."""
if dataset not in {"sciknoweval", "toolalpaca", "tooluse"}:
raise ValueError(f"Unsupported SDPO dataset {dataset!r}")
if source_split not in {"train", "test"}:
raise ValueError(f"Unsupported source split {source_split!r}; expected 'train' or 'test'")

normalized_rows = []
for row in rows:
normalized = _normalize_relax_row(row, source_split=source_split)
if normalized is None:
normalized = (
_normalize_sciknoweval_row(row, source_split=source_split, domain=domain)
if dataset == "sciknoweval"
else _normalize_tool_row(row, source_split=source_split, dataset=dataset)
)
if normalized is not None:
normalized_rows.append(normalized)
return normalized_rows


def _write_jsonl(path: Path, rows: list[dict[str, Any]]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
with path.open("w", encoding="utf-8") as handle:
for row in rows:
handle.write(json.dumps(row, ensure_ascii=False) + "\n")


def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--dataset", choices=("sciknoweval", "toolalpaca", "tooluse"), required=True)
parser.add_argument("--input", required=True, type=Path)
parser.add_argument("--output", required=True, type=Path)
parser.add_argument("--source-split", choices=("train", "test"), required=True)
parser.add_argument(
"--domain",
default=None,
help="SciKnowEval domain for the reference flat format; defaults to the input parent directory name.",
)
parser.add_argument("--max-rows", type=int, default=None, help="Optionally limit output rows for a smoke run.")
parser.add_argument(
"--eval-ratio",
type=float,
default=0.0,
help=(
"Fraction of normalized rows to hold out as an eval set. When >0, the held-out rows are "
"written to <output.parent>/eval.jsonl and the rest to --output (train). "
"Useful for a train/test split when only a single train source is available."
),
)
parser.add_argument("--seed", type=int, default=42, help="Seed for the eval/validation split.")
args = parser.parse_args()

if args.max_rows is not None and args.max_rows < 0:
parser.error("--max-rows must be non-negative")
if not 0.0 <= args.eval_ratio < 1.0:
parser.error("--eval-ratio must be in [0, 1)")

rows = _read_rows(args.input)
domain = args.domain or args.input.parent.name
normalized = normalize_rows(args.dataset, rows, source_split=args.source_split, domain=domain)
if args.max_rows is not None:
normalized = normalized[: args.max_rows]
if not normalized:
raise ValueError(f"No rows matched dataset={args.dataset!r} from input {args.input}")

if args.eval_ratio > 0.0:
n_eval = int(round(len(normalized) * args.eval_ratio))
if n_eval == 0:
raise ValueError(
f"--eval-ratio {args.eval_ratio} with {len(normalized)} rows yields 0 eval rows; "
"raise the ratio or add more input rows."
)
rng = random.Random(args.seed)
indices = list(range(len(normalized)))
rng.shuffle(indices)
eval_indices = set(indices[:n_eval])
train_rows = [r for i, r in enumerate(normalized) if i not in eval_indices]
eval_rows = [r for i, r in enumerate(normalized) if i in eval_indices]
_write_jsonl(args.output, train_rows)
eval_path = args.output.with_name("eval.jsonl")
_write_jsonl(eval_path, eval_rows)
logger.info(
f"Split into train ({len(train_rows)} rows) and eval ({len(eval_rows)} rows); eval written to {eval_path}"
)
else:
_write_jsonl(args.output, normalized)


if __name__ == "__main__":
main()
Loading
Loading