Skip to content
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

Weight file sharding for large (e.g. 10GB+) models #2084

Open
divyashreepathihalli opened this issue Feb 4, 2025 · 5 comments
Open

Weight file sharding for large (e.g. 10GB+) models #2084

divyashreepathihalli opened this issue Feb 4, 2025 · 5 comments
Assignees
Labels
type:feature New feature or request

Comments

@divyashreepathihalli
Copy link
Collaborator

No description provided.

@phoeenniixx
Copy link

phoeenniixx commented Mar 1, 2025

Hi @divyashreepathihalli, I would like to work on this issue. I am new to keras-hub so can you please help me through the process?
As much as I could understand, models can be loaded using from_preset so we need to update the preset-utils and the from_preset functions in the base classes? (please correct me if I am wrong)
We need to update the load_task and load_preprocessor functions of KerasPresetLoader to add the sharding? We can leave the option of sharding to the user by adding one parameter (bool) to the from_preset which if true does the sharding or we can just do it ourselves by checking if the file size is more than 10GB.
(from_preset will change imo only if we keep the sharding option to the user)

@phoeenniixx
Copy link

Hi @divyashreepathihalli, if you liked my approach can i raise a PR for this?

@phoeenniixx
Copy link

Hi @sachinprasadhs, @divyashreepathihalli, I tried to implement a class for weight sharding that supports torch and tensorflow. It is based on these functions from transformers. Please look at it and tell me if I can raise a PR for this?
Notebook: https://colab.research.google.com/drive/1oB2vYzeqhZWvH-tPIXSl6nb1ppmc2ZEG?usp=sharing

@divyashreepathihalli
Copy link
Collaborator Author

divyashreepathihalli commented Mar 28, 2025

Hi @phoeenniixx sorry about the late response. Thank you so much for your interest in contributing. This work is underway and @james77777778 is working on this feature.

@phoeenniixx
Copy link

No problem @divyashreepathihalli, is there any other issue I could start working on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants