Skip to content

Consolidate exact trainer-serving parity - #57

Merged
kiddyboots216 merged 69 commits into
mainfrom
pr/consolidated-exact-rl
Aug 16, 2026
Merged

Consolidate exact trainer-serving parity#57
kiddyboots216 merged 69 commits into
mainfrom
pr/consolidated-exact-rl

Conversation

@kiddyboots216

@kiddyboots216 kiddyboots216 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This consolidates the exact trainer-side work previously split across the earlier XoRL PRs into one branch based directly on main. It is paired with togethercomputer/xorl-sglang#21.

Highlights

  • Adds exact trainer-serving programs for dense and MoE Qwen3.x, GLM-5.2, and DeepSeek-V4, including one-round SwiGLU, exact GDN/attention/head paths, canonical routing replay, and decision-time logprob replay.
  • Supports physical pipeline-parallel training for the exact model paths, carrying model-owned boundary state and ragged metadata while dispatching terminal CE, policy, IS, DRGRPO, CISPO, and ordinary OPD objectives.
  • Composes logical row ownership across mixed DP × CP layouts for GLM and DeepSeek, including ragged rows, DP-aware LoRA/expert routing, and DeepSeek PP × CP storage/wire handling.
  • Replays per-row temperature, top-k, top-p, and min-p from normalized serving metadata.
  • Uses one canonical local MoE arithmetic contract across Qwen, GLM, and DeepSeek: BF16/FP16 transport, deterministic source ordering, FP32 leaf and adjacent/odd-tail tree accumulation, then one final output cast.
  • Retains GLM-5.2 full-parameter block-FP8 training, including scoped trainable components, frozen-trunk backward, optimizer/cache refresh, and full-weight publication.
  • Includes routed-expert replay throughput/side-channel integration and CISPO loss support.

Validation

  • Focused suites cover real PP2 × CP2 DeepSeek forward/backward, physical-PP objectives, mixed and ragged ownership, exact sampling replay, canonical MoE arithmetic, and GLM full-parameter wiring.
  • Cross-engine GPU checks compare the independent trainer and serving leaf/fold implementations for BF16 and FP16 contributor payloads.
  • Changed-range hygiene and focused validation pass locally; GitHub checks are tracked on this PR.

Companion serving change

Out of scope

Sparse-delta receiver integration is intentionally not included.

@broly-code-security-scanner

broly-code-security-scanner Bot commented Aug 13, 2026

Copy link
Copy Markdown

Broly Security Scan

Note

Summary

4 actionable finding(s) in this PR
5 total in scan · 0 dismissed false positives

  • 🟡 4 medium

All actionable items are in the table below.

1 finding(s) below the medium reporting threshold are not listed above — see the repository Security tab for the full set.

No finding is at or above high, so this check is not blocking. The findings above are still tracked and reported.

Severity Scanner Issue Location Dismiss Verdict
🟡 MEDIUM SAST Arbitrary file deletion via R3SourceFilesCleanup
using attacker-controlled paths
src/xorl/server/orchestrator/request_processor.py:555 d53 🔺 TRUE_POSITIVE · Confidence: HIGH
🟡 MEDIUM SAST Path traversal via R3 source path validation
bypass using symlinks
src/xorl/server/orchestrator/request_processor.py:407 d52 🔺 TRUE_POSITIVE · Confidence: HIGH
🟡 MEDIUM SAST Unsafe deserialization of PyTorch files via
torch.load from an environment-controlled path.
src/xorl/server/runner/model_runner.py:2893 d54 🔺 TRUE_POSITIVE · Confidence: HIGH
🟡 MEDIUM SAST Unsafe deserialization via torch.from_file of
attacker-controlled file paths in SGLang R3
routi...
src/xorl/server/runner/runner_dispatcher.py:1499 d55 🔺 TRUE_POSITIVE · Confidence: HIGH

Dismiss false positives

