Skip to content

[transformers] [v5]remove unused hybridcache#3910

Merged
Datta0 merged 2 commits into
unslothai:nightlyfrom
Datta0:hybird_cache
Jan 20, 2026
Merged

[transformers] [v5]remove unused hybridcache#3910
Datta0 merged 2 commits into
unslothai:nightlyfrom
Datta0:hybird_cache

Conversation

@Datta0

@Datta0 Datta0 commented Jan 20, 2026

Copy link
Copy Markdown
Collaborator

This is unused and causes issues in transformers v5
Remove it

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @Datta0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs a targeted code cleanup by removing an unused HybridCache import from the unsloth/models/vision.py file. This change is essential for improving compatibility and preventing errors when integrating with transformers v5, ensuring the library functions correctly without unnecessary dependencies.

Highlights

  • Removed Unused Import: The HybridCache class import has been removed from unsloth/models/vision.py as it was identified as an unused dependency.
  • Resolved transformers v5 Compatibility: This removal directly addresses and resolves issues encountered when using the transformers library, specifically with its version 5, which were caused by the presence of the unused HybridCache import.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Datta0 Datta0 changed the title remote unused hybridcache [transformers] [v5]remove unused hybridcache Jan 20, 2026
@Datta0 Datta0 changed the base branch from main to nightly January 20, 2026 06:08

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly removes the unused HybridCache import from unsloth/models/vision.py. This is a good cleanup. I've also identified a redundant import statement that can be removed to further improve code maintainability.

Comment thread unsloth/models/vision.py Outdated
@Datta0 Datta0 merged commit 4be5695 into unslothai:nightly Jan 20, 2026
1 check was pending
danielhanchen added a commit that referenced this pull request Jan 31, 2026
* [transformers] [v5] remove unused hybridcache (#3910)

* remote unused hybridcache

* cleanup

* Fix top_k on trl GRPO

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Daniel Han <danielhanchen@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
danielhanchen added a commit that referenced this pull request Feb 5, 2026
* Improve MoE performance

* small changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix imports

* disable autotune

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* LoRA for MoE

* Make autotune default

* make dy contiguous

* use non lora model as base for RL

* Revert "use non lora model as base for RL"

This reverts commit da9e2c4.

* fixup derp

* non TMA [T4]

* Revert "non TMA [T4]"

This reverts commit 9bb0db2.

* Fixes for VL MoE and v5 transformers

* [transformers] [v5] remove unused hybridcache (#3910)

* remote unused hybridcache

* cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* No double compile for qwen3moe

* Fix top_k on trl GRPO

* Recognise GLM as MoE

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix missing RotaryEmbeddingConfigMixin

* Licensing for autotuning cache

* Cleanup

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Erland366 <erland.pg366@gmail.com>
Co-authored-by: Daniel Han <danielhanchen@gmail.com>
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
* [transformers] [v5] remove unused hybridcache (unslothai#3910)

* remote unused hybridcache

* cleanup

* Fix top_k on trl GRPO

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Daniel Han <danielhanchen@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
* Improve MoE performance

* small changes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix imports

* disable autotune

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* LoRA for MoE

* Make autotune default

* make dy contiguous

* use non lora model as base for RL

* Revert "use non lora model as base for RL"

This reverts commit bc8f156.

* fixup derp

* non TMA [T4]

* Revert "non TMA [T4]"

This reverts commit 3530456.

* Fixes for VL MoE and v5 transformers

* [transformers] [v5] remove unused hybridcache (unslothai#3910)

* remote unused hybridcache

* cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* No double compile for qwen3moe

* Fix top_k on trl GRPO

* Recognise GLM as MoE

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix missing RotaryEmbeddingConfigMixin

* Licensing for autotuning cache

* Cleanup

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Erland366 <erland.pg366@gmail.com>
Co-authored-by: Daniel Han <danielhanchen@gmail.com>
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.

1 participant