Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Set Pyworker errror for Autoscaler to handle reliability descrease only for such - #39

Open
nakinnubis wants to merge 5 commits into
vast-ai:mainfrom
nakinnubis:AUTO-914
Open

Set Pyworker errror for Autoscaler to handle reliability descrease only for such#39
nakinnubis wants to merge 5 commits into
vast-ai:mainfrom
nakinnubis:AUTO-914

Conversation

@nakinnubis

Copy link
Copy Markdown
Contributor

We want to handle reliability by sending distinguish error boolean flag for pyworker related error without penalizing all when it come to dropping reliability.

Copilot AI review requested due to automatic review settings December 18, 2025 23:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a mechanism to distinguish pyworker-related errors from other types of failures when reporting metrics to the autoscaler. This allows the autoscaler to handle reliability metrics more granularly, penalizing only pyworker errors rather than all failure types when calculating reliability scores.

Key Changes:

  • Added is_pyworker_error boolean flag parameter to the internal post function for distinguishing error types
  • Split failed request handling into two categories: status "Error" (pyworker errors) and other failures (e.g., "Rejected")
  • Updated request reporting logic to send different is_pyworker_error flag values for each failure category

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vastai/serverless/server/lib/metrics.py Outdated
Comment thread vastai/serverless/server/lib/metrics.py Outdated
Comment thread vastai/serverless/server/lib/metrics.py Outdated
Comment thread vastai/serverless/server/lib/metrics.py Outdated
Comment thread vastai/serverless/server/lib/metrics.py Outdated
Comment thread vastai/serverless/server/lib/metrics.py Outdated

@edgaratvast edgaratvast left a comment

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.

some dead code cleanup required, otherwise looks good.

Comment thread vastai/serverless/server/lib/metrics.py Outdated
@@ -180,28 +177,24 @@ async def post(report_addr: str, idxs: list[int], success_flag: bool) -> bool:
# Take a snapshot of what we plan to send this tick.
# New arrivals after this snapshot will remain in the queue for the next tick.
snapshot = list(self.model_metrics.requests_deleting)

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.

requests_payload is now just snapshot, so this is now unnecessary

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.

I miswrote this: this was supposed to be "request_payload is now a snapshot", not "just snapshot, meaning that requests_payload contains all information contained in snapshot, so keeping a separate snapshot is now unnecessary.

Passing snapshot to post won't work work.

Comment thread vastai/serverless/server/lib/metrics.py Outdated
@@ -180,28 +177,24 @@ async def post(report_addr: str, idxs: list[int], success_flag: bool) -> bool:
# Take a snapshot of what we plan to send this tick.
# New arrivals after this snapshot will remain in the queue for the next tick.
snapshot = list(self.model_metrics.requests_deleting)

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.

I miswrote this: this was supposed to be "request_payload is now a snapshot", not "just snapshot, meaning that requests_payload contains all information contained in snapshot, so keeping a separate snapshot is now unnecessary.

Passing snapshot to post won't work work.

@edgaratvast edgaratvast left a comment

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.

We need to wait until the autoscaler deploys with the corresponding changes to merge this, but this looks good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants