Skip to content

Pin kernels<0.13.0 in [cuda] extra to prevent huggingface-hub conflic… - #126

Open
gps23 wants to merge 1 commit into
Red-Hat-AI-Innovation-Team:mainfrom
gps23:fix-kernels-transformers-import
Open

Pin kernels<0.13.0 in [cuda] extra to prevent huggingface-hub conflic…#126
gps23 wants to merge 1 commit into
Red-Hat-AI-Innovation-Team:mainfrom
gps23:fix-kernels-transformers-import

Conversation

@gps23

@gps23 gps23 commented Jul 23, 2026

Copy link
Copy Markdown

Fixes #91

Root cause: kernels>=0.13.0 bumped its huggingface-hub requirement to >=1.10.0, which conflicts with transformers>=4.57.6,<5.0's requirement of huggingface-hub<1.0. When kernels is installed/upgraded independently (e.g. in a separate pip install step after transformers is already resolved), pip doesn't re-validate transformers' constraint, so you end up with a newer huggingface-hub installed alongside old transformers — which fails transformers' own version guard at import time.

Verification: Bisected the exact breaking version using Docker:

  • kernels==0.12.3 + transformers==4.57.6 → imports fine
  • kernels==0.13.0 + transformers==4.57.6ImportError: huggingface-hub>=0.34.0,<1.0 is required for a normal functioning of this module, but found huggingface-hub==1.24.0.

Note: a single-command pip install kernels transformers (no version drift) naturally resolves to a compatible kernels version, since pip's resolver considers both constraints together. The bug only surfaces when kernels is installed/upgraded in a separate step from transformers, which is training_hub's own install pattern (pip install training-hub[lora] then pip install training-hub[cuda]).

Fix: Capped kernels<0.13.0 in the [cuda] extra.

Summary by CodeRabbit

  • Chores
    • Updated the CUDA installation dependency range for improved compatibility and stability.
    • CUDA setups now use kernels versions from 0.9.0 up to, but not including, 0.13.0.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CUDA optional dependency changes its kernels requirement from an unbounded minimum to the range >=0.9.0,<0.13.0.

Changes

CUDA dependency constraints

Layer / File(s) Summary
CUDA kernels version range
pyproject.toml
The CUDA extra now constrains kernels to versions from 0.9.0 through 0.12.x.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: maxusmusti

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the dependency pin in the cuda extra and the compatibility issue it addresses.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gps23

gps23 commented Aug 10, 2026

Copy link
Copy Markdown
Author

Hi @Maxusmusti, could you please take a look at this PR when you have a chance? It pins kernels to <0.13.0 in the CUDA extra to prevent the huggingface-hub incompatibility with transformers. All current checks are passing. Thank

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kernels package breaks transformers import — ValueError in LayerRepository

1 participant