Skip to content

Keep an explicit HF_HUB_ENABLE_HF_TRANSFER and install hf_transfer in Core CI - #12394

Merged
danielhanchen merged 5 commits into
mainfrom
ci-core-install-hf-transfer
Oct 1, 2026
Merged

danielhanchen merged 5 commits into
mainfrom
ci-core-install-hf-transfer

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Problem

#12406 stopped unsloth/dataprep/synthetic.py from setting HF_HUB_ENABLE_HF_TRANSFER=1 when hf_transfer is missing. Two gaps remain:

  1. When hf_transfer is installed, the gate still overwrites a value the caller already set. Studio's training worker sets HF_HUB_ENABLE_HF_TRANSFER=0 for its Xet fallback (studio/backend/core/training/worker.py) and imports unsloth afterwards, so import unsloth turns it back to 1. unsloth_zoo's gate already leaves an existing value alone; unsloth's did not.
  2. The core-cpu-setup action installs unsloth and unsloth_zoo with --no-deps and never installs hf_transfer, although both declare it. The Core lanes therefore only ever test the path where the package is missing, not the one most users are on. version-compat-ci.yml already installs it.

Fix

  1. unsloth/dataprep/synthetic.py: only set the flag when it is unset, matching unsloth_zoo. Everything else in Only turn on HF_HUB_ENABLE_HF_TRANSFER in synthetic.py when hf_transfer is installed #12406's gate is unchanged.
  2. tests/test_synthetic_hf_transfer_gate.py: add a case that an explicit 0 or 1 survives with hf_transfer installed. On main the 0 case fails (it becomes 1); with this change all 7 tests pass.
  3. .github/actions/core-cpu-setup/action.yml: install hf_transfer.

Behaviour is unchanged when the flag is unset: set to 1 if hf_transfer is importable and the Hub is not offline, otherwise left unset.

unsloth and unsloth_zoo both declare hf_transfer and set HF_HUB_ENABLE_HF_TRANSFER=1 on import, but the action installs both --no-deps and never installed it. On the HF=4.57.6 lane huggingface_hub 0.36.2 then raises on every plain download, which is how tests/test_gemma3_processor_token_type_ids.py fails in Core zoo on main.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T09:25:50.959738Z 1461f3e Manual request
🔒 Security Review ✅ Completed 2026-10-01T04:35:00.040541Z ce6858d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: ce6858d107

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: ce6858d107

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8cd4e0830a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen danielhanchen changed the title Install hf_transfer in the Core CPU setup Keep an explicit HF_HUB_ENABLE_HF_TRANSFER and install hf_transfer in Core CI Oct 1, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 1461f3eb1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit ecb5c46 into main Oct 1, 2026
17 of 25 checks passed
@danielhanchen
danielhanchen deleted the ci-core-install-hf-transfer branch October 1, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant