Repository navigation
Conversation
|
Here's a simple code that could reproduce the problem The first output is |
|
Thanks for pointing this out. See my comment on the JIRA issue -- the right solution is to override checkpoint() in VertexRDD. |
delegate checkpoint related method to partitionsRDD
|
I override those public checkpoint related functions, but that will let to other exceptions. Hope you can help me on that. The detailed description is on SPARK-2245 |
|
@bxshi can you add |
|
Can one of the admins verify this patch? |
|
@ankurdave @bxshi What's the status of this PR? It hasn't been updated in a while, though it looks simple enough from a review standpoint. |
|
It's not as simple as I thought... Here is my reply on JIRA about this PR I edited my original comment to add the updates, but I do not know if you can get them via email. So I resubmit it again. Hope that won't bother you. Ankur Dave Am I on the right track? Or Should there be another way to change it? |
|
Can one of the admins verify this patch? |
This reverts commit b9984350a3d2b706db92e50253d66c75f4304bb2.
…pache#1177) ### What changes were proposed in this pull request? The benchmark baseline for row 481, the checked narrow multiply, as its own pull request on the unchanged code, per the row's approved plan (`sql/varka/plans/m8/VARKA-481.md`, section 6). `VarkaNarrowEmitBenchmark` gains five shapes, after its existing seven so their indices hold: - `y1 * y2` and `s1 * s2`, stored, each in ANSI and in TRY; - `y1 * y2 < y3`, as a selection in ANSI. The data is `TINYINT` in [-11, 11] and `SMALLINT` in [-181, 181], so no product overflows and every arm answers. The shapes are compiled from their Catalyst expressions under each arm's options. So the change that rebuilds the checked multiply's tree measures the same class, unedited, as the other side of its comparison. The run fails if a compiled kernel reads its columns out of order, leaves a residual conjunct, or declines for any reason but a width refusal. It also prints whether the two arms' class bytes match for each new shape, which bears on the plan's sweep question. **A harness fix.** A kernel that can null a valid input has no dense loops, so the benchmark's settle gate, which waited for the dense loops to reach C2, never settled for the TRY shapes. `VarkaEmitterTestSupport.loopLevels` gains an overload that picks the masked loops, and the gate falls back to them. ### Why are the changes needed? Nothing times a checked narrow multiply today, and row 481 changes the emitted code of every one. It cuts three parked values to one, and skips an interior shift pair. The repository's rule is baseline first, so that change's effect is a diff against committed numbers. The committed numbers come from two `benchmark.yml` runs on an AMD EPYC 7763 runner, at 256 bits (run 41048813760) and at 128 bits with `-XX:MaxVectorSize=16` (run 41051964899), both on this branch's head `b0dc7f554b2`, with their provenance (`sql/catalyst/benchmarks/VarkaNarrowEmitBenchmark-jdk25-runner-epyc7763-*`). At 256 bits the widened and native arms tie on every checked multiply shape, as the plan's prediction 5 says: the stored `y1 * y2` and `s1 * s2` run at 0.7X of the section's first case under ANSI and 0.5X to 0.6X under TRY, and the interior `y1 * y2 < y3` at 0.6X, in both arms. A correction to the plan's premise: section 6 says the widened arm declines a byte column at 128 bits. On the laptop, neither arm declined at 128 bits, consistent with the part-form load row 329 added. The class's javadoc is corrected here, and the plan's outcome section will record it. ### Does this PR introduce _any_ user-facing change? No. This changes benchmark and test code only. ### How was this patch tested? - **Laptop runs:** at 256 and 128 bits, every case settled at C2 and nothing declined. Every answer matched the reference before and after compilation, and the two arms emitted identical class bytes for all five shapes. These numbers are for debugging only. - **Linters:** errorprone, lint-java, lint-scala and the license check are clean. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…1227) ### What changes were proposed in this pull request? Row 481's line in the milestone plan now opens with its state, **Started**: step 1 (the baseline benchmark of the checked narrow multiply) is built and merged with its EPYC runner results, and what is left is the `NULL` mode with its marked guard and the done-when. ### Why are the changes needed? The baseline merged as apache#1177, so the row has merged work, and the plan lint now reports that its line does not open with its state. Every later change to `PLAN.md` would fail that check until the line is fixed. ### Does this PR introduce _any_ user-facing change? No. One plan row's status only. ### How was this patch tested? `dev/varka_plan_lint.py --check` reports no findings with the change, against one on master; `dev/varka_quote_check.py` is clean. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
The pair for row 481: two benchmark.yml runs of VarkaNarrowEmitBenchmark on an AMD EPYC 7763 runner, at 256 bits (run 41142934207) and at 128 bits with -XX:MaxVectorSize=16 (run 41165599291), both on this branch's head 23c2637, replacing the baseline from apache#1177 (head b0dc7f5). Against that baseline every checked narrow multiply shape (y1 * y2 and s1 * s2 in ANSI and TRY, and y1 * y2 < y3) is within 2% at both widths, and the two arms tie at 256 bits, as section 6.1 predicted (items 4 and 5). Four shapes the change does not touch moved by 4% to 23% at 256 bits, in both directions, which is the runners' spread; the largest, the selection at a million rows, was an outlier in the baseline (1103 against 6107 to 7333 M rows/s on the other rungs). Generated-by: Claude Code (Opus 5.5)
…pache#1176) ### What changes were proposed in this pull request? Step 1 of row 481's approved plan (`sql/varka/plans/m8/VARKA-481.md`, section 8): a `NULL` mode on the IR's `GuardedRange`, with its oracle, grammar, specs and proof. No compiled expression uses it yet, and no emitted byte moves. `GuardedRange` checks that a lane's value lies within a range. Today it has one disposition, `FAIL`: an out-of-range valid lane declines the batch, and Spark's row engine raises. The new `NULL` mode instead makes an out-of-range lane null, which is what Spark's TRY mode does with an overflow. Row 481's next steps route an ANSI or TRY `TINYINT`/`SMALLINT` multiply through this guard. Rows 332, 343 and 349 take the same mode for their TRY nulls rather than each building their own. - **The node.** `GuardedRange` takes an `Overflow` mode. The three-argument constructor still builds `FAIL`, so every existing construction site is unchanged, and the constructor refuses `WRAP`. `withChildren` carries the mode. A `NULL` guard renders as `(guardedRange:NULL ...)`, and a `FAIL` guard renders exactly as before, so no existing shape key or class name changes. The cost model gets a separate, unpriced `GuardedRange/NULL/<lane>` feature. - **How it is emitted.** It follows a `NULL` `IntArith`: - It registers no refusal, so it sets no status bit. - It owns a validity word, which the liveness pass keeps. - It marks the kernel as able to null a valid input, so the kernel has no dense body. - It parks its value in its own slot. The walk shares its two range compares with the `FAIL` guard, through a new `emitRangeMask`, then clears the out-of-range lanes through `emitOverflowMask`'s `NULL` arm. `guardsStoredValues` now requires `FAIL`, so a `NULL` guard is never taken for the date column's bound. - **The oracle, specs and parser.** The reference evaluator nulls out-of-range values at the int and long lanes. `VarkaGuardSpecs` notes that a `NULL` guard is not a guard. `VarkaCanonicalIr` parses the new tag. - **The proof.** `narrow_range.smt2` gains the claim that `word & ~mask` keeps a lane valid exactly when it was valid and in range, over 16 lanes, for byte and short, with two wrong variants that must fail. - **The fuzz grammar** draws the mode in two new draws with their own seed, not in the existing ones. The existing draws are pinned by `emitted_bytes.json` and the cost tables, and drawing the mode there moves every block. As a result, until step 3 (which moves those bytes anyway and folds the mode into the main draws), no pinned draw reaches a `NULL` guard. The case of an int-lane guard inside a long-lane kernel is covered by an explicit mixed-lane test. ### Why are the changes needed? TRY's null on overflow has no in-kernel form today. So a TRY narrow multiply, a `try_cast` of a bigint, a floating cast's TRY null and decimal arithmetic under TRY either stay on Spark's row path or would each need a null disposal of their own. This builds the one form they share, first and alone, so it can be verified without any byte moving. ### Does this PR introduce _any_ user-facing change? No. No compiled expression builds the new mode yet. ### How was this patch tested? **New tests:** - every `TINYINT` pair (2^16) and the `SMALLINT` edge values through the step-3 tree (widen, wrapping multiply, `NULL` guard, narrow), on both lane arms, against a reference first checked against Spark's TRY rule; - an int-lane guard read by a sum, a comparison, a pick, a choice and a `FAIL` guard; - the long lane at both widths, and the `WRAP` refusal; - a mixed-lane kernel; - `withChildren` and the parser round trip; - the two new fuzz draws against the reference. **Existing outputs:** `VarkaEmittedBytesSuite`, `VarkaCoverageSuite` and `VarkaEmitCostSuite` pass. `emitted_bytes.json`, `coverage.json` and the cost tables are unchanged. **Proofs:** `dev/varka_prove.sh --solver both` holds all 16 checks. The run used solver binaries from another worktree; CI's install-and-prove run is the authoritative one. **Not covered locally:** the sql/core suites weren't built or run. This PR's Build and option matrix ran them. **The measurement:** `VarkaNarrowEmitBenchmark` on an AMD EPYC 7763 runner through `benchmark.yml`, at 256 bits (run 41142934207) and at 128 bits with `-XX:MaxVectorSize=16` (run 41165599291), both on head `23c26374efe`. The results replace the baseline committed by apache#1177 on the unchanged code. Every checked narrow multiply shape (`y1 * y2` and `s1 * s2` in ANSI and TRY, and `y1 * y2 < y3`) is within 2% of the baseline at both widths, and the widened and native arms tie at 256 bits, as the plan predicted. Four shapes the change does not touch moved by 4% to 23% at 256 bits, in both directions: that is the runners' spread, and the largest move, the selection at a million rows, was an outlier in the baseline itself. **Linters:** errorprone, lint-java, lint-scala, the plan lint and the quote check are clean. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
Seems one can not materialize VertexRDD by simply calling count method, which is overridden by VertexRDD. But if you call RDD's count, it could materialize it.
Is this a feature that designed to get the count without materialize VertexRDD? If so, do you guys think it is necessary to add a materialize method to VertexRDD?
By the way, does count() is the cheapest way to materialize a RDD? Or it just cost the same resources like other actions?
Best,