Skip to content

[Feat] Support update weights without restart server#1157

Merged
Ying1123 merged 12 commits intosgl-project:mainfrom
multi-agent-sys:update_weights
Aug 20, 2024
Merged

[Feat] Support update weights without restart server#1157
Ying1123 merged 12 commits intosgl-project:mainfrom
multi-agent-sys:update_weights

Conversation

@shanyu-sys
Copy link
Copy Markdown
Collaborator

@shanyu-sys shanyu-sys commented Aug 20, 2024

Motivation

Support updating the model weights without relaunching the server.
#634

Modification

  • Support post a "/update_weights" request in server.py
  • Add update_weights methods in tokenizer_manager, tp_worker and model_runner
  • Add unit test in test_update_weights.py

Checklist

  • Before submitting a PR for review, make sure it has passed verification in your local development environment at least.
  • Ensure pre-commit pre-commit run --all-files or other linting tools are used to fix potential lint issues.
  • Confirm that modifications are covered by complete unit tests. If not, please add more unit tests for correctness.
  • Modify documentation as needed, such as docstrings or example tutorials.

@shanyu-sys shanyu-sys mentioned this pull request Aug 20, 2024
29 tasks
@Ying1123 Ying1123 self-assigned this Aug 20, 2024
Comment thread test/srt/test_update_weights.py Outdated
Comment thread python/sglang/srt/model_executor/model_runner.py Outdated
Comment thread python/sglang/srt/model_executor/model_runner.py Outdated
Comment thread python/sglang/srt/managers/tp_worker.py Outdated
Comment thread python/sglang/srt/managers/tokenizer_manager.py Outdated
Comment thread python/sglang/srt/managers/tokenizer_manager.py Outdated
Comment thread python/sglang/srt/model_executor/model_runner.py Outdated
shanyu-sys and others added 2 commits August 20, 2024 11:17
@Ying1123 Ying1123 merged commit cd10654 into sgl-project:main Aug 20, 2024
@Ying1123 Ying1123 deleted the update_weights branch August 20, 2024 20:48
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
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.

4 participants