Skip to content

Commit

Permalink
Add instance_id to messages_test
Browse files Browse the repository at this point in the history
  • Loading branch information
stbaione committed Mar 3, 2025
1 parent 698594c commit 8ff8e11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shortfin/tests/apps/llm/components/messages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ def test_inference_exec_request_repr(mock_void_future):
Patches shortfin.VoidFuture with a mock because we're not running this testcase on a worker thread.
"""
req = InferenceExecRequest(InferencePhase.PREFILL, [1, 2, 3, 4], rid="test123")
instance_id = req.instance_id
assert (
str(req)
== "InferenceExecRequest[phase=P,pos=0,rid=test123,flags=host,input_token_ids=[1, 2, 3, 4]]"
== f"InferenceExecRequest[phase=P,pos=0,rid=test123,instance_id={instance_id},flags=host,input_token_ids=[1, 2, 3, 4]]"
)

req = InferenceExecRequest(InferencePhase.DECODE, [], rid="test123")
req.return_host_array = False
req.return_all_logits = False
req.rid = None
req.instance_id = None
assert (
str(req)
== "InferenceExecRequest[phase=D,pos=0,rid=None,flags=,input_token_ids=[]]"
== "InferenceExecRequest[phase=D,pos=0,rid=None,instance_id=None,flags=,input_token_ids=[]]"
)

0 comments on commit 8ff8e11

Please sign in to comment.