Skip to content

Commit e8b4652

Browse files
committed
Rename completion future to make its meaning clear
1 parent 025d35e commit e8b4652

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

shortfin/python/shortfin_apps/llm/components/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ async def run(self):
104104
# Decode loop.
105105
await self.token_selector.decode(self.exec_req)
106106
finally:
107-
self.exec_req.completed.set_success()
107+
self.exec_req.request_exec_success.set_success()
108108
self.exec_req.free_cache_pages()
109109

110110
async def await_completion(self):
111-
await self.exec_req.completed
111+
await self.exec_req.request_exec_success
112112
return self.index
113113

114114
def results_callback(self, result: int | list[list[int]]):

shortfin/python/shortfin_apps/llm/components/messages.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def __init__(
3737
self.input_token_ids = input_token_ids
3838
self.prompt_length = len(input_token_ids)
3939
self.done = sf.VoidFuture()
40-
self.completed = sf.VoidFuture()
40+
# This is set to success once the request has been decoded successfully
41+
# and response is ready to be sent back to the client.
42+
self.request_exec_success = sf.VoidFuture()
4143
self.rid = rid
4244
# Unique `instance_id` for token selection strategies that may need
4345
# to differentiate between an original req and a copy of a req.

0 commit comments

Comments
 (0)