Skip to content
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

[zero] Update method of grad store #2687

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

yhna940
Copy link
Contributor

@yhna940 yhna940 commented Feb 13, 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

📝 What does this PR do?

It's not that important, but it seems more appropriate to call a method to modify the contents than to directly refer to the private member variable (_averaged_gradients) in self._grad_store. So I introduced a method to add or change the value of grad_store.

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

@yhna940 yhna940 changed the title [Zero] Update method of grad store [zero] Update method of grad store Feb 13, 2023
@github-actions
Copy link
Contributor

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4164081624.
Read our "CONTRIBUTING.md" for more reference to the code style.

@FrankLeeeee
Copy link
Contributor

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4164081624. Read our "CONTRIBUTING.md" for more reference to the code style.

Hi @yhna940 , thank you for your PR. Can you help to format your code with pre-commit for code style consistency? @1SAA can you help to review this PR?

@FrankLeeeee
Copy link
Contributor

Hi, seems some Github updates broke our CI checks. I have fixed the CI and can you rebase your code with the latest code so that the correct CI can be triggered?

@github-actions
Copy link
Contributor

Your pre-commit check failed, follow the steps to run pre-commit on your file for code style consistency.

  1. install pre-commit via "pip install pre-commit"
  2. install pre-commit hooks via "pre-commit install"
  3. run pre-commit on file with format error via "pre-commit run --files path" by replacing "path" with the actual file path
  4. commit and push to your branch

View your job at https://github.com/hpcaitech/ColossalAI/actions/runs/4180912101.
Read our "CONTRIBUTING.md" for more reference to the code style.

@github-actions
Copy link
Contributor

The code coverage for the changed files is 92%.

Click me to view the complete report
Name                                                          Stmts   Miss  Cover
---------------------------------------------------------------------------------
colossalai/zero/sharded_optim/bookkeeping/gradient_store.py      22      3    86%
colossalai/zero/sharded_optim/low_level_optim.py                312     25    92%
---------------------------------------------------------------------------------
TOTAL                                                           334     28    92%

@FrankLeeeee FrankLeeeee merged commit ae86a29 into hpcaitech:main Feb 15, 2023
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.

2 participants