Repository navigation
Conversation
aa87f5f to
7c5e1f0
Compare
| snapshots = {train_path: trainer._checkpoint_config} | ||
| if gym_path is not None: | ||
| snapshots[gym_path] = deepcopy(gym_data) | ||
| frozen_gym = _freeze_gym_config(gym_data, gym_config or config_path) |
There was a problem hiding this comment.
[P2] Preserve resume compatibility when freezing the saved Gym config
When a run starts with a component-based Gym config and is later resumed with trainer.gym_config pointing to that run's saved configs/gym.yaml, this expansion makes the snapshot incompatible with its own checkpoint. _configure_checkpoints() still stores the original declaration in _checkpoint_context, while _freeze_gym_config() replaces environment.component with fields such as env, physics, and max_episode_steps. checkpoint._validate() compares those raw contexts and raises Incompatible checkpoint configuration, even though both declarations resolve to the same environment.
A focused probe using an absolute component path (to exclude pre-existing relative-path issues) confirms that the base snapshot has no compatibility differences, whereas the new snapshot produces differences at metadata.context.gym.{env,environment,max_episode_steps,physics}. Both snapshots resolve to exactly the original environment. The added snapshot tests only reload the configuration; they do not resume the corresponding checkpoint.
Please use a consistent compatibility identity across the original configuration and exported snapshot, and cover resuming a checkpoint with its saved Gym config.
Description
Make standard RL rollouts, episode evaluation and saved environments reliable across ordinary tasks. This PR targets
mainand has no dependency on #981 or the assembly toolkit.on_scored_episoderecords; retain environment-ownedon_episodereports.Stack
mainatb629c7158b8180934c0990b71e12e1031ddac16e(Add compound rigid shapes and precision physics configuration #980 is already merged).Type of change
Validation
Isolated Python 3.12.14 / Torch 2.11 / DexSim 0.6.0rc1 environment, editable imports verified against this worktree:
black .), API coverage 4915/4915, context validation, changed Python headers/annotations, skill validation and whitespace checks passed.Tests extend existing modules; compact/full terminal batches, hard termination, simultaneous termination/truncation, singleton BatchNorm inference and exception recovery, PPO/GRPO consumer selection, and file/inline Task Program snapshot reload close demonstrated gaps. Existing bridge coverage is reused for moved private observation helpers. Other mapped simulation/robot/randomization/data guidance remains accurate; RL lifecycle and observation ownership context was updated.
Focused collection comparison
Completed CPU collection latency, 32 steps without timeouts, FP32 [64,64] Tanh MLPs, one AMD EPYC 9K65 CPU thread, seed 42, five warmups and 15 alternating samples:
Observation/action/reward/done/value tensors match exactly. Persistent rollout storage is unchanged. This measures collection only; GPU performance, CPU transient peak memory and end-to-end training throughput are unmeasured.
Limits
GPU cases are excluded from the CPU qualification. No rendered-pixel quality, NCCL or full task-training qualification is claimed. An initial expanded selection entered the native display initializer without a configured display and aborted; the isolated native external-rollout case subsequently passed with the proper Xvfb/Hybrid setup.
Checklist
black .with Black 26.10.1.