Repository navigation
[data][actor-only][11/n] Classic dashboard metrics under the actor-only backend - #67707
iamjustinhsu wants to merge 3 commits into
Conversation
aef8f0e to
3060d34
Compare
There was a problem hiding this comment.
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.
| op._metrics.obj_store_mem_used = self._resource_bank.live_object_store( | ||
| op=op | ||
| ).total_bytes() |
There was a problem hiding this comment.
Accessing the private attribute _metrics of PhysicalOperator directly is a style violation and poses a maintainability risk. Please use the public metrics property instead.
| 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() |
4f2f5f6 to
d9caffa
Compare
738eb86 to
17b9871
Compare
17b9871 to
094a45f
Compare
094a45f to
58bd40f
Compare
58bd40f to
839c213
Compare
1c056fc to
db0a692
Compare
| for op, op_state in self._topology.items(): | ||
| op.metrics.obj_store_mem_used = self._resource_bank.live_object_store( | ||
| op=op | ||
| ).total_bytes() |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit db0a692. Configure here.
db0a692 to
02d417f
Compare
3a0a8e0 to
b43616b
Compare
| op.notify_in_task_output_backpressure( | ||
| not op.has_completed() and running > 0 and blocked == running, | ||
| "Output", | ||
| ) |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit b43616b. Configure here.
b43616b to
765b451
Compare
b43616b to
dcd32ee
Compare
dcd32ee to
2e77897
Compare
…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]>
2e77897 to
26be2bc
Compare
There was a problem hiding this comment.
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).
❌ 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() |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 26be2bc. Configure here.
ayushk7102
left a comment
There was a problem hiding this comment.
Implementation makes sense, but there are some non-blocking points (mainly about changes in the beheaviour/meaning of some metrics)
| # 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 |
There was a problem hiding this comment.
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?
| 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. |
There was a problem hiding this comment.
Nit: Should we preserve the existing behaviour in the task backend and skip measuring the object store memory usage of InputDataBuffer?
ray/python/ray/data/_internal/execution/resource_manager.py
Lines 163 to 169 in 1f27310
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( |
There was a problem hiding this comment.
Nit: I noticed that in the actor only branch, output backpressure (from calling output_backpressured_actors()) does not count pending actors
This means that dashboard can show an op as output backpressured (0) while its actors are still starting. Is this expected?
…assic-dashboard-metrics Signed-off-by: iamjustinhsu <[email protected]>
…assic-dashboard-metrics Signed-off-by: iamjustinhsu <[email protected]>


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:#000Subsystems
observability (flag-gated)
Testing
RAY_DATA_ACTOR_ONLY_BACKEND=1 pytest python/ray/data/tests/actor_only: 382 passed.pre-commit runon changed files: clean.Notes
gh pr list --repo ray-project/ray --state open --search "actor-only").🤖 Generated with Claude Code