Skip to content

using flatcc for serialization - #111

Closed
pcmoritz wants to merge 21 commits into
masterfrom
flatcc
Closed

pcmoritz wants to merge 21 commits into
masterfrom
flatcc

Conversation

@pcmoritz

@pcmoritz pcmoritz commented Dec 9, 2016

Copy link
Copy Markdown
Contributor

No description provided.

istoica and others added 8 commits December 11, 2016 23:07
…ma_send_wait_request/reply; PLASMA_SUBSCRIBE / UNSUBSCRIBE and PLASMA_DATA / PLASMA_TRANSFER
…hough the functions they are based on are unit tested. Still should add unit testing especially for subscribe to check that it works when the object ID list is empty.
…e the array (since the size of the array is not known by the caller) with unit tests
@robertnishihara

Copy link
Copy Markdown
Collaborator

Replaced by #140.

@robertnishihara
robertnishihara deleted the flatcc branch December 20, 2016 21:23
owenowenisme added a commit that referenced this pull request Nov 10, 2026
## Description

Adds one shared component for per-phase shuffle metrics and exports each
phase to Prometheus under its own tag.

Today GPU shuffle keeps per-phase `OpRuntimeMetrics` objects but never
exposes them, so its dashboard task counts, shuffle progress bar, and
output estimate all stay at 0. Shuffle v2 reports correctly but
duplicates the estimate and progress-bar code across its map, reduce,
and disk variants.

`shuffle_phase_metrics.py` adds `ShufflePhaseMetrics` (one phase's
counters, block stats, progress bar) and `ShuffleOperatorMetrics` (an
operator's phases, answering `get_stats`, `_extra_metrics`,
`get_phase_metrics`, the sub-progress bar hooks, and `num_outputs_total`
from them). Phase events update the phase's own counters; task events
are also replayed on the operator's `self._metrics` under a
collision-free key, output events only from the output phase. A lone
phase is aliased to the operator's metrics, so single-phase operators
keep today's shapes.

## Related issues

Related to #61636, which proposed a `ShuffleEngine` abstraction for
shuffle v1 and was closed because v1 is being replaced. This PR keeps
only the metrics half, as a composed component, for GPU and v2.

## Additional information

```mermaid
flowchart LR
  classDef obj fill:#eef3ff,stroke:#4a6fd6,color:#111
  classDef comp fill:#e8f7ec,stroke:#2e8b57,color:#111
  classDef surface fill:#f3f3f3,stroke:#888,color:#111

  subgraph OP["Any shuffle operator (GPU: two phases · v2: one phase, aliased to the operator counters)"]
    direction LR
    som["ShuffleOperatorMetrics (new)<br/>holds the phases; rebuilds the four surfaces from them on request;<br/>keeps the output-total estimate"]:::comp
    p1["Phase 'shuffle' (ShufflePhaseMetrics, new)<br/>its own counters, block-stats list, progress bar,<br/>shuffle-specific numbers (partitions, bytes shuffled)"]:::comp
    p2["Phase 'finalize' = the output phase<br/>(ShufflePhaseMetrics, new)<br/>same contents as above"]:::comp
    base["Operator-level counters (_metrics, from base class)<br/>now complete: tasks of both phases,<br/>real outputs handed downstream"]:::obj
    som --> p1
    som --> p2
    p1 -- "forwards task started / finished" --> base
    p2 -- "forwards task started / finished<br/>and outputs produced / queued" --> base
  end

  subgraph SURF["What the user sees"]
    direction TB
    prom[("Grafana dashboard (Prometheus gauges)<br/>three series: the operator,<br/>operator/shuffle, operator/finalize")]:::surface
    stats[["ds.stats() summary table<br/>rows: OperatorNameShuffle,<br/>OperatorNameFinalize"]]:::surface
    extra[["ds.stats() 'Extra metrics' line<br/>{shuffle: {…}, finalize: {…}}"]]:::surface
    pm(["Progress manager<br/>one nested bar per phase,<br/>each handed to its phase"]):::surface
  end

  base -- "exported as the op's metrics" --> prom
  som -- "get_phase_metrics(): one extra series per phase" --> prom
  som -- "get_stats()" --> stats
  som -- "_extra_metrics()" --> extra
  som -- "sub-progress bar names / bar objects" --> pm
```

Tests: `test_shuffle_phase_metrics.py` (new, 17 cases) covers the
component and drives a minimal `PhysicalOperator` through all four
surfaces.

AI assistance (Claude Code) was used for drafting this PR (code and
description); every changed line was manually reviewed and the tests
above run locally.

---------

Signed-off-by: Sirui Huang <[email protected]>
Signed-off-by: HFFuture <[email protected]>
Co-authored-by: You-Cheng Lin <[email protected]>
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.

3 participants