Skip to content

Commit

Permalink
Done
Browse files Browse the repository at this point in the history
Signed-off-by: Jee Jee Li <[email protected]>
  • Loading branch information
jeejeelee committed Nov 25, 2024
1 parent 49628fe commit 3507cd1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vllm/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
plugins_loaded = False


def _force_torch_inductor_compile_threads(thread_num: int):
import torch

# see https://github.com/vllm-project/vllm/issues/10619
# A hacky way to limit the number of threads
torch._inductor.config.compile_threads = thread_num


def load_general_plugins():
"""WARNING: plugins can be loaded for multiple times in different
processes. They should be designed in a way that they can be loaded
Expand All @@ -26,7 +34,7 @@ def load_general_plugins():

# see https://github.com/vllm-project/vllm/issues/10480
os.environ['TORCHINDUCTOR_COMPILE_THREADS'] = '1'

_force_torch_inductor_compile_threads(thread_num=1)
global plugins_loaded
if plugins_loaded:
return
Expand Down

0 comments on commit 3507cd1

Please sign in to comment.