Skip to content

feat(deployments): support workload_calculator for remote functions#431

Merged
vastzuby merged 1 commit into
masterfrom
AUTO-deployments-remote-workload-calculator
Jun 30, 2026
Merged

feat(deployments): support workload_calculator for remote functions#431
vastzuby merged 1 commit into
masterfrom
AUTO-deployments-remote-workload-calculator

Conversation

@vastzuby

@vastzuby vastzuby commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

adds an optional argworkload calculator arg to remote functions for deployments.

the workload calculator tells us the work per request. for deployments, we weren't using this calculator and defaulting to 100. so autoscaler was scoring all remote functions the same regardless of actual cost

I also added wrap_workload_calculator so the user can set the workload calculator as python but the request reaches the worker as json. a similar function wrap_remote_func already exists but we cant use it because its async and returns serialized results (we want deserialized)

@vastzuby vastzuby requested a review from LucasArmandVast June 23, 2026 00:34
@vastzuby vastzuby requested a review from a team as a code owner June 23, 2026 00:34
Comment thread vastai/serverless/remote/deploy.py Outdated
Comment on lines +317 to +319
# workload_calculator is consumed on the worker (serve mode); on the
# client/deploy side the decorator only sets up remote dispatch, so it
# is accepted here purely for signature parity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@vastzuby vastzuby force-pushed the AUTO-deployments-remote-workload-calculator branch 4 times, most recently from ce965db to 7f59b39 Compare June 23, 2026 01:47
@vastzuby

vastzuby commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@LucasArmandVast I tested this change with two of the deployment examples. also added workload_calculator to them in /examples/deployments

@vastzuby vastzuby requested a review from LucasArmandVast June 23, 2026 17:32
@vastzuby vastzuby force-pushed the AUTO-deployments-remote-workload-calculator branch 2 times, most recently from 266f329 to ddca34d Compare June 23, 2026 20:32
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vastzuby vastzuby force-pushed the AUTO-deployments-remote-workload-calculator branch from 28d796e to 7eb8327 Compare June 29, 2026 23:27
@vastzuby vastzuby merged commit 2cb4638 into master Jun 30, 2026
9 checks passed
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