Skip to content

[hotfix] fix lr scheduler bug in torch 2.0#4864

Merged
Fridge003 merged 1 commit intohpcaitech:mainfrom
Fridge003:fix-lr-scheduler
Oct 12, 2023
Merged

[hotfix] fix lr scheduler bug in torch 2.0#4864
Fridge003 merged 1 commit intohpcaitech:mainfrom
Fridge003:fix-lr-scheduler

Conversation

@Fridge003
Copy link
Copy Markdown
Contributor

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

fixed #4829

📝 What does this PR do?

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

fix bug when saving lr_scheduler under torch 2.0

this bug is caused by torch 2.0 modifying the base class of learning scheduler from _LRScheduler to LRScheduler

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 7, 2023

The code coverage for the changed files is %.

Click me to view the complete report
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
colossalai/nn/lr_scheduler/delayed.py     113     90    20%
-----------------------------------------------------------
TOTAL                                     113     90    20%

@github-actions
Copy link
Copy Markdown
Contributor

The code coverage for the changed files is 62%.

Click me to view the complete report
Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
colossalai/nn/lr_scheduler/delayed.py                        113     70    38%
tests/test_checkpoint_io/test_general_checkpoint_io.py       111      0   100%
tests/test_zero/test_gemini/test_zerooptim_state_dict.py      60     39    35%
------------------------------------------------------------------------------
TOTAL                                                        284    109    62%

@Fridge003 Fridge003 merged commit 39f2582 into hpcaitech:main Oct 12, 2023
@Fridge003 Fridge003 deleted the fix-lr-scheduler branch October 12, 2023 06:06
flybird11111 pushed a commit to flybird11111/ColossalAI that referenced this pull request Oct 18, 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.

[BUG]: colossalai 0.3.3 + torch 2.0.1 + baichuan-2 7b 训练保存 lr_scheduler 时会报 NotImplementedError 错

3 participants