Skip to content

Commit 2a6c2ff

Browse files
Update vllm/v1/structured_output/__init__.py
Co-authored-by: Russell Bryant <rbryant@redhat.com>
1 parent 27cce16 commit 2a6c2ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vllm/v1/structured_output/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def __init__(self, vllm_config: VllmConfig):
4444
self.fill_bitmask_parallel_threshold = 128
4545
if self.fill_bitmask_parallel_threshold < max_batch_size:
4646
self.fill_bitmask_parallel_batch_size = 16
47-
max_workers = max(1, min(multiprocessing.cpu_count(), 8))
47+
# Use:
48+
# - at least 1 CPU
49+
# - at most half the number of CPUs or 8, whichever is less
50+
max_workers = max(1, min(multiprocessing.cpu_count() // 2, 8))
4851
self.executor_for_fillmask = ThreadPoolExecutor(
4952
max_workers=max_workers)
5053

0 commit comments

Comments
 (0)