Skip to content

train: don't load PI base weights on resume and verify that checkpoint path exists - #636

Merged
RyanPCo merged 2 commits into
mainfrom
ryanco/phase4-resume-without-base-weights
Oct 19, 2026
Merged

RyanPCo merged 2 commits into
mainfrom
ryanco/phase4-resume-without-base-weights

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Slurm requeue detection moves above ModelWrapper construction and reads the
checkpoint dir from cfg (callbacks.model_checkpoint.dirpath, else
/checkpoints); it resumes only when last.ckpt exists (a job preempted
before its first checkpoint warns and falls back to the launch-time ckpt_path).
When cfg.ckpt_path is an existing checkpoint file, the model's config tree gets
model.robomimic_model.config.pytorch_weight_path=null: the checkpoint holds
every weight, so a PI run resumes or evaluates without the multi-GB base
safetensors on disk. cfg itself keeps the path, so logged hyperparameters are
unchanged. Lightning's special values (last, best, hpc, registry) keep the base
weights, since they may resolve to no checkpoint. Exception: eval_latent's
pretrained=true, where ckpt_path only routes the output dir and the base
weights are the model under test.

Eval loads (trainHydra eval branch, eval_latent.run) go through
load_checkpoint_weights (mmap'd torch.load): missing keys raise, unexpected
keys warn. With base weights skipped, strict=False would have run random
weights silently.

Co-Authored-By: Claude Fable 5.1 [email protected]
Claude-Session: https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
Co-Authored-By: Claude Opus 5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s

RyanPCo commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@RyanPCo
RyanPCo force-pushed the ryanco/phase3-mecka-converter branch from 141d779 to 8fccb8f Compare September 13, 2026 21:59
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-resume-without-base-weights branch 2 times, most recently from 3d8ffd1 to d25f8ca Compare September 15, 2026 13:31
@RyanPCo
RyanPCo force-pushed the ryanco/phase3-mecka-converter branch from 8fccb8f to 8803dee Compare September 15, 2026 13:31
@RyanPCo
RyanPCo changed the base branch from ryanco/phase3-mecka-converter to graphite-base/636 September 15, 2026 14:59
@RyanPCo
RyanPCo changed the base branch from graphite-base/636 to ryanco/phase3-mecka-converter September 15, 2026 14:59
@RyanPCo
RyanPCo changed the base branch from ryanco/phase3-mecka-converter to graphite-base/636 September 15, 2026 15:01
@RyanPCo
RyanPCo changed the base branch from graphite-base/636 to ryanco/phase3-mecka-converter September 15, 2026 15:01
@RyanPCo
RyanPCo changed the base branch from ryanco/phase3-mecka-converter to graphite-base/636 September 15, 2026 15:04
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-resume-without-base-weights branch from d25f8ca to 4a8be78 Compare September 15, 2026 15:04
@RyanPCo RyanPCo changed the title train: settle ckpt_path before the model is built; skip PI base weights on resume train: skip PI base weights on resume Sep 15, 2026
@RyanPCo

RyanPCo commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Refactors checkpoint loading and model configuration initialization.

The PR should not merge until evaluation can load checkpoints that the existing training loader supports.

Findings

  1. P1 Legacy checkpoints fail evaluation ▶
  2. P2 Shared width ignores action padding ▶

Summary

The PR selects an existing checkpoint before constructing the model, skips PI base-weight loading when checkpoint weights will replace it, and checks for missing keys during evaluation. It also centralizes HPT widths in dims and resolves interpolations when logging hyperparameters.

  • Evaluation needs the existing fallback for checkpoints that cannot be memory-mapped.
  • Shared-head width overrides need to agree with action preprocessing.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Composed config] --> B{Slurm requeue with last.ckpt?}
  B -- Yes --> C[Select last.ckpt]
  B -- No --> D[Keep launch-time ckpt_path]
  C --> E{Existing checkpoint file and not pretrained?}
  D --> E
  E -- Yes --> F[Construct PI without base weights]
  E -- No --> G[Construct PI with configured base weights]
  F --> H[Restore checkpoint for train or eval]
  G --> H
Loading

Reviews (1) · Last reviewed commit: "train: settle ckpt_path before the model..."

Comment on lines +25 to +27
checkpoint = torch.load(
ckpt_path, map_location="cpu", weights_only=False, mmap=True
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Legacy checkpoints fail evaluation

If an evaluation checkpoint uses PyTorch's legacy, non-zip format, mmap=True raises before any weights are loaded. The training checkpoint loader falls back to a normal read for this format, but this new evaluation loader does not. As a result, a checkpoint that can resume training cannot be evaluated. Please provide the same fallback here.

Comment on lines +15 to +20
dims:
action_width: 14
eva_bimanual:
action: ${model.robomimic_model.dims.action_width}
human_bimanual:
action: ${model.robomimic_model.dims.action_width}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Shared width ignores action padding

This config, along with the other shared-head configs, now uses dims.action_width for sampling and the model input, but action preprocessing still pads 12-dimensional human actions to exactly 14 dimensions. Overriding action_width to 16 would therefore send 14-dimensional training inputs to a 16-dimensional head. Either make padding follow the configured width or document and constrain the width to 14.

RyanPCo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Oct 19, 7:23 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 19, 7:25 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 19, 7:25 PM UTC: @RyanPCo merged this pull request with Graphite.

@RyanPCo
RyanPCo changed the base branch from ryanco/phase3-model-dims to graphite-base/636 October 19, 2026 19:23
@RyanPCo
RyanPCo changed the base branch from graphite-base/636 to main October 19, 2026 19:23
RyanPCo and others added 2 commits October 19, 2026 19:24
stem input_dim, infer_ac_dims, act_dim and enc-dec output_dim now interpolate
robomimic_model.dims.{<emb>.proprio,<emb>.action,action_width}. Resolved values
are unchanged (pinned by tests/unit/test_model_dims.py). Pi configs untouched.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s
…ts on resume

Slurm requeue detection moves above ModelWrapper construction and reads the
checkpoint dir from cfg (callbacks.model_checkpoint.dirpath, else
<run>/checkpoints); it resumes only when last.ckpt exists (a job preempted
before its first checkpoint warns and falls back to the launch-time ckpt_path).
When cfg.ckpt_path is an existing checkpoint file, the model's config tree gets
model.robomimic_model.config.pytorch_weight_path=null: the checkpoint holds
every weight, so a PI run resumes or evaluates without the multi-GB base
safetensors on disk. cfg itself keeps the path, so logged hyperparameters are
unchanged. Lightning's special values (last, best, hpc, registry) keep the base
weights, since they may resolve to no checkpoint. Exception: eval_latent's
pretrained=true, where ckpt_path only routes the output dir and the base
weights are the model under test.

Eval loads (trainHydra eval branch, eval_latent.run) go through
load_checkpoint_weights (mmap'd torch.load): missing keys raise, unexpected
keys warn. With base weights skipped, strict=False would have run random
weights silently.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s
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