Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
b7955ef1
"tests/git@developer.sourcefind.cn:OpenDAS/fairscale.git" did not exist on "d1fab39e59a98ddce2490b0ef85633bb33cb0301"
Unverified
Commit
b7955ef1
authored
May 19, 2023
by
Zhuohan Li
Committed by
GitHub
May 19, 2023
Browse files
Fix timeout error in the FastAPI frontend (#34)
parent
f756799b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
cacheflow/frontend/fastapi_frontend.py
cacheflow/frontend/fastapi_frontend.py
+5
-2
No files found.
cacheflow/frontend/fastapi_frontend.py
View file @
b7955ef1
...
@@ -83,7 +83,7 @@ class FastAPIServer:
...
@@ -83,7 +83,7 @@ class FastAPIServer:
self
.
is_server_running
=
True
self
.
is_server_running
=
True
updated_seq_groups
=
await
self
.
server
.
step
.
remote
()
updated_seq_groups
=
await
self
.
server
.
step
.
remote
()
self
.
is_server_running
=
False
self
.
is_server_running
=
False
# Notify the waiting coroutines that there new outputs ready.
# Notify the waiting coroutines that there
are
new outputs ready.
for
seq_group
in
updated_seq_groups
:
for
seq_group
in
updated_seq_groups
:
group_id
=
seq_group
.
group_id
group_id
=
seq_group
.
group_id
self
.
running_seq_groups
[
group_id
]
=
seq_group
self
.
running_seq_groups
[
group_id
]
=
seq_group
...
@@ -121,7 +121,10 @@ class FastAPIServer:
...
@@ -121,7 +121,10 @@ class FastAPIServer:
# Wait for new output. The group_event will be set in server_step
# Wait for new output. The group_event will be set in server_step
# when there is new output available for the sequence group.
# when there is new output available for the sequence group.
# Added a timeout to prevent deadlock.
# Added a timeout to prevent deadlock.
await
asyncio
.
wait_for
(
group_event
.
wait
(),
timeout
=
TIMEOUT_TO_PREVENT_DEADLOCK
)
try
:
await
asyncio
.
wait_for
(
group_event
.
wait
(),
timeout
=
TIMEOUT_TO_PREVENT_DEADLOCK
)
except
asyncio
.
TimeoutError
:
continue
# Reset the event to wait for the next output.
# Reset the event to wait for the next output.
group_event
.
clear
()
group_event
.
clear
()
# Decode and return new outputs
# Decode and return new outputs
...
...
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