Skip to content

[gemini] support amp o3 for gemini#4872

Merged
ver217 merged 8 commits intohpcaitech:mainfrom
ver217:feature/gemini-master-weight
Oct 12, 2023
Merged

[gemini] support amp o3 for gemini#4872
ver217 merged 8 commits intohpcaitech:mainfrom
ver217:feature/gemini-master-weight

Conversation

@ver217
Copy link
Copy Markdown
Contributor

@ver217 ver217 commented Oct 9, 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

Closes #4871

📝 What does this PR do?

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

Support AMP O3 for gemini by adding master_weights argument.

💥 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 Oct 9, 2023
Comment thread tests/test_zero/test_gemini/test_fwd_bwd.py
Comment thread colossalai/zero/gemini/gemini_optimizer.py
Comment thread colossalai/zero/gemini/gemini_ddp.py
@github-actions
Copy link
Copy Markdown
Contributor

The code coverage for the changed files is 86%.

Click me to view the complete report
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
colossalai/booster/plugin/gemini_plugin.py                    130     12    91%
colossalai/nn/optimizer/cpu_adam.py                            65      4    94%
colossalai/nn/optimizer/hybrid_adam.py                         59      4    93%
colossalai/testing/comparison.py                               81     30    63%
colossalai/zero/gemini/chunk/chunk.py                         336     64    81%
colossalai/zero/gemini/chunk/manager.py                       141     24    83%
colossalai/zero/gemini/gemini_ddp.py                          416     94    77%
colossalai/zero/gemini/gemini_optimizer.py                    401     41    90%
colossalai/zero/gemini/utils.py                                59     37    37%
tests/test_checkpoint_io/test_gemini_checkpoint_io.py         104      0   100%
tests/test_checkpoint_io/test_gemini_torch_compability.py     116      0   100%
tests/test_zero/test_gemini/test_fwd_bwd.py                    77      1    99%
tests/test_zero/test_gemini/test_grad_clip.py                  76      2    97%
tests/test_zero/test_gemini/test_optim.py                     119      1    99%
tests/test_zero/test_gemini/test_zeroddp_state_dict.py         94      5    95%
-------------------------------------------------------------------------------
TOTAL                                                        2274    319    86%

@ver217 ver217 merged commit df63564 into hpcaitech:main Oct 12, 2023
@ver217 ver217 deleted the feature/gemini-master-weight branch October 12, 2023 02:39
flybird11111 pushed a commit to flybird11111/ColossalAI that referenced this pull request Oct 18, 2023
* [gemini] support no reuse fp16 chunk

* [gemini] support no master weight for optim

* [gemini] support no master weight for gemini ddp

* [test] update gemini tests

* [test] update gemini tests

* [plugin] update gemini plugin

* [test] fix gemini checkpointio test

* [test] fix gemini checkpoint io
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.

[gemini] support amp o3 for gemini

3 participants