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

[applications/ColossalChat/examples/training_scripts/lora_finetune.py]: Fixed bug, added save_interval and added auto resume functions #6223

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bbbolt
Copy link

@bbbolt bbbolt commented Feb 26, 2025

📌 Checklist before creating the PR

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

🚨 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?

Summarize your work here.

  1. Fix the gradient not enabled bug during lora fine-tuning, by adding the code "model.enable_input_require_grads()".
  2. Add interval save function for lora and optimizer state, controled by save_interval argument
  3. Add auto resume function, controled by lora_path and optmizer_path arguments.
    if you have any plots/diagrams/screenshots/tables, please attach them here.

💥 Checklist before requesting a review

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

⭐️ Do you enjoy contributing to Colossal-AI?

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

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

1. Fixed the gradient not enabled bug during lora fine-tuning, 
Add the code "model.enable_input_require_grads()".

2. added interval save function for lora and optimizer state, 
Controled by save_interval argument

3. and auto resume function.
Controled by lora_path and optmizer_path arguments.
@bbbolt bbbolt requested a review from a team as a code owner February 26, 2025 12:57
Copy link
Author

@bbbolt bbbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the format

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.

1 participant