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

Support dynamic max_concurrency in client concurrency logic #2158

Merged
merged 18 commits into from
Aug 30, 2024

Conversation

cathyzbn
Copy link
Contributor

@cathyzbn cathyzbn commented Aug 27, 2024

Describe your changes

Refactored concurrency semaphore to a dynamic semaphore in Concurrency Manager. When max_concurrency specified, client will send RPC request to get the desired concurrency from server and change its concurrency.


Check these boxes or delete any item (or this section) if not relevant for this PR.

  • Client+Server: this change is compatible with old servers
  • Client forward compatibility: this change ensures client can accept data intended for later versions of itself

Note on protobuf: protobuf message changes in one place may have impact to
multiple entities (client, server, worker, database). See points above.

@cathyzbn cathyzbn requested a review from gongy August 27, 2024 17:17
@cathyzbn cathyzbn marked this pull request as ready for review August 27, 2024 18:27
@@ -177,6 +179,111 @@ def validate_output_data(self, data: Any) -> List[Any]:
return data


class ConcurrencyManager(asyncio.Semaphore):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting we're planning on moving this complexity out of the client soon.

@cathyzbn cathyzbn requested a review from gongy August 29, 2024 17:38
@cathyzbn cathyzbn requested a review from gongy August 29, 2024 19:40
modal/_container_entrypoint.py Outdated Show resolved Hide resolved
@cathyzbn cathyzbn merged commit 194053b into main Aug 30, 2024
22 checks passed
@cathyzbn cathyzbn deleted the cathy/flexible-ci-inputs branch August 30, 2024 16:22
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