Replace the pretrained checkpoint functions with CheckpointBundle - #7509
Draft
hujc7 wants to merge 6 commits into
Draft
Replace the pretrained checkpoint functions with CheckpointBundle#7509hujc7 wants to merge 6 commits into
hujc7 wants to merge 6 commits into
Conversation
8 tasks
Collaborator
Author
|
run-ci |
play --checkpoint pretrained crashed on the Shadow Hand camera tasks: the vision CNN the policy needs was never published beside it, and nothing in the tooling knew the file existed. A component now declares what it writes with a Checkpoint on its own config. The tooling walks the resolved environment config to find every declaration, so a task declares nothing, and publishes each file beside the policy as <policy stem>_<name><extension>. The download path fetches them with the policy.
"Auxiliary" ranked these files below the policy and did not generalise: any component can declare a run artifact, and the policy is not special among them. The discovery and path helpers, their parameter, and the collect locals now say declared.
The module answered every path question through 13 free functions that each took the same (workflow, task_name, physics_backend, render_backend) tuple, and the publish script unpacked it at 20 call sites. CheckpointBundle owns that identity and the checkpoints a task declares. find_cfgs and latest_file move to isaaclab.utils as public utilities. WORKFLOW_TRAINER and WORKFLOW_PLAYER are deleted: every workflow mapped to the same entrypoint and nothing read them. get_published_pretrained_checkpoint is unchanged, so its ten call sites are untouched. CheckpointJob gains is_trained and mark_trained: the completion marker is job state, and the summary no longer re-derives the legacy rule from physics_backend.
hujc7
force-pushed
the
jichuanh/checkpoint-bundle
branch
from
September 4, 2026 07:59
e800247 to
fc8754e
Compare
Collaborator
Author
|
run-ci |
The play, train and benchmark entrypoints spelled each library's policy file pattern, its subdirectory and its preferred file in thirteen resolve_checkpoint_selector calls, while the publish module kept the same facts as glob and extension tables. The copies had drifted: the benchmark sb3 pattern excluded model.zip, so its own preference never matched, and skrl preferred best_agent.pt only when publishing. Workflow holds those conventions per library; WORKFLOWS maps the name to it. selector_args derives the selector patterns from the policy glob, so every entrypoint asks for them instead of restating them. The publish script selects the trained policy through the same manifest-based lookup as --checkpoint best. Checkpoint.local_path lets the fetch record where a companion landed, so a component loads the published copy through its own declaration instead of globbing a naming convention out of a directory the entrypoint pointed it at. That directory hand-off broke for rl_games and skrl, whose run layout puts the policy one level deeper than the flat cache. CheckpointBundle keeps only what a consumer needs; training-run state and the train and play commands move onto the publish script's CheckpointJob, which now resolves the preset-selected config to read both the backend names and the declared checkpoints from what the presets actually train.
…int-bundle # Conflicts: # source/isaaclab_rl/isaaclab_rl/utils/pretrained_checkpoint.py # source/isaaclab_rl/test/test_pretrained_checkpoint.py
Collaborator
Author
|
run-ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #7485 — [Fix] Publish and fetch the checkpoints a task's components declare, which is the
minimal fix. This PR is the refactor that PR deliberately kept out of scope.
CheckpointBundlereplaces 13 free functions that each took the same(workflow, task_name, physics_backend, render_backend)tuple; the publish script unpacked it at 20 call sites.Workflowper RL library replaces four parallel tables and the 13resolve_checkpoint_selectorblocksthat each spelled that library's file patterns. Two copies had drifted: the benchmark sb3 pattern excluded
model.zip, so its own preference never matched; skrl preferredbest_agent.ptonly when publishing.Checkpoint.local_pathreplaces the cache-dir-as-log-dir hand-off, which put rl_games and skrl companionsone directory off.
Description
1. Change
isaaclab.utils:Checkpoint.local_path, set by the fetch and returned first byresolve();find_cfgsand
latest_filebecome public utilities.isaaclab_rl.utils.pretrained_checkpoint:Workflow(policy glob, preferred file, extension, experimentkey;
selector_args()derives the selector patterns) inWORKFLOWS;CheckpointBundleowns identity,companions and the published, cached and collected paths, and
fetch()records each companion'slocal_path.get_published_pretrained_checkpoint(…, env_cfg=)is unchanged, so its ten call sites areuntouched.
**WORKFLOWS[lib].selector_args(…).train_and_publish_checkpoints.py:CheckpointJobowns training-run state and the train/play commands;from_taskresolves the preset-selected config so the backend names and declared checkpoints describewhat the presets train; the trained policy is selected through the same manifest-based lookup as
--checkpoint best.2. Migration
Full retired→new table in
source/isaaclab_rl/changelog.d/checkpoint-bundle.major.rst. Behaviourchanges: skrl
--checkpoint bestprefersbest_agent.pt; the publish script only collects runs carryinga
run.jsonmanifest;--publish_rootkeeps the legacy per-task sub-directory.3. Verification
200 pass across
test_checkpoints.py,test_pretrained_checkpoint.py,test_train_and_publish_checkpoints.py,test_shadow_hand_camera_presets.py,test_pretrained_checkpoint_lookup.py,test_standalone_scripts.py,test_entrypoints.py,test_checkpoint_manifest.pyand benchmarktest_api.py. New tests pin each library'sselector patterns against the files it writes, the
local_pathwrite-back, manifest-required selection andthe preset-config plumbing of
from_task.pre-commitclean.Type of change
Release backport
developChecklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.mdor my name already exists there