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

Parallel sampling eviction #157

Merged
merged 42 commits into from
Feb 2, 2024

Conversation

masahi
Copy link
Member

@masahi masahi commented Jan 11, 2024

The most interesting change is in engine_common.py where I use one PrefillRequest and EvalMultiQueryRequest for each sequence to restore cache entries for parallel-sampling requests.

I couldn't find a good way to test this pragmatically. The way I tested it was to change the condition https://github.com/octoml/mlc-llm/blob/batch-serving/serve/mlc_serve/engine/engine_common.py#L327 depending on model / input to manually cause an eviction.

Ready for review @sunggg @elvin-n

@masahi masahi force-pushed the parallel-sampling-eviction branch from bc3dc83 to 9fb9261 Compare January 13, 2024 07:44
@masahi masahi marked this pull request as ready for review January 13, 2024 08:10
@masahi masahi marked this pull request as draft January 18, 2024 04:49
Lunderberg pushed a commit to Lunderberg/mlc-llm that referenced this pull request Jan 30, 2024
* add discord link

* empty line

* fix
@masahi masahi marked this pull request as ready for review February 1, 2024 10:00
f"since it has generated more than {self.max_num_batched_tokens} tokens in total"
"and currently we do not support preempting such request.",
)
continue
Copy link
Member Author

@masahi masahi Feb 1, 2024

Choose a reason for hiding this comment

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

@sunggg @elvin-n Please be aware of this limitation. Due to this, there is still a case when a parallel-sampling request is cancelled rather than preempted.

In general, we don't have a good solution for preempting a request which has generated more than max_num_batched_tokens tokens. See also #163. The easiest solution would be to stop generation at max_num_batched_tokens, but then we cannot support "unlimited" generation.

@sunggg sunggg merged commit ed0e52f into octoml:batch-serving Feb 2, 2024
1 check passed
sunggg added a commit that referenced this pull request Feb 2, 2024
sunggg added a commit that referenced this pull request Feb 2, 2024
Revert "Parallel sampling eviction (#157)"

This reverts commit ed0e52f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants