Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for sequence state after cancellation #7167

Merged
merged 5 commits into from May 7, 2024
Merged

Add test for sequence state after cancellation #7167

merged 5 commits into from May 7, 2024

Conversation

kthui
Copy link
Contributor

@kthui kthui commented Apr 26, 2024

Should be coupled with this 3rd party PR which adds the fix: triton-inference-server/core#341

Reproduction steps:

  1. Start sequence 1 and cancel it - this release the slot
  2. Wait until the sequence is timed-out - this release the slot again
  3. Start two new sequences - they will be executed concurrently on the double released slot.

Since sequence state is identified by the sequence slot, so the two new sequences executing concurrently will share the same sequence state and leads to corruption of the state.

Ref: #7117 (comment)

@kthui kthui marked this pull request as ready for review April 26, 2024 19:39
sequence_id=1,
sequence_start=True,
)
seq_start = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do we set this value to False when it is overwritten on line 84 and not used before that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable should be used for the sequence_start, you already caught it is always set to True on another comment. The issue is fixed.

model_name,
self._get_inputs(delay_itrs=5000000),
sequence_id=1,
sequence_start=True,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sequence_start=True,
sequence_start=seq_start,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Comment on lines 81 to 96
with grpcclient.InferenceServerClient("localhost:8001") as client:
client.start_stream(callback)
seq_start = True
num_reqs = 4
seq_ids = [2, 3]
for req_id in range(num_reqs):
for seq_id in seq_ids:
client.async_stream_infer(
model_name,
self._get_inputs(delay_itrs=0),
sequence_id=seq_id,
sequence_start=seq_start,
)
time.sleep(0.1)
seq_start = False
client.stop_stream(cancel_requests=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps refactor this into a common function looks like it is a repetition of the block above it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Updated: Regroup infer calls

@rmccorm4 rmccorm4 self-assigned this Apr 29, 2024
@kthui kthui requested a review from Tabrizian May 6, 2024 20:47
@tanmayv25
Copy link
Contributor

Looks good to me. Please rebase the branch.

@kthui kthui merged commit d21685b into main May 7, 2024
3 checks passed
@kthui kthui deleted the jacky-seq-slot branch May 7, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants