Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
acf8aeb7
Unverified
Commit
acf8aeb7
authored
Aug 08, 2025
by
Ning Xie
Committed by
GitHub
Aug 08, 2025
Browse files
[Misc] normalize multiprocessing Queue usage (#22371)
Signed-off-by:
Andy Xie
<
andy.xning@gmail.com
>
parent
7e3a8dc9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
tests/test_sharded_state_loader.py
tests/test_sharded_state_loader.py
+18
-2
No files found.
tests/test_sharded_state_loader.py
View file @
acf8aeb7
...
@@ -118,8 +118,17 @@ def test_sharded_state_loader(enable_lora, tp_size, num_gpus_available,
...
@@ -118,8 +118,17 @@ def test_sharded_state_loader(enable_lora, tp_size, num_gpus_available,
tensor_parallel_size
=
tp_size
,
tensor_parallel_size
=
tp_size
,
))
))
p
.
start
()
p
.
start
()
p
.
join
()
# Call queue.get() before p.join() to prevent deadlock:
# If p.join() is called before queue.get() and the queue is full,
# the child process may block while writing to the queue and never
# terminate, causing the parent to wait indefinitely on p.join().
# See: https://github.com/vllm-project/vllm/pull/22371#discussion_r2257773814
out_before
=
queue
.
get
()
out_before
=
queue
.
get
()
p
.
join
()
queue
.
close
()
queue
.
join_thread
()
queue
=
ctx
.
Queue
()
p
=
ctx
.
Process
(
target
=
_run_generate
,
p
=
ctx
.
Process
(
target
=
_run_generate
,
args
=
(
output_dir
,
queue
),
args
=
(
output_dir
,
queue
),
...
@@ -131,7 +140,14 @@ def test_sharded_state_loader(enable_lora, tp_size, num_gpus_available,
...
@@ -131,7 +140,14 @@ def test_sharded_state_loader(enable_lora, tp_size, num_gpus_available,
load_format
=
"sharded_state"
,
load_format
=
"sharded_state"
,
))
))
p
.
start
()
p
.
start
()
p
.
join
()
# Call queue.get() before p.join() to prevent deadlock:
# If p.join() is called before queue.get() and the queue is full,
# the child process may block while writing to the queue and never
# terminate, causing the parent to wait indefinitely on p.join().
# See: https://github.com/vllm-project/vllm/pull/22371#discussion_r2257773814
out_after
=
queue
.
get
()
out_after
=
queue
.
get
()
p
.
join
()
queue
.
close
()
queue
.
join_thread
()
assert
out_before
==
out_after
assert
out_before
==
out_after
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment