feat(lab): pd-cold R2 archive — auto-push finished runs' decomposition item + cross-cluster pull#964
Open
claude-spd1 wants to merge 1 commit into
Conversation
…n item, pull anywhere New param_decomp_lab/tools/r2_cold.py: push a finished run's decomposition checkpoint item (never the resume-only training item) + launch_config.yaml + a provenance manifest to the no-expiry R2 archive bucket under <user>/pd-cold/<run_id>/, and pull it back onto any cluster as a consumer-ready run dir ($PARAM_DECOMP_OUT_DIR/runs/<run_id>/). Drives the cluster scripts' r2_* bash functions directly (bin/r2's --name regex forbids nested prefixes); manifest.json uploads LAST as the completion marker; both directions are aws s3 sync (idempotent, resume-on-rerun). Push is strict (latest ckpt step == pd.steps) with --allow-incomplete for archiving abandoned/stripped runs. Edge wiring: the LM composition root (rank 0, after multihost teardown) archives iff the final-step checkpoint exists — a SIGTERM/requeue save never fires it — then stamps wandb.config["r2_cold"] so every finished run points at its durable artifact (restores the torch-era discoverability contract the JAX migration dropped). Upload failure is loud but non-fatal: the run succeeded; the printed retry command re-runs the same sync. Crew-Address: task/r2-cold-storage-auto-upload
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.
Stacked on #950 (needs the decomposition|training checkpoint split). Retarget to
feature/jaxafter #950 merges.What
param_decomp_lab/tools/r2_cold.py— pd-cold R2 archive for finished decomposition runs:push <run_dir>: uploadsckpts/<latest step>/decomposition+_CHECKPOINT_METADATA+launch_config.yaml+ a provenancemanifest.jsonto the no-expiry archive bucket under<user>/pd-cold/<run_id>/. Never the resume-onlytrainingitem (~90% of ckpt bytes). Strict completeness gate (latest step ==pd.steps);--allow-incompletefor archiving abandoned /strip_checkpoint-migrated runs — this also serves the bulk migration of pre-split runs.pull <run_id> [--user] [--dest]: fetches the archive onto any cluster as a consumer-ready run dir ($PARAM_DECOMP_OUT_DIR/runs/<run_id>/:launch_config.yaml+ckpts/<step>/decomposition, the shaperestore_decomposition*expects). Owner search across user prefixes when--useris omitted; refuses to overlay a resumable local training run.aws s3 sync: idempotent, resume-on-rerun.manifest.jsonuploads LAST as the upload-complete marker; pull asserts it first. Post-upload verification compares remote object count/bytes against local.r2_*bash functions ($DATA_MOUNT/scripts/{config.sh,r2.sh}) directly —bin/r2 push --namerejects the nestedpd-cold/<run_id>/...prefix (^[a-zA-Z0-9._-]+$), and the functions give the same creds + tuned multipart config.Edge wiring (
param_decomp_lab/experiments/lm/run.py): rank 0, after the multihost teardown (so no rank waits on a barrier behind the upload), archives iff the final-step checkpoint exists — a SIGTERM/requeue save or profiling run never fires it — then stampswandb.config["r2_cold"] = {bucket, prefix, step}so every finished run points at its durable artifact (restores the torch-eramodel_<step>.pthdiscoverability contract the JAX migration dropped). Upload failure is LOUD but non-fatal: training itself succeeded; the printed retry command re-runs the same idempotent sync. The engine stays pure — completion is read off the filesystem witness (engine always saves atnow_step == pd.steps).Verified
param_decomp_labsuite: 194 passed. ruff + basedpyright clean./mnt/datamount present on both h100 and cpu-compute nodes → the inline rank-0 push works from compute nodes. Bash plumbing smoke-tested up to the creds boundary.Known gaps / follow-ups
r2-credentials.shisgoodfire-group readable;pd-user(crew) is not in that group on cw-rno2, so crew-launched runs can't push (Oli's can). Needs group membership or the scoped pd-cold token discussed on the task.Task: bridge
r2-cold-storage-auto-uploadCrew-Address: task/r2-cold-storage-auto-upload