Repository navigation
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Sep 12, 2026
RyanPCo
marked this pull request as ready for review
September 12, 2026 17:30
RyanPCo
force-pushed
the
ryanco/phase1-code-fixes
branch
from
September 12, 2026 19:39
062bd40 to
23b5c36
Compare
RyanPCo
force-pushed
the
ryanco/tests-dir
branch
2 times, most recently
from
September 12, 2026 21:28
2728174 to
565f8a1
Compare
RyanPCo
force-pushed
the
ryanco/phase1-code-fixes
branch
from
September 12, 2026 21:28
23b5c36 to
eae89d6
Compare
RyanPCo
force-pushed
the
ryanco/phase1-code-fixes
branch
from
September 12, 2026 21:32
eae89d6 to
3db4d2e
Compare
RyanPCo
changed the base branch from
graphite-base/621
to
ryanco/delete-act
September 12, 2026 21:32
RyanPCo
marked this pull request as draft
September 12, 2026 22:04
This was referenced Sep 13, 2026
- pl_utils/preemption.py: PreemptionCheckpoint callback. On the signal submitit
sends (USR2 / $SUBMITIT_PREEMPT_SIGNAL) it saves <root>/checkpoints/last.ckpt
(what trainHydra resumes from on SLURM_RESTART_COUNT) and then chains to the
previously installed handler (submitit's requeue). Restores the old handler
on teardown. Details that matter:
* before saving it points every ModelCheckpoint(save_last=True) in the same
directory (compared via realpath; Lightning realpaths dirpath) at
last.ckpt, otherwise their version counter writes every later periodic
save to last-v1.ckpt, ... (also after resume, since the path is part of
ModelCheckpoint's saved state) while trainHydra resumes the stale file;
* writes last.ckpt.preempt and renames, so a GraceTime SIGKILL mid-write
cannot leave a truncated last.ckpt;
* a failed save is logged and the requeue still runs;
* forked DataLoader workers inherit the handler (Slurm signals every
process in the step); they return immediately instead of saving.
There is deliberately no self-requeue for non-submitit launches: nothing in
the repo launches training that way, and a raw sbatch requeue would
recompose hydra.run.dir with a new timestamp and never find last.ckpt.
- trainHydra: SLURMEnvironment(auto_requeue=False) + PreemptionCheckpoint.
Lightning's own handler listened on SIGUSR1, which nothing ever sent, and
Lightning skips registering on a signal submitit already owns. On requeue,
resume only if last.ckpt exists (preemption during dataset setup happens
before the callback is installed); warn and start fresh otherwise.
- pl_model: torch.distributed.barrier() in on_fit_start / on_validation_end is
now a no-op without a process group (CPU smoke test, devices=1 non-DDP).
- tests/unit: test_preemption (8: chain, default path, env signal, save
failure, no temp file, ModelCheckpoint coexistence across a resume, the same
through a symlinked run dir, forked worker does nothing),
test_pl_model_barriers (2).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01UHDiN8yfERcsiFdz4mXuZi
This was referenced Sep 13, 2026
RyanPCo
force-pushed
the
ryanco/phase1-code-fixes
branch
from
September 13, 2026 17:17
3db4d2e to
cc4e892
Compare
Contributor
Author
|
Not doing preemption checkpointing (decided 2026-09-13); see |
This was referenced Sep 20, 2026
4 tasks
This was referenced Sep 29, 2026
This was referenced Oct 12, 2026
Open
This was referenced Oct 22, 2026
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.

sends (USR2 / $SUBMITIT_PREEMPT_SIGNAL) it saves /checkpoints/last.ckpt
(what trainHydra resumes from on SLURM_RESTART_COUNT) and then chains to the
previously installed handler (submitit's requeue). Restores the old handler
on teardown. Details that matter:
directory (compared via realpath; Lightning realpaths dirpath) at
last.ckpt, otherwise their version counter writes every later periodic
save to last-v1.ckpt, ... (also after resume, since the path is part of
ModelCheckpoint's saved state) while trainHydra resumes the stale file;
cannot leave a truncated last.ckpt;
process in the step); they return immediately instead of saving.
There is deliberately no self-requeue for non-submitit launches: nothing in
the repo launches training that way, and a raw sbatch requeue would
recompose hydra.run.dir with a new timestamp and never find last.ckpt.
Lightning's own handler listened on SIGUSR1, which nothing ever sent, and
Lightning skips registering on a signal submitit already owns. On requeue,
resume only if last.ckpt exists (preemption during dataset setup happens
before the callback is installed); warn and start fresh otherwise.
too short to write a multi-GB pi0.5 checkpoint to NFS before the time-limit
SIGKILL). Preemption itself is bounded by the partition GraceTime (300 s on
overcap), which no launcher setting changes.
now a no-op without a process group (CPU smoke test, devices=1 non-DDP).
failure, no temp file, ModelCheckpoint coexistence across a resume, the same
through a symlinked run dir, forked worker does nothing),
test_pl_model_barriers (2).
Co-Authored-By: Claude Fable 5.1 [email protected]
Claude-Session: https://claude.ai/code/session_01UHDiN8yfERcsiFdz4mXuZi
🤖 Generated with Claude Code
https://claude.ai/code/session_01UHDiN8yfERcsiFdz4mXuZi