Skip to content

[Fix] Avoid pickling entire LLMEngine for Ray workers#3207

Merged
Yard1 merged 4 commits intovllm-project:mainfrom
njhill:dont-pickle-engine
Mar 6, 2024
Merged

[Fix] Avoid pickling entire LLMEngine for Ray workers#3207
Yard1 merged 4 commits intovllm-project:mainfrom
njhill:dont-pickle-engine

Conversation

@njhill
Copy link
Member

@njhill njhill commented Mar 5, 2024

self references have been inadvertently introduced into the closure used to initialize the Ray workers, which is causing the whole LLMEngine object to be pickled with it.

This fixes it to reference the lora_config and kv_cache_dtype directly.

Copy link
Collaborator

@Yard1 Yard1 left a comment

Choose a reason for hiding this comment

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

Looks good, can you add a short description?

@simon-mo
Copy link
Collaborator

simon-mo commented Mar 5, 2024

You can implement the __reduce__ method in LLMEngine and throw an error in there so this won't happen again in the future.

@njhill
Copy link
Member Author

njhill commented Mar 5, 2024

Good idea @simon-mo, now added.

@Yard1 Yard1 enabled auto-merge (squash) March 5, 2024 22:47
@Yard1 Yard1 merged commit 2efce05 into vllm-project:main Mar 6, 2024
@njhill njhill deleted the dont-pickle-engine branch March 6, 2024 00:38
dtransposed pushed a commit to afeldman-nm/vllm that referenced this pull request Mar 26, 2024
)

Co-authored-by: Antoni Baum <antoni.baum@protonmail.com>
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.

3 participants