-
Notifications
You must be signed in to change notification settings - Fork 559
Description
Open Source Contributors Welcomed!
Please comment below if you would like to work on this issue!
Contact Details [Optional]
What happened?
ZenML currently uses Python's pickle module (via cloudpickle library) for model serialization and materialization. However, the safetensors library is fast becoming a standard for storing tensors and model weights, offering a reasonable alternative to pickle. Integrating safetensors into ZenML would provide users with a more efficient and secure option for model serialization.
Task Description
Implement support for using safetensors instead of pickle for model materialization in ZenML. The task involves the following:
- Modify the base materializers to use
safetensorsfor model serialization. - Update the integration-specific materializers (located in
src/zenml/integrations) to utilizesafetensorswhere appropriate. - Ensure backward compatibility with existing
pickle-based serialized models. - Update relevant documentation and examples to reflect the new
safetensorsoption.
Expected Outcome
- ZenML will support model serialization using
safetensors, providing a faster and more secure alternative topickle. - Users will have the option to choose between
pickleandsafetensorsfor model materialization. - The integration of
safetensorswill be seamless, maintaining compatibility with existing ZenML workflows. - Documentation and examples will be updated to guide users on how to utilize the
safetensorsoption effectively.
Steps to Implement
- Familiarize yourself with the
safetensorslibrary and its usage for model serialization. - Modify the base materializers in ZenML to include support for
safetensorsserialization. - Identify integration-specific materializers in
src/zenml/integrationsthat would benefit fromsafetensorsand update them accordingly. - Implement backward compatibility measures to ensure existing
pickle-based serialized models can still be loaded. - Update relevant documentation, including the user guide and API reference, to explain the new
safetensorsoption and provide examples of its usage. - Write unit / integration tests to verify the functionality of
safetensorsserialization in various scenarios. - Submit a pull request with the implemented changes for review.
Additional Context
Integrating safetensors into ZenML aligns with the project's goal of providing efficient and secure tools for machine learning workflows. By offering an alternative to pickle, ZenML empowers users with more options for model serialization, catering to their specific needs and preferences.
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Labels
Type
Projects
Status