vllm
vllm copied to clipboard
[Core] Add support for loading weight that has already done TP sharding
This PR will be very useful, if we want to sync weights between different vLLM instances with tensor parallel enabled, so that we don't need to all-gather the parameters before-hand, but instead:
- Collect the model weight from an available vllm.worker.worker.Worker, via iterating through self.model_runner.model.named_parameters().
- Send the weight to the workers that are with the same tp rank as the source, then we can load the weight directly via
self.model_runner.model.load_weights().
Tested the PR with llama models with maximum tp size = 4.
👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.
Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.
To run CI, PR reviewers can do one of these:
- Add
readylabel to the PR - Enable auto-merge.
🚀
Thank you for the PR
This PR will be very useful, if we want to sync weights between different vLLM instances with tensor parallel enabled,
Is this used in some post-training framework? or inference workload?
training TP size and inference TP size can (and usually are) different 🤔
Is this used in some post-training framework? or inference workload?
training TP size and inference TP size can (and usually are) different 🤔
It's for the inference and not related to any training weights. As suggested by the PR description, this PR enables the case that, the new vLLM instance model weights are loaded directly from each worker of an old (already-existing) vLLM instance (with tensor parallel enabled).
This pull request has merge conflicts that must be resolved before it can be merged. Please rebase the PR, @HollowMan6.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork