Skip to content

[data][actor-only][11/n] Classic dashboard metrics under the actor-only backend - #67707

Open
iamjustinhsu wants to merge 3 commits into
iamjustinhsu/ao/10-cleanup-aftermathfrom
iamjustinhsu/ao/11-classic-dashboard-metrics
Open

iamjustinhsu wants to merge 3 commits into
iamjustinhsu/ao/10-cleanup-aftermathfrom
iamjustinhsu/ao/11-classic-dashboard-metrics

Conversation

@iamjustinhsu

Copy link
Copy Markdown
Contributor

Summary

Under the actor-only backend, keep populating the classic Ray Data dashboard metrics, so existing dashboards still work. They'll be deprecated once the task backend is removed.

Part 11 of 12 of the Ray Data actor-only backend stack. Stacked on #67706; review only the top commit. Everything here is gated behind RAY_DATA_ACTOR_ONLY_BACKEND (off by default) unless noted under After.

Before

With the flag on, classic per-operator dashboard metrics are left empty or stale.

After

The actor-only path fills in the classic metrics alongside its own. With the flag off, nothing changes.

flowchart TD
    subgraph Before
        subgraph BS[Subsystem: observability]
            B1[actor-only executor] --> B2[actor-only metrics]
        end
    end
    subgraph After
        subgraph AS[Subsystem: observability]
            A1[actor-only executor] --> A2[actor-only metrics]
            A1 --> A3[classic dashboard metrics]
        end
    end
    class A3 added
    classDef removed fill:#ffcdd2,stroke:#c62828,color:#000
    classDef added fill:#c8e6c9,stroke:#2e7d32,color:#000
    classDef changed fill:#fff9c4,stroke:#f9a825,color:#000
Loading

Subsystems

observability (flag-gated)

Testing

  • RAY_DATA_ACTOR_ONLY_BACKEND=1 pytest python/ray/data/tests/actor_only: 382 passed.
  • pre-commit run on changed files: clean.

Notes

  • Not a duplicate: no open ray-project/ray PR covers the actor-only backend (checked with gh pr list --repo ray-project/ray --state open --search "actor-only").
  • AI assistance (Claude Code) was used for this change. I have reviewed every changed line.

🤖 Generated with Claude Code

@iamjustinhsu
iamjustinhsu added this pull request to stack #67709 November 2, 2026 21:02
@iamjustinhsu
iamjustinhsu removed this pull request from stack #67709 November 2, 2026 21:05
@iamjustinhsu
iamjustinhsu added this pull request to stack #67710 November 2, 2026 21:05
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from aef8f0e to 3060d34 Compare November 2, 2026 21:10
@iamjustinhsu iamjustinhsu added the go add ONLY when ready to merge, run all tests label Nov 2, 2026
@iamjustinhsu
iamjustinhsu marked this pull request as ready for review November 2, 2026 21:16
@iamjustinhsu
iamjustinhsu requested a review from a team as a code owner November 2, 2026 21:16

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces backwards compatibility support for classic per-operator metrics in the actor-only backend of Ray Data, ensuring the existing Data dashboard remains populated. It refactors budget and backpressure calculations to derive metrics from actor pools when the resource manager is absent, and adds corresponding unit tests. The review feedback correctly identifies a maintainability issue where the private _metrics attribute of PhysicalOperator is accessed directly instead of using its public metrics property, and provides a clear code suggestion to resolve it.

Comment on lines +308 to +310
op._metrics.obj_store_mem_used = self._resource_bank.live_object_store(
op=op
).total_bytes()

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.

medium

Accessing the private attribute _metrics of PhysicalOperator directly is a style violation and poses a maintainability risk. Please use the public metrics property instead.

Suggested change
op._metrics.obj_store_mem_used = self._resource_bank.live_object_store(
op=op
).total_bytes()
op.metrics.obj_store_mem_used = self._resource_bank.live_object_store(
op=op
).total_bytes()

@ray-gardener ray-gardener Bot added the data Ray Data-related issues label Nov 3, 2026
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch 3 times, most recently from 4f2f5f6 to d9caffa Compare November 6, 2026 00:56
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch 2 times, most recently from 738eb86 to 17b9871 Compare November 6, 2026 04:17
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from 17b9871 to 094a45f Compare November 6, 2026 20:34

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from 094a45f to 58bd40f Compare November 10, 2026 19:01
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from 58bd40f to 839c213 Compare November 10, 2026 21:09
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch 2 times, most recently from 1c056fc to db0a692 Compare November 13, 2026 02:38

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

for op, op_state in self._topology.items():
op.metrics.obj_store_mem_used = self._resource_bank.live_object_store(
op=op
).total_bytes()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Input operator object store usage inflated

Medium Severity

