Skip to content

[WIP] SPARK-2126: Move MapOutputTracker behind ShuffleManager interface to - #1240

Closed
CodingCat wants to merge 10 commits into
apache:masterfrom
CodingCat:SPARK-2126
Closed

CodingCat wants to merge 10 commits into
apache:masterfrom
CodingCat:SPARK-2126

Conversation

@CodingCat

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SPARK-2126

Move MapOutputTracker behind ShuffleManager interface to enable customized MapOutputTracker implementation

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16178/

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16179/

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

1 similar comment
@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16180/

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16181/

@CodingCat CodingCat closed this Jun 27, 2014
@CodingCat CodingCat reopened this Jun 27, 2014
@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16191/

@CodingCat

Copy link
Copy Markdown
Contributor Author

@pwendell @markhamstra

Hi, Patrick and Mark, I submitted this version of PR, expect your feedbacks!

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16194/

@colorant

Copy link
Copy Markdown
Contributor

I guess, the idea to put mapOutput tracker behind shuffleManager is not just make it a shufflemanager's member and still call this member's function from DAGScheduler side? the external interface should probably been reduced to minimum if not possible to completely hide, most of logics should be handle within shuffleManager itself. Of course this could not be done without change to shuffle fetcher etc. Just my thought, might not be correct ;)

@CodingCat CodingCat changed the title SPARK-2126: Move MapOutputTracker behind ShuffleManager interface to [WIP] SPARK-2126: Move MapOutputTracker behind ShuffleManager interface to Jun 27, 2014
@CodingCat

Copy link
Copy Markdown
Contributor Author

@colorant yes, the current version is definitely not a perfect one; I'm also aware of that function calls like

shuffleManager.mapOutputTracker.xxx

is ......not clean

the reason I hesitate to make further refactoring is that, I'm not sure if we really want to make ShuffleManager to know anything about the stuffs in other domain (e.g. Executor, which is supposed to be a scheduling stuff and would possibly be introduced to shuffleManager if we want to do everything within it instead of in DAGScheduler)

in that case, I'm afraid in future, we will fall into the same situation which we are facing in DAGScheduler now...(DAGScheduler knows everything, from task level to DAG level....)

any suggestion? also @pwendell @markhamstra

@nchammas

nchammas commented Dec 8, 2014

Copy link
Copy Markdown
Contributor

@pwendell @mateiz What is the status of this PR? It's been 5 months since the last update.

Should @CodingCat continue to work on this or close it and move on?

@CodingCat

Copy link
Copy Markdown
Contributor Author

we can close it, as the relevant code has been changed a lot....

@CodingCat CodingCat closed this Dec 8, 2014
@nchammas

nchammas commented Dec 8, 2014

Copy link
Copy Markdown
Contributor

Okie doke!

github-actions Bot pushed a commit to MaxGekk/spark that referenced this pull request Nov 1, 2026
…che#1240)

### What changes were proposed in this pull request?

A benchmark that times writing a decimal output on the unchanged code, before Varka gains a store for decimal columns. It is the baseline the coming store is measured against, committed in its own pull request first.

Arrow keeps every decimal in a sixteen-byte slot, low word first. Varka's kernels compute a decimal of precision up to 18 as one unscaled `long` a row, so writing it out needs the low word and its sign extension in each slot. The new `VarkaDecimalStoreBenchmark` (catalyst, on `VarkaBenchmarkBase`) emits kernels from Varka's IR and times two arms:
- **the control**: the same value stored as a `BIGINT`, eight bytes a row;
- **the scalar widening**: that store followed by a loop that writes `u` and `u >> 63` into a `DecimalVector`'s slots, the form the vector store has to beat.

The arms run over three shapes and three sizes. The shapes are `time_to_seconds(t)`, `extract(SECOND FROM t)` at `TIME(6)`, and the store alone over a long column. The sizes are 8192 rows (in L2 on the runner's EPYC 7763 for every arm), 262144 rows (in L3) and 8388608 rows (past L3). The compiler declines both TIME shapes as decimal outputs today, so their IR is built by hand as the store's plan lowers them.

Every arm is driven to C2 code before it is timed, read through a JFR recording of the JIT. Its tier state is written beside its numbers. An arm whose recording falls behind is noted as not settled and timed anyway, so a loaded runner cannot fail the run. Every row of every size is checked against Spark's own `DateTimeUtils` functions, on the first call and again in compiled code.

`VarkaDecimalStoreBenchmarkSuite` (run in every build, about 18 seconds) holds three checks:
- the hand-built IR against Spark over the whole day, including values off the whole microsecond, which test `time_to_seconds`'s rounding;
- the widening loop's bytes against `DecimalVector.set(int, long)`;
- the validity bits the kernel writes, at lengths 1 to 4097.

It runs under the option matrix.

`note()`, which writes a line into a results file, moves from sql/core's `VarkaSqlBenchmarkBase` into catalyst's `VarkaBenchmarkBase`, so this catalyst class can use it. Two sql/core copies are removed.

**Results.** The committed files come from `benchmark.yml` on an AMD EPYC 7763 runner, at 256 bits (run 41236177537) and at 128 bits with `-XX:MaxVectorSize=16` (run 41237791753), both on head `feba8d69fe4`, with their provenance (`sql/catalyst/benchmarks/VarkaDecimalStoreBenchmark-jdk25-runner-epyc7763-*`). Every arm settled at C2 at every size. At 256 bits, the scalar widening adds 0.5 to 1.8 ns a row to the two TIME shapes. For the store alone over a long column it takes 0.6 ns a row against the `BIGINT` store's 0.2 in L2, and 1.6 against 0.7 past L3. That gap is what the vector store has to close.

### Why are the changes needed?

The repository's rule for a change that improves a measured path is baseline first: the unchanged code's numbers are committed before the code that moves them. Without this class, the decimal store's speed-up over the scalar widening it replaces could not be shown.

### Does this PR introduce _any_ user-facing change?

No. This adds a benchmark and its test only.

### How was this patch tested?

- `VarkaDecimalStoreBenchmarkSuite` passes at the defaults and under the 45 option-matrix configurations that run in catalyst, via `dev/varka_matrix.sh --all --module catalyst`.
- `VarkaTierWitnessSuite` passes.
- Planted faults catch both rules: a logical instead of arithmetic shift in the widening, and a dropped `+ 500` in `time_to_seconds`.
- A laptop run of the class settles every arm at C2 and passes every check. Its numbers are for debugging only.
- `sql/Test/compile` passes after the `note()` move.
- lint-java, lint-scala, the plan lint and the pre-commit hook are clean.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5.5)
MaxGekk pushed a commit to MaxGekk/spark that referenced this pull request Nov 2, 2026
VarkaRoundingBaselineBenchmark (apache#1257) passed its sections' boolean fuses flag to
requireBaseline, whose last parameter became a Fusion class in apache#1240 and apache#1258 while apache#1257 was
open. apache#1257's Build ran on its older base, so master has not compiled sql's tests since it merged.
A row-path baseline lists no section as fusing, so each section expects NONE, and one a later row
marks as fusing expects WHOLE.

Generated-by: Claude Code (Opus 5.5)
(cherry picked from commit cb56b26)
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.

4 participants