Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
63beff7
feat(dynamics): separate NeRD models, data generation and training
yuecideng Oct 24, 2026
a58de92
docs(dynamics): register the offline workflow in architecture navigation
yuecideng Oct 24, 2026
cc1a67e
feat(sl): add shared supervised batch and optimizer update contracts
yuecideng Oct 24, 2026
dd52660
feat(sl): add shared supervised batch and optimizer update contracts
yuecideng Oct 24, 2026
8408d9f
feat(sl): add offline run recovery and recipe-based train-sl CLI
yuecideng Oct 24, 2026
11142d5
test(sl): register the supervised learning context domain
yuecideng Oct 24, 2026
9430346
Merge standalone NeRD foundation for the supervised learning stack
yuecideng Oct 24, 2026
77869ee
fix(sl): accept argument lists from the unified CLI dispatcher
yuecideng Oct 24, 2026
3af58e9
Merge shared SL foundation into NeRD integration
yuecideng Oct 24, 2026
736a127
test(sl): isolate supervised test modules from dynamics tests
yuecideng Oct 24, 2026
1c1441f
feat(sl): integrate NeRD fitting and reference acceptance
yuecideng Oct 24, 2026
00b6a56
Merge branch 'codex/sl-foundation' into codex/sl-nerd
yuecideng Oct 24, 2026
1395871
fix(sl): isolate metadata and validate optimizer recovery before muta…
yuecideng Oct 24, 2026
23b4519
Merge branch 'codex/sl-foundation' into codex/sl-nerd
yuecideng Oct 24, 2026
8ed70f1
docs(sl): link the standalone NeRD training integration
yuecideng Oct 24, 2026
6e5a861
fix(sl): bind scheduler and tensor-tree semantics during recovery
yuecideng Oct 24, 2026
e1b3cb1
Merge branch 'codex/sl-foundation' into codex/sl-nerd
yuecideng Oct 24, 2026
d591e78
fix(sl): reject duplicate NeRD acceptance seeds before startup
yuecideng Oct 25, 2026
a7668ad
Add shared SL updates, offline training and recovery (#857)
yuecideng Oct 25, 2026
abb6d43
feat(sl): add single-node DDP training and exact rank recovery
yuecideng Oct 25, 2026
9fd69c7
Merge latest main into NeRD and SL foundations
yuecideng Oct 25, 2026
31e2b90
Merge latest main before NeRD training hardening
yuecideng Oct 25, 2026
f03af34
Integrate NeRD with the shared supervised learner
yuecideng Oct 25, 2026
6dc47c3
fix(sl): preserve run identity, best models and NeRD recovery
yuecideng Oct 25, 2026
d9cd707
docs(sl): render NeRD adapters with explicit API directives
yuecideng Oct 25, 2026
2e99302
fix(nerd): validate statistics and preserve unnormalized model precision
yuecideng Oct 25, 2026
bed4b69
Merge latest main while preserving NeRD precision fixes
yuecideng Oct 25, 2026
60425ca
Merge latest main before moving NeRD out of the core
yuecideng Oct 25, 2026
048d147
refactor(models): move NeRD into extension and downloadable showcase
yuecideng Oct 25, 2026
fa16c60
Merge latest main after NeRD model extension migration
yuecideng Oct 25, 2026
60f9b07
fix(nerd): retain experiment root for comparison receipts
yuecideng Oct 25, 2026
2c9ee88
fix(nerd): repair asset downloads and remove dedicated unit tests
yuecideng Oct 25, 2026
f850a5e
docs(models): define policy and dynamics domain boundaries
yuecideng Oct 25, 2026
a1a77ce
Merge latest model extension and SL recovery base into DDP
yuecideng Oct 25, 2026
ba89775
fix(sl): preserve distributed NeRD export and run ownership coverage
yuecideng Oct 25, 2026
8dae1b3
merge: synchronize SL DDP with current main
yuecideng Oct 25, 2026
15b607a
feat(sl): bridge causal batch sources with explicit recovery admission
yuecideng Oct 25, 2026
6208a58
test(sl): verify resident SDK bridge identity
yuecideng Oct 25, 2026
b1d8ab4
test: align robot catalog checks with vendor layout
yuecideng Oct 25, 2026
f372f20
Include vendor catalog test compatibility for main CI
yuecideng Oct 25, 2026
6de738b
Synchronize the reviewed DDP base and shared CI compatibility
yuecideng Oct 25, 2026
21f1721
chore(sl): sync ODS bridge with latest main
yuecideng Oct 27, 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
2 changes: 1 addition & 1 deletion agent_context/MAP.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ topics:
- id: supervised-learning
title: Supervised Learning
aliases: [supervised learning, SL learning, 监督学习, 统一监督学习]
keywords: [train-sl, SupervisedBatch, LossResult, SupervisedObjective, SupervisedLearner, SupervisedTrainer, TensorBatchSource, distributed_run, torchrun, DDP, 单机多卡, 分布式监督学习]
keywords: [train-sl, SupervisedBatch, LossResult, SupervisedObjective, SupervisedLearner, SupervisedTrainer, TensorBatchSource, SequenceBatchSource, distributed_run, torchrun, DDP, 单机多卡, 分布式监督学习]
paths: [topics/supervised-learning/supervised-learning.md]
source_of_truth:
- embodichain/learning/sl/
Expand Down
5 changes: 5 additions & 0 deletions agent_context/topics/data-pipeline/data-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ requires explicit action semantics, step duration, field mapping and a resident
memory limit; imports do not initialize simulation or import the SDK until load.
The first backend samples resident numeric tensors after bounded SDK reads.

`learning/sl/sequence.py` bridges these sources through an explicit encoder;
the [SL context](../supervised-learning/supervised-learning.md) owns its identity
and recovery admission. Online lifecycle and delivery credits remain here.
Neither trainer RNG restoration nor encoding failure rewinds source quotas.

The demo's `lerobot.py` owns writing and sidecar/hash auditing around the public
reader. It measures initial loading rather than per-batch disk reads and does
not replace recording or offline-inspection tools. See the
Expand Down
19 changes: 18 additions & 1 deletion agent_context/topics/supervised-learning/supervised-learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ operations remain in `compute`; source storage belongs to data adapters.
update. Its optional numerical context covers forward, backward and clipping.
- `TensorBatchSource` snapshots fixed CPU tensor trees and returns owned samples
under the caller's explicit CPU generator.
- Optional `SequenceBatchSource` in `learning/sl/sequence.py` adapts a data-pipeline
`BatchSource` using an explicit versioned encoder. It preserves canonical masks
and provenance under reserved `metadata['sequence_source']`, excluding raw
observations/actions there. Encoders select causal inputs and supervision;
model families retain action/codec/objective semantics. Core SL imports do not
load this bridge, ODS or the SDK. See `examples/learning/sl_data_source/`.
- `SupervisedTrainer` in `learning/sl/trainer.py` composes a source and learner,
saving optimizer, RNG, sampling progress, source identity and recipe semantics.
- `embodichain train-sl --config FILE [--resume FILE]` lazily resolves a
Expand Down Expand Up @@ -41,6 +47,16 @@ replacement, so samples may overlap. All ranks call fitting, saving and recovery
only rank 0 writes artifacts or runs validation through the unwrapped model.
Schema, action/frame/timestep and numerical-policy identifiers belong in each
recipe's checkpoint signature. Tensor sources additionally bind content identity.
The sequence bridge defaults to refusing exact resume. Explicitly immutable,
unbudgeted resident sources bind actual CPU content, schema, window, encoder
version and semantic metadata (including language); storage diagnostics do not.
Sampling checks declarations, quota and tensor versions; resume rehashes content
in bounded blocks. An optional source `validate_resume()` preflight runs inside
the collective checkpoint validation before any trainer state or output admission
changes. Live buffers and delivery credits are not restored: such sources may
train/save snapshots, but exact continuation is rejected. Acquisition, waits,
refill and delivery debits stay source/caller-owned; encoding failures do not
refund a delivered context.
Distributed checkpoints retain each rank's RNG, sampler and buffers and require
the same world size for exact recovery. Inside rank 0's validation callback only,
a save uses the previously gathered committed-update snapshot without a new
Expand All @@ -62,4 +78,5 @@ nonfinite update boundaries, owned samples, simulator-free imports and exact
CPU recovery with dropout, optimizer and sampling state. Model-specific
qualification belongs to each model's acceptance recipe. The distributed tests
exercise weighted global updates and fixed-world-size recovery with CPU/Gloo;
the example is validated by launch smoke runs rather than example-specific tests.
sequence tests reuse real CPU source fixtures for masks, provenance, owned output,
quota and recovery admission. Examples use launch smoke checks, not tutorial tests.
37 changes: 37 additions & 0 deletions docs/source/api_reference/embodichain/embodichain.learning.sl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ embodichain.learning.sl
SupervisedLearner
SupervisedSource
TensorBatchSource
SequenceBatchSource
SupervisedTrainer
SupervisedTrainerCfg
distributed_run
Expand All @@ -124,6 +125,9 @@ embodichain.learning.sl
.. autoclass:: TensorBatchSource
:members:

.. autoclass:: SequenceBatchSource
:members:

.. autoclass:: SupervisedTrainer
:members:

Expand Down Expand Up @@ -155,6 +159,39 @@ embodichain.learning.sl.learner
.. autoclass:: SupervisedLearner
:members:

embodichain.learning.sl.sequence
--------------------------------

.. currentmodule:: embodichain.learning.sl.sequence

.. autosummary::

SequenceBatchSource

.. autoclass:: SequenceBatchSource
:members:

The optional bridge samples one canonical causal window and calls an explicit,
versioned encoder. It preserves original masks and provenance under the reserved
``metadata['sequence_source']`` namespace, excluding observations and actions
from that diagnostic context. The encoder deliberately selects measured inputs
and supervision; the adapter infers neither action meaning nor feature layout.
The runnable ``examples/learning/sl_data_source`` example demonstrates action
targets and causal state-transition targets using a tiny synthetic CPU corpus.

Exact recovery is disabled by default. ``immutable=True`` requires an unchanged,
content-hashed resident ``TensorDataSource`` (including ``LeRobotDataSource``)
without sampling quotas. Schema, window, encoder version, language and semantic
metadata enter identity; storage paths and read/cache diagnostics do not.
Construction and resume hash CPU content using bounded blocks. Sampling checks
the immutable promise without rehashing the corpus at every update.

Live or quota-managed sources can train and save snapshots, but exact
``SupervisedTrainer.resume()`` is rejected collectively before learning, RNG or
output admission state changes. Producer state and delivery credits are not
restored by the trainer. Start/stop, refill, waits and handling sampling failures
remain caller-owned; the bridge performs no retry or quota refund.

embodichain.learning.sl.sources
-------------------------------

Expand Down
19 changes: 19 additions & 0 deletions embodichain/learning/sl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@

from __future__ import annotations

from importlib import import_module
from typing import TYPE_CHECKING, Any

from .types import LossResult, SupervisedBatch, SupervisedObjective
from .distributed import distributed_run
from .learner import SupervisedLearner
from .sources import SupervisedSource, TensorBatchSource
from .trainer import SupervisedTrainer, SupervisedTrainerCfg

if TYPE_CHECKING:
from .sequence import SequenceBatchSource

__all__ = [
"LossResult",
"SupervisedBatch",
Expand All @@ -34,4 +40,17 @@
"SupervisedTrainer",
"SupervisedTrainerCfg",
"distributed_run",
"SequenceBatchSource",
]


def __getattr__(name: str) -> Any:
if name != "SequenceBatchSource":
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
value = getattr(import_module(f"{__name__}.sequence"), name)
globals()[name] = value
return value


def __dir__() -> list[str]:
return sorted(set(globals()) | set(__all__))
Loading
Loading