Skip to content

[SPARK-2588][SQL] Add some more DSLs. - #1491

Closed
ueshin wants to merge 3 commits into
apache:masterfrom
ueshin:issues/SPARK-2588
Closed

ueshin wants to merge 3 commits into
apache:masterfrom
ueshin:issues/SPARK-2588

Conversation

@ueshin

@ueshin ueshin commented Jul 19, 2014

Copy link
Copy Markdown
Member

No description provided.

@SparkQA

SparkQA commented Jul 19, 2014

Copy link
Copy Markdown

QA tests have started for PR 1491. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16841/consoleFull

@SparkQA

SparkQA commented Jul 19, 2014

Copy link
Copy Markdown

QA results for PR 1491:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16841/consoleFull

Conflicts:
	sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala
@SparkQA

SparkQA commented Jul 22, 2014

Copy link
Copy Markdown

QA tests have started for PR 1491. This patch merges cleanly.
View progress: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16939/consoleFull

@SparkQA

SparkQA commented Jul 22, 2014

Copy link
Copy Markdown

QA results for PR 1491:
- This patch PASSES unit tests.
- This patch merges cleanly
- This patch adds no public classes

For more information see test ouptut:
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16939/consoleFull

@marmbrus

Copy link
Copy Markdown
Contributor

Thanks, I've merged this into master.

@asfgit asfgit closed this in 1b790cf Jul 23, 2014
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
Author: Takuya UESHIN <ueshin@happy-camper.st>

Closes apache#1491 from ueshin/issues/SPARK-2588 and squashes the following commits:

43d0a46 [Takuya UESHIN] Merge branch 'master' into issues/SPARK-2588
1023ea0 [Takuya UESHIN] Modify tests to use DSLs.
2310bf1 [Takuya UESHIN] Add some more DSLs.
kazuyukitanimura added a commit to kazuyukitanimura/spark that referenced this pull request Aug 16, 2022
@ueshin
ueshin deleted the issues/SPARK-2588 branch August 3, 2026 22:59
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Nov 11, 2026
…YC run (apache#1491)

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

This PR commits a second EPYC 7763 runner run of `VarkaWideConversionBenchmark` at both vector widths and records what it shows in row 583 of `sql/varka/plans/m8/PLAN.md`, which it marks Done. It also brings row 600, which cites the same runs, up to date. It changes no code.

apache#1476 made two cheaper exact forms the defaults for a `BIGINT` cast to `DOUBLE` and `FLOAT` on x86 hosts without AVX512DQ, where C2 has no instruction for the Vector API's `L2D` and `L2F`:
- `L2D` uses the XOR split (`wideConversionForm=XOR_SPLIT`) instead of 343b1's split (`SPLIT`). 343b1's bounded magic (`MAGIC`) stays an option.
- `L2F` uses new sign and arm-mask steps (`roundToOddByShifts=false`) instead of 343b1's shifts.

Its runner evidence was one run per width: runs 42894474041 (256 bits) and 42894494552 (128 bits, `-XX:MaxVectorSize=16`), committed as `sql/catalyst/benchmarks/VarkaWideConversionBenchmark-jdk25-runner-epyc7763-results.txt` and its `-128bit` twin.

The new runs are vecbricks/varka runs 42968007113 (256 bits) and 42968017626 (128 bits, `-XX:MaxVectorSize=16`), both on an AMD EPYC 7763. Their artifacts are committed unchanged as the `-2-` twins of those two files, with their provenance files, which is how row 313 (apache#844) committed a repeated runner run. Both runs were dispatched from master and checked out `refs/pull/1476/head` at `e03d06d58d4`. That commit and the one before it only add results and plan text, so the code under test is the same as in the first pair at `d6208553a03`. The provenance files name the commit.

Taking each arm's best time over the two runs (Spark's benchmark computes the Rate column from the best time):

| ratio | 256-bit, L2 | 256-bit, L3 | 256-bit, past L3 | 128-bit, L2 | 128-bit, L3 | 128-bit, past L3 |
|---|---|---|---|---|---|---|
| new `L2F` steps / 343b1's shifts | 1.21 | 1.22 | 1.18 | 1.17 | 1.17 | 1.17 |
| bounded magic / XOR split | 1.04 | 1.03 | 1.07 | 0.011 | 0.013 | 0.025 |
| XOR split / 343b1's split | 1.69 | 1.68 | 1.02 | 2.38 | 2.03 | 1.24 |

- **The `L2F` gain holds.** By the two runs' minimums it is 17 to 22% at every rung and both widths. Its arms moved under 1.5% between the runs.
- **At 256 bits the magic stays ahead, but by an unsettled margin.** It leads the XOR split at every rung in both runs. In L3, though, the XOR and magic arms moved 20% and 22% between runs, much more than the lead. The magic is not the default, and the reason is unchanged: it is exact only for rows inside its window, and at 128 bits its range guard runs as the Vector API's Java fallback, at about 40 M rows/s in both runs.
- **Past L3 at 256 bits, the XOR split's lead over 343b1's split did not hold.** Run 1 measured 1.05 times. By the minimums it is 1.02 times, and in run 2 the XOR split was 0.4% slower. So the two forms tie there, where every arm is memory-bound. At 128 bits past L3 the lead was 1.24 times in both runs.
- **In cache the XOR split's lead stays well above 1.3 times.** At 256 bits run 2 measured 1.69 in L2 and 1.68 in L3, against run 1's 1.85 and 1.45.

No default changes.

### Why are the changes needed?

`sql/varka/AGENTS.md` requires a second run, compared by minimums, before a claim that rests on a ratio under about 1.3 times is written down. Row 583 recorded the `L2F` gain, the magic's lead and the XOR split's lead past L3 from one runner run per width, and marked them as owed that second run. This PR supplies the second run. Two of the claims hold, at least in direction, and the third (the 256-bit lead past L3) is corrected to a tie.

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

No. Results files and plan text only.

### How was this patch tested?

- The four new files are the two runs' artifacts, downloaded with `gh run download` and copied without edits. Their provenance files give the CPU (AMD EPYC 7763), the JDK (Zulu 25.0.5), the vector datapath check and the commit checked out.
- I computed the ratios by parsing the Rate column of both runs' results files for each arm.
- `dev/varka_plan_lint.py --check`, `dev/varka_msg_check.py pr` and `dev/varka_push_check.py` pass.

### Accepted trade-offs and follow-ups

- **Row 583 is marked Done.** With apache#1476 merged and this second run recorded, its Done-when conditions are met: both forms are built below level 3, proven exact in `round_to_odd.smt2`, held to Java's casts by the wide-conversion suite, and measured against 343b1's forms on the EPYC 7763 runners, and each replaces its form where it wins. apache#1476's open review items are not Done-when conditions. Among them is the emit budget weighing an `L2D` at the old split's 10 calls although the default emits 8.
- **Row 600 is updated.** That row owns `L2F`'s gap to a scalar loop. It now quotes the `L2F` gain as 1.17 to 1.22 times by two-run minimums, and the scalar gap past L3 at 256 bits as 78% (the minimum), not run 1's 79%. It also says the results are on master.
- **A `/code-review high` of this change** found misquoted or stale figures in the row text: the magic's L2 lead by minimums (1.04, not 1.05), the `L2F` arms' movement (under 1.5%, not 1%), the L3 spread (20 and 22%), the run-1 in-cache ratios left unrequoted, and the scalar gap given only for the cache rungs. All are fixed.

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

Generated-by: Claude Code (Opus 5.5)
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