Skip to content

Fix export_dcp.py bugs #251

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ccchow
Copy link

@ccchow ccchow commented May 10, 2025

This pull request introduces improvements to the model export process and checkpoint handling. The key updates include simplifying the get_model function call, ensuring shard count is at least 1, and enabling the use of cloudpickle for saving and loading checkpoint files to enhance serialization flexibility.

Model Export Improvements:

  • Simplified the get_model function call by passing the config object and tokenizer length directly, reducing the number of parameters. (scripts/export_dcp.py, scripts/export_dcp.pyL138-R139)
  • Ensured that the number of shards (num_shards) is at least 1 to avoid potential zero-shard errors. (scripts/export_dcp.py, scripts/export_dcp.pyL165-R162)

Checkpoint Handling Enhancements:

  • Introduced cloudpickle as the pickle_module for torch.save and torch.load operations, improving serialization support for complex objects. (src/zeroband/checkpoint.py, [1] [2] [3] [4] [5]
  • Fixed a logging attribute by replacing self.logger with self._logger in the delete_topk call to align with the correct attribute name. (src/zeroband/checkpoint.py, src/zeroband/checkpoint.pyL357-R358)

ccchow added 2 commits May 10, 2025 12:16
refactor: simplify model initialization and ensure at least one shard for model parameters
feat: use cloudpickle for saving and loading state in CkptManager
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