Skip to content

Support remote fsspec checkpoint paths (e.g. gs://) via filesystem helpers#3887

Open
zhixiangli wants to merge 2 commits into
pytorch:mainfrom
zhixiangli:gcs-fsspec-checkpoint
Open

Support remote fsspec checkpoint paths (e.g. gs://) via filesystem helpers#3887
zhixiangli wants to merge 2 commits into
pytorch:mainfrom
zhixiangli:gcs-fsspec-checkpoint

Conversation

@zhixiangli

Copy link
Copy Markdown

Fix #3884

Add torchtitan/tools/filesystem.py to transparently dispatch path ops to os/shutil for local paths and fsspec for remote URIs, then route checkpoint.py's directory listing/existence/cleanup through it so checkpoints can be written to and read from remote storage like GCS.

  • Fresh run passes
NGPU=4 CONFIG=llama3_debugmodel ./run_train.sh --training.steps 20 --checkpoint.enable --checkpoint.interval 10 --checkpoint.folder gs://...
  • Resume run passes
NGPU=4 CONFIG=llama3_debugmodel ./run_train.sh --training.steps 40 --checkpoint.enable --checkpoint.folder gs://...

…lpers

Add torchtitan/tools/filesystem.py to transparently dispatch path ops to
os/shutil for local paths and fsspec for remote URIs, then route
checkpoint.py's directory listing/existence/cleanup through it so
checkpoints can be written to and read from remote storage like GCS.
@meta-cla

meta-cla Bot commented Jul 8, 2026

Copy link
Copy Markdown

Hi @zhixiangli!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@pytorch-bot

pytorch-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/8gpu

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 8, 2026
@meta-cla

meta-cla Bot commented Jul 8, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Object stores (GCS, S3) can list a directory-marker entry for the
listed directory itself, which os.listdir never returns. Filter it
out by full normalized path so a legitimate child sharing the
parent's basename is still kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support saving/loading checkpoints to fsspec URIs (e.g. gs://, s3://)

2 participants