Repository navigation
[SPARK-1021] Defer the data-driven computation of partition bounds in so... - #1689
erikerlandson wants to merge 7 commits into
Conversation
|
Can one of the admins verify this patch? |
|
Jenkins, this is ok to test. |
|
QA tests have started for PR 1689. This patch merges cleanly. |
|
QA results for PR 1689: |
There was a problem hiding this comment.
Can we perhaps make this thread safe?
|
QA tests have started for PR 1689. This patch merges cleanly. |
|
QA results for PR 1689: |
There was a problem hiding this comment.
Do we not want to deserialize valRB if it is not null? Are you worried rangeBounds might be called while the deserialization is happening?
There was a problem hiding this comment.
also was assuming readObject might be called in multiple threads. Can that happen?
|
Latest push updates RangePartition sampling job to be async, and updates the async action functions so that they will properly enclose the sampling job induced by calling 'partitions'. |
|
QA tests have started for PR 1689 at commit
|
|
Excellent! I'll try to find some time to review this soon. |
|
QA tests have finished for PR 1689 at commit
|
|
QA tests have started for PR 1689 at commit
|
|
QA tests have finished for PR 1689 at commit
|
|
Can one of the admins verify this patch? |
… sortByKey() until evaluation.
…ePartitioner sampling job properly
f3448e4 to
50b6da6
Compare
|
Jenkins, test this please. |
|
QA tests have started for PR 1689 at commit
|
|
@erikerlandson thanks for looking at this. A few questions:
c.parallelize(1 to 1000).map(x => (x, x)).sortByKey().join(sc.parallelize(1 to 10).map(x=>(x,x))) |
|
QA tests have finished for PR 1689 at commit
|
|
Hi @rxin,
My impression is that this whack-a-mole with non-laziness stems from a combination of (a) a data-dependent partitioner(s), with (b) methods that refer to input partitioners as part of the construction of new RDDs. It might be possible to thread some design changes around so that references to partitioning are consistently encapsulated in a Future. Functions such as However it seems (imo) outside the scope of this particular Jira/PR. Maybe we could start another umbrella Jira to track possible solutions along these lines. Another orthogonal thought -- you can short circuit all this by providing a partitioner instead of forcing it to be computed from data. That's not as sexy, or widely applicable, as some deeper fix to the problem, but users can do it now as a workaround when it's feasible. |
|
Or, maybe just look into playing the same game with the cogrouped RDDs that I did with sortByKey. Don't get into invoking |
|
Yea I don't think we need to fully solve 3 here. My main concern with these set of changes is 2, since a single badly behaved RDD can potentially block the (unfortunately single threaded) scheduler forever. Let me think about this a little bit and get back to you. If you have an idea about how to fix that, feel free to suggest them. |
|
So far the best idea I have for (2) is to set some kind of time-out on the evaluation. The bound computation uses subsampling that will (when all goes well) cap the computation at constant time(*). If the timeout triggers, some sub-optimal falback for partitioning might be used. Or just fail the entire evaluation. (*) more accurately, constant number of samples. the time required could depend on various things. |
|
Actually I looked at it again. I don't think it would block the scheduler because we compute partitions outside the scheduler thread. This approach looks good to me! |
|
@erikerlandson i'm going to merge this first. Maybe we can do the cleanup later. |
|
BTW one thing that would be great to add is a test that makes sure we don't block the main dag scheduler thread. The reason I think we don't block is that we call rdd.partitions.length in submitJob: /**
* Submit a job to the job scheduler and get a JobWaiter object back. The JobWaiter object
* can be used to block until the the job finishes executing or can be used to cancel the job.
*/
def submitJob[T, U](
rdd: RDD[T],
func: (TaskContext, Iterator[T]) => U,
partitions: Seq[Int],
callSite: CallSite,
allowLocal: Boolean,
resultHandler: (Int, U) => Unit,
properties: Properties = null): JobWaiter[U] =
{
// Check to make sure we are not launching a task on a partition that does not exist.
val maxPartitions = rdd.partitions.length |
|
Have either of you thought about how to coordinate this with Josh's work on SPARK-3626? #2482 |
|
Since this PR was merged the correlationoptimizer14 test has been hanging. We might want to consider rolling back. You can reproduce the problem as follows: |
|
I reverted this commit. @erikerlandson mind taking a look at this problem? |
|
@marmbrus, FWIW, the Not sure why, but running |
…apache#1689) We’ve added checkAllStateStoreProviders for Dedisco project to allow checking all state stores which is a debugging feature. One thing we recently discussed with Dedisco project is, the time spent on such check is not counted by reportTimeTaken which can be observed in stream progress later.
…ache#1689) ### What changes were proposed in this pull request? This PR reverts apache#1626 (squash commit `c4b0475d86e`, row 611). That PR added the `GuardedProduct` node, the `checkedLongMultiply` emit option and three option arms in `sql/varka/emitted_bytes.json`. The tree equals master minus apache#1626: `git diff c4b0475^ HEAD -- . ':!sql/varka/plans'` shows only apache#1687's later `dev/` changes, which this PR keeps, and one README example fixed (below). A second commit adds a dated note, `VARKA-611.md` 9.2, and a new newest state on `PLAN.md` row 611. The plan text apache#1626 added stays as the record of what was built. The note says the work is reverted at the owner's word and must be redesigned before it lands again, and it lists what the redesign owes: - **Its pin guarded none of its code.** On `c4b0475d86e`, `emitted_bytes.json` has 27 option arms and 11 distinct digests. The three `checkedLongMultiply` arms emit the same bytes as `useAVX=2` on every pinned shape (14 arms share those digests). The redesign must pin a shape whose bytes the guarded product changes. - **No new machine option with a non-default subject lands until the pin test is split or cached.** The split is branch `varka-emitted-bytes-budget`, not yet a pull request. - **The default per host belongs to row 648** (fuse where faster, else decline), whose plan is not on master yet. - **Keep the conformance fix.** `VarkaTypeConformance.guardsProduct` and the check that holds a batch's status to the guards' verdict are to come back with the redesign. ### Why are the changes needed? Master is red. The pin test in `VarkaEmittedBytesSuite` ("sql/varka/emitted_bytes.json pins what the emitter produces for every shape") passes its 600 s cap on the AVX2 EPYC 7763 runners. Master run 45256702183 failed 3 of 3 attempts, all on 7763s. Before apache#1626 the test took 511 to 551 s on AVX2-only runners. apache#1626's three arms are each a full emission pass at both widths (option arms 24 to 27), which puts it at about 615 to 650 s. That figure is extrapolated, since the red runs stop at the cap. On the fast EPYC 9V45 the same test grew from 281-295 s to 334 s, which is why apache#1626's own master run passed. Master must be green before the row 489 refactoring. This is a critical fix, which the hold on new PRs before row 489 allows. ### Does this PR introduce _any_ user-facing change? No. The option was off by default (`BOUND_ONLY`, today's decline), and no session reached the other values. ### How was this patch tested? `git revert` of `c4b0475d86e` applied with no conflicts. The local gate (`pre-pr.sh`: regeneration of the generated files, the arm sweep, the linters and the push check) passed on this branch. No `GuardedProduct`, `checkedLongMultiply`, `guardsProduct` or `guardsLongProducts` is left outside the plans: a worked example in `dev/varka_ops/README.md`, from apache#1687, named the option, and this PR switches it to `useAVX=2,narrowConversionForm=WINDOWED`. A `/code-review high` pass over the branch found six documentation nits, all fixed or recorded in the last commit. The full CI runs on this PR. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
Master reverted apache#1626 (apache#1689). The conflicts were the guarded product's remains from the earlier merge: VarkaNodeCompiler drops guardsProduct and keeps the two-lane reason in VarkaKernelPlan only, DeclineSink's constructor doc drops the guarded-product sentence, the long-lane suite takes master's (the apache#1626 tests go), and PLAN.md takes master's row 611 and the branch's row 612. Generated-by: Claude Code (Claude Opus 5.5)
...rtByKey() until evaluation.