Skip to content

Add hash check for dynamic modules cache#13460

Open
neo wants to merge 1 commit intohuggingface:mainfrom
neo:dynamic-modules-hash-cache
Open

Add hash check for dynamic modules cache#13460
neo wants to merge 1 commit intohuggingface:mainfrom
neo:dynamic-modules-hash-cache

Conversation

@neo
Copy link
Copy Markdown

@neo neo commented Apr 13, 2026

What does this PR do?

This is to replicate what transformers already has: https://github.com/huggingface/transformers/blob/357f414cae88d5f592105bd97ec4a24ef7735f9f/src/transformers/dynamic_module_utils.py#L296-L310
from: huggingface/transformers#33162

It would not only offer a small optimization, but also, more importantly, ensure "is equality" between back-to-back calls of this from the exact same module by preventing reloading the same file.

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@github-actions github-actions bot added utils size/S PR with diff < 50 LOC labels Apr 13, 2026
@sayakpaul sayakpaul requested a review from DN6 April 13, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR with diff < 50 LOC utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant