Skip to content

Allow HF checkpoint cache dir to be overridden via HF_HOME#20904

Open
chenweng-quic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:dev1/chenweng/update_convert_weights_home
Open

Allow HF checkpoint cache dir to be overridden via HF_HOME#20904
chenweng-quic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:dev1/chenweng/update_convert_weights_home

Conversation

@chenweng-quic

Copy link
Copy Markdown
Collaborator

User description

Summary

The converted Meta/HF checkpoint cache in hf_download.py was always placed under Path.home(), which is host-local. This change honors the HF_HOME environment variable when building the cache path, so the cache can live on a shared disk that multiple hosts reuse — avoiding redundant downloads and conversions per host.

Changes

  • examples/models/llama/hf_download.py: use HF_HOME (falling back to Path.home()) as the base for the meta_checkpoints cache directory.

Test plan

  • With HF_HOME unset: cache path resolves to ~/.cache/meta_checkpoints (unchanged behavior).
  • With HF_HOME=/shared/disk: cache path resolves to /shared/disk/.cache/meta_checkpoints, shareable across hosts.

The converted checkpoint cache was always placed under Path.home(),
which is host-local. Honoring the HF_HOME environment variable lets
the cache live on a shared disk that multiple hosts can reuse, avoiding
redundant downloads and conversions per host.
@pytorch-bot

pytorch-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20904

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit 697e3ea with merge base a6d812a (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 14, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant