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 max_batch_inputs and block_duration to message Function #1979

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modal/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ def from_args(
allow_background_volume_commits: Optional[bool] = None,
block_network: bool = False,
max_inputs: Optional[int] = None,
max_batch_inputs: Optional[int] = None,
block_duration: Optional[float] = None,
ephemeral_disk: Optional[int] = None,
) -> None:
"""mdmd:hidden"""
Expand Down Expand Up @@ -807,6 +809,8 @@ async def _load(self: _Function, resolver: Resolver, existing_object_id: Optiona
object_dependencies=object_dependencies,
block_network=block_network,
max_inputs=max_inputs or 0,
max_batch_inputs=max_batch_inputs or 1,
block_duration=block_duration or 0,
cloud_bucket_mounts=cloud_bucket_mounts_to_proto(cloud_bucket_mounts),
_experimental_boost=_experimental_boost,
scheduler_placement=scheduler_placement.proto if scheduler_placement else None,
Expand Down
3 changes: 3 additions & 0 deletions modal_proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ message Function {

string use_function_id = 54; // for class methods use this function id instead for invocations - the *referenced* function should have is_class=True
string use_method_name = 55; // for class methods - this method name needs to be included in the FunctionInput

int32 max_batch_inputs = 56; // Maximum number of inputs per batch
float block_duration = 57; // Time to block before a response is needed
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put the units in the field name, or failing that, the comment?

}

message FunctionBindParamsRequest {
Expand Down
Loading