Skip to content

[checkpoint] refactored the API and added safetensors support#3427

Merged
FrankLeeeee merged 2 commits intohpcaitech:mainfrom
FrankLeeeee:feature/checkpointIO
Apr 4, 2023
Merged

[checkpoint] refactored the API and added safetensors support#3427
FrankLeeeee merged 2 commits intohpcaitech:mainfrom
FrankLeeeee:feature/checkpointIO

Conversation

@FrankLeeeee
Copy link
Copy Markdown
Contributor

📌 Checklist before creating the PR

  • I have created an issue for this PR for traceability
  • The title follows the standard format: [doc/gemini/tensor/...]: A concise description
  • I have added relevant tags if possible for us to better distinguish different PRs

🚨 Issue number

Link this PR to your issue with words like fixed to automatically close the linked issue upon merge

e.g. fixed #1234, closed #1234, resolved #1234

Fixed #3426

📝 What does this PR do?

Summarize your work here.
if you have any plots/diagrams/screenshots/tables, please attach them here.

This PR added support for huggingface safetensors, meanwhile, the checkpoint IO API is refactored for better clarity.

💥 Checklist before requesting a review

  • I have linked my PR to an issue (instruction)
  • My issue clearly describes the problem/feature/proposal, with diagrams/charts/table/code if possible
  • I have performed a self-review of my code
  • I have added thorough tests.
  • I have added docstrings for all the functions/methods I implemented

⭐️ Do you enjoy contributing to Colossal-AI?

  • 🌝 Yes, I do.
  • 🌚 No, I don't.

Tell us more if you don't enjoy contributing to Colossal-AI.

@FrankLeeeee FrankLeeeee added Run Build and Test API related to API changes labels Apr 4, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 4, 2023

The code coverage for the changed files is 69%.

Click me to view the complete report
Name                                                      Stmts   Miss  Cover
-----------------------------------------------------------------------------
colossalai/booster/plugin/torch_ddp_plugin.py                73     15    79%
colossalai/checkpoint_io/__init__.py                          4      0   100%
colossalai/checkpoint_io/checkpoint_io_base.py               67     18    73%
colossalai/checkpoint_io/general_checkpoint_io.py            33      9    73%
colossalai/checkpoint_io/index_file.py                       55     38    31%
colossalai/checkpoint_io/utils.py                            77     34    56%
tests/test_booster/test_plugin/test_torch_ddp_plugin.py      70     14    80%
tests/test_checkpoint_io/test_general_checkpoint_io.py       42      1    98%
-----------------------------------------------------------------------------
TOTAL                                                       421    129    69%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API related to API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Refactor checkpointIO API and add safetensors support

2 participants