Tick a box to dismiss the finding; untick it to bring the finding back. That is the same as replying /broly dismiss d1 and /broly undismiss d1. To record why it is a false positive, reply with /broly dismiss d1: your reason instead — Broly reuses those reasons to triage similar findings across the org.

  • d52 · 🟡 MEDIUM   · src/xorl/server/orchestrator/request_processor.py:407 · Path traversal via R3 source path validation bypass using symlinks
  • d53 · 🟡 MEDIUM   · src/xorl/server/orchestrator/request_processor.py:555 · Arbitrary file deletion via R3SourceFilesCleanup using attacker-controlled paths
  • d54 · 🟡 MEDIUM   · src/xorl/server/runner/model_runner.py:2893 · Unsafe deserialization of PyTorch files via torch.load from an environment-...
  • d55 · 🟡 MEDIUM   · src/xorl/server/runner/runner_dispatcher.py:1499 · Unsafe deserialization via torch.from_file of attacker-controlled file path...

Note

Re-scan this PR anytime with /broly scan — useful after /broly undismiss, or to refresh findings without a new push.

Broly — SAST (zai-org/GLM-5.2) · Secrets · SCA · IaC · GH Actions · Base Images · Supply Chain Threats · Exploit Chains · Adversarial Verification

We're continuously improving Broly's accuracy and finding quality — your feedback is valuable. False positives, missed findings, bugs, and feature requests all welcome.

Ask in #security-engineering   Powered by Together AI

Comment thread scripts/replay_dsv4_exact_trace.py Fixed
@kiddyboots216
kiddyboots216 marked this pull request as ready for review August 13, 2026 19:47
@kiddyboots216
kiddyboots216 force-pushed the pr/consolidated-exact-rl branch 2 times, most recently from b0ad7c3 to 6a62d38 Compare August 13, 2026 20:21
Comment thread src/xorl/ops/kernel_config_pin.py Fixed
@kiddyboots216
kiddyboots216 force-pushed the pr/consolidated-exact-rl branch 3 times, most recently from 3b0ccb2 to 19c4328 Compare August 14, 2026 13:39
Comment thread src/xorl/server/runner/runner_dispatcher.py Fixed
@kiddyboots216
kiddyboots216 force-pushed the pr/consolidated-exact-rl branch from 19c4328 to 8156138 Compare August 14, 2026 15:37
Comment thread src/xorl/server/runner/runner_dispatcher.py Fixed
Comment thread src/xorl/server/runner/runner_dispatcher.py Fixed
Comment thread src/xorl/server/orchestrator/request_processor.py Fixed
Comment thread src/xorl/ops/kernel_config_pin.py Fixed
Comment thread src/xorl/server/orchestrator/request_processor.py Fixed
Comment thread src/xorl/server/orchestrator/request_processor.py Fixed
Round canonical MoE FP64 accumulators directly to low precision and use the current XoRL exact target.

Publish HSDP adapter ownership and restore optimizer state safely across coherent replica-size changes.
Comment on lines +555 to +561
if isinstance(cleanup, R3SourceFilesCleanup):
for path in cleanup.paths:
try:
path.unlink(missing_ok=True)
except Exception as exc:
logger.warning("Failed to clean SGLang R3 source file %s: %s", path, exc)
return
if rows == 0:
pieces.append(torch.empty((0, *shape[1:]), dtype=expected_dtype))
continue
storage = torch.from_file(str(path), shared=False, size=path.stat().st_size // 4, dtype=expected_dtype)
Comment on lines +75 to +79
stub_dir = Path("/tmp/xorl-nvidia-ml-stub")
stub_dir.mkdir(exist_ok=True)
soname = stub_dir / "libnvidia-ml.so.1"
if not soname.exists():
soname.symlink_to(stub)
@kiddyboots216
kiddyboots216 merged commit e2472d2 into main Aug 16, 2026
3 checks passed
@kiddyboots216
kiddyboots216 deleted the pr/consolidated-exact-rl branch August 17, 2026 23:41
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.

3 participants