-
Notifications
You must be signed in to change notification settings - Fork 653
Use hf transfer as default #2046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2046
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 3992c79 with merge base e9fd56a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
||
import hf_transfer # noqa | ||
|
||
if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this break if the environ variable is not present?
if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") is None: | |
if os.environ.get("HF_HUB_ENABLE_HF_TRANSFER", None) is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i printed it. Doing os.environ.get("HF_HUB_ENABLE_HF_TRANSFER") returns None already. So i guess returning None is already the default
It all looks good to me. I'm just curious if you know how stable this is and if we can reliably tell users to turn it off if it ever runs into issues (ex: huggingface/hf_transfer#30, is it immediately obviously that we need to turn off Hf transfer). Also, do we still get the same speed up if you run on a laptop vs a server? |
Good question! It passes our tests to check for hf_token and gated models. In their website also make it clear that it is not an experimental feature. I also tested it in multiple scenarios, e.g. lib installed/not installed, with/without flag. I think that there is enough evidence that it is safe, but we should keep an eye. |
How can I disable this permanently? hf transfer means I can't download any large file at all. And there is no manual way to download files via a browser. |
@KLL535 simply use |
I tried, it doesn't help. For now, the only way is to download the file in the browser and put it in the right places in the program |
@KLL535 at least in torchtune, this is the code: torchtune/torchtune/__init__.py Line 28 in c2c6f4a
so if you either:
we wont use hf_transfer for you. Can you share a bit of the problem that you are facing? Is it when using torchtune, or some other library? |
Problem with another library fluxgym. Not only me. I posted links in the previous comment. Usually the download just freeze on a random %.
|
Context
What is the purpose of this PR? Is it to
For llama 8b: from 2m12s down to 32s.
doc: https://huggingface.co/docs/huggingface_hub/en/guides/download#faster-downloads
Changelog
HF_HUB_ENABLE_HF_TRANSFER=0 tune download <model_config>
Test plan
pip installed torchtune
HF_HUB_ENABLE_HF_TRANSFER=0 tune download <model_config>
--> runs without transfertune download <model_config>
--> runs with transferpip uninstall hf_transfer
tune download <model_config>
--> runs without transfer