The classic-compat fill of obj_store_mem_used copies live_object_store for every operator, including InputDataBuffer. Classic ResourceManager always reports 0 for that op because its blocks already existed outside this execution. Existing dashboards then show the input operator holding the full dataset in object store, especially at start, which classic never did.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit db0a692. Configure here.

@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from db0a692 to 02d417f Compare November 13, 2026 22:36

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch 2 times, most recently from 3a0a8e0 to b43616b Compare November 19, 2026 00:41

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

op.notify_in_task_output_backpressure(
not op.has_completed() and running > 0 and blocked == running,
"Output",
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Output backpressure drops during scale-up

Medium Severity

The classic output-backpressure sample treats cached_output_backpressured_actors as “all running actors are blocked,” but that helper returns (0, 0) whenever pending > 0. Mid-job scale-up therefore reports the operator as not output-backpressured even if every serving actor is stuck, so task_output_backpressure_time stops and existing dashboards miss the stall the classic backend would have shown.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b43616b. Configure here.

@richardliaw
richardliaw force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from b43616b to 765b451 Compare November 19, 2026 19:52
@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch 2 times, most recently from b43616b to dcd32ee Compare November 19, 2026 20:55

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@iamjustinhsu
iamjustinhsu force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from dcd32ee to 2e77897 Compare November 19, 2026 23:22
…ly backend

when actor only is enabled, continue populating some of the older
metrics for backwards compatibility. these metrics will eventually be
deprecated once the task backend is fully removed

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: iamjustinhsu <[email protected]>
Co-authored-by: sampan <[email protected]>
Co-authored-by: Prasad Palkar <[email protected]>
@richardliaw
richardliaw force-pushed the iamjustinhsu/ao/11-classic-dashboard-metrics branch from 2e77897 to 26be2bc Compare November 19, 2026 23:23

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 26be2bc. Configure here.

for op, op_state in self._topology.items():
op.metrics.obj_store_mem_used = self._resource_bank.live_object_store(
op=op
).total_bytes()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Classic object-store metric includes inputs

Medium Severity

The classic obj_store_mem_used backfill writes live_object_store(op).total_bytes(), which adds in-flight input bytes to pulled and prebuffered outputs. The ResourceManager path this is replacing only counted this operator's live outputs plus pending task outputs, and reported 0 for InputDataBuffer. Existing ray_data_current_bytes panels will therefore show higher usage and attribute blocks to the consumer instead of the producer.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 26be2bc. Configure here.

@ayushk7102
ayushk7102 self-requested a review November 25, 2026 18:39

@ayushk7102 ayushk7102 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.

Implementation makes sense, but there are some non-blocking points (mainly about changes in the beheaviour/meaning of some metrics)

Comment on lines +122 to +127
# budgets, so these derive the classic budget metrics from its actor pools.
# Remove with those metrics once task pools are gone.


def _actor_only_budget(op: PhysicalOperator) -> Optional[ExecutionResources]:
"""What ``op``'s actors hold: their count times the per-actor shape, and

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.

The connotation with data_*_budget is headroom (get_budget: Budget = Allocation − Usage), but _actor_only_budget reports "budget" as what resources the actors hold currently.

This effectively means that in the actor only backend, a resource-saturated op shows a large budget whereas the task backend showed ~0,

Same for data_object_store_memory_budget.

Could we either report headroom or leave the four budget gauges unset under actor-only?

Comment on lines +302 to +305
def _update_stats_metrics(self, state: str, force_update: bool = False):
# Backwards compatibility only: this backend has no ResourceManager
# usages, so fill the classic per-op metrics it would have set. Remove
# with them once task pools are gone, in favor of the actor-only metrics.

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.

Nit: Should we preserve the existing behaviour in the task backend and skip measuring the object store memory usage of InputDataBuffer?

def _estimate_object_store_memory_usage(
self, op: "PhysicalOperator", state: "OpState"
) -> int:
# Don't count input refs towards dynamic memory usage, as they have been
# pre-created already outside this execution.
if isinstance(op, InputDataBuffer):
return 0

the original code (task backend) reports 0 obj_store_mem_used for InputDataBuffer, since its blocks exist before execution starts (shown above inResourceManager._estimate_object_store_memory_usage).

Here the input op's blocks are in the bank, so with from_pandas / from_items / materialized inputs, ray_data_current_bytes shows the whole input on the input op for most of the first stage

if not isinstance(op, ExperimentalActorPoolMapOperator):
continue
blocked, running = op.cached_output_backpressured_actors()
op.notify_in_task_output_backpressure(

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.

Nit: I noticed that in the actor only branch, output backpressure (from calling output_backpressured_actors()) does not count pending actors

if info.running == 0 or info.pending > 0:
result = (0, 0)

This means that dashboard can show an op as output backpressured (0) while its actors are still starting. Is this expected?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Ray Data-related issues go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants