Skip to content

[lazy] refactor lazy init#3891

Merged
FrankLeeeee merged 4 commits intohpcaitech:mainfrom
ver217:feature/lazy
Jun 5, 2023
Merged

[lazy] refactor lazy init#3891
FrankLeeeee merged 4 commits intohpcaitech:mainfrom
ver217:feature/lazy

Conversation

@ver217
Copy link
Copy Markdown
Contributor

@ver217 ver217 commented Jun 2, 2023

📌 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

NA

📝 What does this PR do?

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

  1. Remove old useless lazy init context
  2. Move latest lazy init code to colossalai/lazy
  3. Update unit tests
  4. Fix deepcopy of lazy tensor

💥 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.

@ver217 ver217 added the enhancement New feature or request label Jun 2, 2023
@ver217 ver217 requested a review from FrankLeeeee June 2, 2023 10:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2023

The code coverage for the changed files is 85%.

Click me to view the complete report
Name                                                   Stmts   Miss  Cover
--------------------------------------------------------------------------
colossalai/lazy/__init__.py                                2      0   100%
colossalai/lazy/lazy_init.py                             298     40    87%
colossalai/zero/gemini/gemini_ddp.py                     400     67    83%
tests/test_booster/test_plugin/test_gemini_plugin.py      74     10    86%
tests/test_lazy/lazy_init_utils.py                        68     14    79%
tests/test_lazy/test_distribute.py                        74      3    96%
tests/test_lazy/test_models.py                            13      1    92%
--------------------------------------------------------------------------
TOTAL                                                    929    135    85%

@FrankLeeeee FrankLeeeee merged commit dbb3269 into hpcaitech:main Jun 5, 2023
@ver217 ver217 deleted the feature/lazy branch June 5, 2023 06:32
FrankLeeeee pushed a commit to FrankLeeeee/ColossalAI that referenced this pull request Jun 7, 2023
* [lazy] remove old lazy init

* [lazy] refactor lazy init folder structure

* [lazy] fix lazy tensor deepcopy

* [test] update lazy init test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants