Skip to content

[shardformer]: support Ouro checkpointed data-parallel training - #6567

Open
kiseki-zj wants to merge 22 commits into
mainfrom
codex/ouro-2d4
Open

kiseki-zj wants to merge 22 commits into
mainfrom
codex/ouro-2d4

Conversation

@kiseki-zj

@kiseki-zj kiseki-zj commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Enable Ouro shared decoder layers to train with gradient checkpointing and data-parallel Booster plugins. Also fix Gemini CPU-offloaded model exports taken immediately after an optimizer step, which could previously contain stale working-shard weights.

Targets main. The prerequisite HF5 model adapters in #6507 have been merged, and this branch now includes main at da3df39e. The diff contains the Ouro 2D4 increment and a focused cleanup of GPU CI source fetching now that runner connectivity is restored.

Changes

  • Support non-reentrant checkpointing of every Ouro decoder layer across repeated loop iterations, default HF reload to eager attention, and handle official configs without pad_token_id.

  • Export the latest paired master weights when a Gemini CPU-offloaded working shard is stale, preserving export dtype and live chunk placement.

  • Register both pinned Ouro snapshots in the model zoo, with lazy construction and source-only, hash-verified offline fixtures.

  • Add independent-reference numerical checks for gradients, updates, accumulation and resume across DDP, ZeRO, Gemini and FSDP; include the new tests in the GPU CI batch.

  • Extend the numerical tool's precision recipe only for the validated static, fully sharded Gemini BF16 CPU-optimizer-offload configuration. Numerical tolerances are unchanged.

  • Restore direct, credential-free shallow Git fetches on the GPU runner, removing the hosted source-artifact relay while retaining exact-commit verification, Git integrity checks, bounded retries and source-checkout regressions. Proxy configuration is managed on the runner.

  • Integrate the upstream benchmark worker teardown fix, rename the Gemma4 GPU test modules to avoid collisions with CPU test modules, and retry only distributed rendezvous address-in-use failures in the Gemma4 and ZeRO checkpoint tests.

  • Use isolated file rendezvous for the single-rank worker lifecycle regression, preserving real process group creation and cleanup without a TCP port-allocation race.

Validation

GitHub Actions on final head 087afceb passed on 2026-11-25: Layer 1 CPU (338 passed, 613 skipped), Fork-safe CPU/lint, formatting, documentation, requirements compatibility, and the GPU gate. GPU batches recorded 23 passed / 2 skipped (single-GPU core), 22 passed (FP8), and 416 passed / 1 skipped (two-GPU training). The two-GPU batch includes all 60 Ouro training cases, 14 Ouro model-zoo cases, and 4 Gemini offloaded-export cases.

Development-container validation on 2026-11-18, PyTorch 2.13.0+cu130 and Transformers 5.17.0, using two H20 GPUs:

  • 141 CPU regression tests passed; 14 Ouro CPU tests also passed with an empty HF cache.
  • All 80 distinct GPU acceptance cases have passing records. The initial batch was 79 passed / 1 port-collision failure; a targeted rerun of four related cases passed.
  • 16 existing Gemini master/resume tests and 84 CI runner tests passed; applicable pre-commit checks passed.
  • Full Ouro-1.4B and Ouro-2.6B weights: bitwise forward logits/loss alignment and one single-GPU BF16 ZeRO-2 backward/update with checkpointing, with all gradients finite.

After merging main on 2026-11-18, the exact merge tree also passed 223 CPU regressions, 15 targeted two-GPU regressions (Ouro alignment, Gemini accumulation/resume and offloaded weight export), 84 CI runner tests, and applicable pre-commit checks.

CI transport validation: all 83 CI helper tests and applicable pre-commit checks passed; the six source-checkout regressions also passed under the runner system Python. The edited workflow step fetched and verified the exact PR merge commit on H20 in 4.27 seconds.

After merging main on 2026-11-25, development-container checks passed: 15 targeted Ouro/Gemini training, accumulation, resume and offloaded-export cases; 7 CI regressions including forced rendezvous port collisions and numerical-error propagation; 83 CI helper tests; and applicable pre-commit checks. The committed tree matches the validated server tree.

These results are from development-container validation; current GitHub Actions results are shown in the PR checks.

The final single-rank rendezvous change passed all 9 worker cleanup and Gloo callback regressions under PyTorch 2.5.1+cpu, plus applicable pre-commit checks.

Scope

Eager full attention, no KV cache, default full-head RoPE, contiguous positions, and non-reentrant per-layer checkpointing. This does not validate TP/PP/SP/EP, fused kernels, FP8, activation offload, generation, full-size gradient L2 alignment, long contexts, convergence, or performance. LLaDA 2D2/2D3 changes are not included.

kiseki-zj and others added 17 commits October 30, 2026 14:36
Add isolated remote-code adapters and native nonparallel policies for LLaDA, LLaDA2.1/2.2, and Ouro. Preserve official computation while adapting HF5 construction, masks, and checkpoint metadata.

Include pinned tiny fixtures, reusable 2D1 probes, and compatibility documentation. Validation: 105 CPU FP32 tests passed with Transformers 5.17.0 and PyTorch 2.13.0.
Retain both Gemma4 and LLaDA/Ouro policy registrations. Run documentation PR checks on hosted Ubuntu with explicit Python, Node, Yarn, and CPU Torch dependencies.

Validation: 191 passed and 40 skipped in the unmodified CPU CI command on Ubuntu 24.04/Python 3.10.22/Torch 2.5.1 CPU; 97 model regressions and 78 CI policy tests passed; pre-commit passed.
The clean hosted runner exposes the old doc-builder missing requests in its dependency metadata. Install it before docer imports the builder. Validated CLI startup, pip check, complete API documentation conversion, and formatting in the development container.
Record periodic tracebacks and exit markers through CPU-only site initialization, preserving python -m pytest and the existing timeout and test selection. This diagnoses intermittent distributed worker stalls without changing model code or numerical checks.

Validation: 80 CI helper tests passed, including real spawned-worker stack capture and failure exit status; the complete Ubuntu 24.04/Python 3.10.22 CPU gate passed with 191 passed and 40 skipped; formatting checks passed.
…r PR

Remove the 2D1 investigation scripts and development notes from the PR tree.
Document direct pytest invocation while preserving production adapters,
regression tests, CI fixes, and local development copies.
Merge the adapter PR cleanup and retain phase-two investigation scripts
only in local development copies. Document direct test commands and
validation boundaries without changing verified implementation or tests.
@kiseki-zj
kiseki-zj requested a review from a team as a code owner November 18, 2026 08:35
@kiseki-zj
kiseki-zj changed the base branch from feat/support_llada_and_ouro to main November 18, 2026 08:46
Resolve the squashed adapter overlap while preserving the Ouro 2D4
implementation and the latest main attention and benchmark CI entries.
Remove the hosted source-artifact relay now that runner connectivity works.
Keep isolated credential-free shallow checkouts, bounded retries, exact-SHA
verification and source-integrity regressions. Proxy settings remain local
to the runner environment.
Include the upstream benchmark worker teardown fix, give Gemma4 GPU tests unique module names, and use bounded address-in-use retries for Gemma4 and ZeRO checkpoint tests.
Use a per-test FileStore for the single-rank lifecycle regression so port allocation races cannot fail before the cleanup checks. Preserve real process group initialization, error propagation and barrier assertions.
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.

1 participant