Repository navigation
Conversation
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16360/ |
|
Might be simpler to move the noprefs block inside the NODE_LOCAL condition [1] - after NODE_LOCAL tasks have been checked. [1] if (TaskLocality.isAllowed(locality, TaskLocality.NODE_LOCAL) |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16370/ |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16371/ |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16373/ |
|
close temporarily for local test..... |
|
Merged build triggered. |
|
Merged build started. |
|
will this modification cause streaming test case failed (timeout)? I cannot reproduce in my local side constantly..... |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16388/ |
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
There was a problem hiding this comment.
This should still be called maxLocality, undo the rename to preferredLocality
|
Thanks, this looks good. I made some more small comments on it and there were a couple left over from before. Please take a look at https://github.com/apache/spark/pull/1313/files and fix them. Then I think it will be good to go! |
|
QA tests have started for PR 1313. This patch merges cleanly. |
|
QA results for PR 1313: |
There was a problem hiding this comment.
Hey sorry, one other question.. why did you change this? It seems that this breaks what we were testing for before.
|
Cool, thanks! One final thing, I made some comments on the tests since it seemed that some of the changes broke previous stuff we were testing for. If they didn't, please explain why you changed them. |
|
QA tests have started for PR 1313. This patch merges cleanly. |
|
that's for fitting some early version of the patches, sorry about that, I just forgot to undo the changes... |
|
Alright, thanks for all your work on this. Just want to make sure we don't miss stuff here. |
|
QA results for PR 1313: |
|
thanks for the patient review @mateiz @mridulm @kayousterhout @lirui-intel |
|
Alright, I've merged this in. Thanks Nan! |
copied from original JIRA (https://issues.apache.org/jira/browse/SPARK-2294): If an executor E is free, a task may be speculatively assigned to E when there are other tasks in the job that have not been launched (at all) yet. Similarly, a task without any locality preferences may be assigned to E when there was another NODE_LOCAL task that could have been scheduled. This happens because TaskSchedulerImpl calls TaskSetManager.resourceOffer (which in turn calls TaskSetManager.findTask) with increasing locality levels, beginning with PROCESS_LOCAL, followed by NODE_LOCAL, and so on until the highest currently allowed level. Now, supposed NODE_LOCAL is the highest currently allowed locality level. The first time findTask is called, it will be called with max level PROCESS_LOCAL; if it cannot find any PROCESS_LOCAL tasks, it will try to schedule tasks with no locality preferences or speculative tasks. As a result, speculative tasks or tasks with no preferences may be scheduled instead of NODE_LOCAL tasks. ---- I added an additional parameter in resourceOffer and findTask, maxLocality, indicating when we should consider the tasks without locality preference Author: CodingCat <zhunansjtu@gmail.com> Closes #1313 from CodingCat/SPARK-2294 and squashes the following commits: bf3f13b [CodingCat] rollback some forgotten changes 89f9bc0 [CodingCat] address matei's comments 18cae02 [CodingCat] add test case for node-local tasks 2ba6195 [CodingCat] fix failed test cases 87dd09e [CodingCat] fix style 9b9432f [CodingCat] remove hasNodeLocalOnlyTasks fdd1573 [CodingCat] fix failed test cases 941a4fd [CodingCat] see my shocked face.......... f600085 [CodingCat] remove hasNodeLocalOnlyTasks checking 0b8a46b [CodingCat] test whether hasNodeLocalOnlyTasks affect the results 73ceda8 [CodingCat] style fix b3a430b [CodingCat] remove fine granularity tracking for node-local only tasks f9a2ad8 [CodingCat] simplify the logic in TaskSchedulerImpl c8c1de4 [CodingCat] simplify the patch be652ed [CodingCat] avoid unnecessary delay when we only have nopref tasks dee9e22 [CodingCat] fix locality inversion bug in TaskManager by moving nopref branch (cherry picked from commit 63bdb1f) Signed-off-by: Matei Zaharia <matei@databricks.com>
copied from original JIRA (https://issues.apache.org/jira/browse/SPARK-2294): If an executor E is free, a task may be speculatively assigned to E when there are other tasks in the job that have not been launched (at all) yet. Similarly, a task without any locality preferences may be assigned to E when there was another NODE_LOCAL task that could have been scheduled. This happens because TaskSchedulerImpl calls TaskSetManager.resourceOffer (which in turn calls TaskSetManager.findTask) with increasing locality levels, beginning with PROCESS_LOCAL, followed by NODE_LOCAL, and so on until the highest currently allowed level. Now, supposed NODE_LOCAL is the highest currently allowed locality level. The first time findTask is called, it will be called with max level PROCESS_LOCAL; if it cannot find any PROCESS_LOCAL tasks, it will try to schedule tasks with no locality preferences or speculative tasks. As a result, speculative tasks or tasks with no preferences may be scheduled instead of NODE_LOCAL tasks. ---- I added an additional parameter in resourceOffer and findTask, maxLocality, indicating when we should consider the tasks without locality preference Author: CodingCat <zhunansjtu@gmail.com> Closes apache#1313 from CodingCat/SPARK-2294 and squashes the following commits: bf3f13b [CodingCat] rollback some forgotten changes 89f9bc0 [CodingCat] address matei's comments 18cae02 [CodingCat] add test case for node-local tasks 2ba6195 [CodingCat] fix failed test cases 87dd09e [CodingCat] fix style 9b9432f [CodingCat] remove hasNodeLocalOnlyTasks fdd1573 [CodingCat] fix failed test cases 941a4fd [CodingCat] see my shocked face.......... f600085 [CodingCat] remove hasNodeLocalOnlyTasks checking 0b8a46b [CodingCat] test whether hasNodeLocalOnlyTasks affect the results 73ceda8 [CodingCat] style fix b3a430b [CodingCat] remove fine granularity tracking for node-local only tasks f9a2ad8 [CodingCat] simplify the logic in TaskSchedulerImpl c8c1de4 [CodingCat] simplify the patch be652ed [CodingCat] avoid unnecessary delay when we only have nopref tasks dee9e22 [CodingCat] fix locality inversion bug in TaskManager by moving nopref branch
…s check (apache#1313) ### What changes were proposed in this pull request? Under test, every batch a Varka kernel serves is also run through the kernel's other loop body, dense or masked, and the two outputs must agree byte for byte. This check now accepts any NaN against any NaN on a `FLOAT` or `DOUBLE` output. Every other value must still be byte-equal: the sign of zero, every non-NaN float, and every value of an integral, decimal, date or time output. - **The runner learns which outputs are floating.** `VarkaKernelRunner` gains `dstFloating` beside `dstWidth`. `VarkaEvaluatorBase` sets it from the output's Arrow vector (`Float4Vector` or `Float8Vector`). A filter's selection bitmaps leave it false. - **The comparison.** `compareBodies` takes the flag. A row whose bytes differ on a floating output still agrees when both bodies hold a NaN of that width. - **Why NaN-against-NaN is accepted.** Neither Spark nor Java defines which NaN an operation over two NaNs returns, and the JVM's tiers answer differently. For `x + x2` over two NaNs: - the interpreter returns the right operand's NaN; - C1 and the Vector API's Java fallback return the left operand's; - C2 orders the inputs of a commutative vector add or multiply by internal node index (`opto/vectornode.cpp`), so its choice can change from one compilation to the next. The dense and masked loops are the same bytecode compiled at different moments, so one can return `x`'s NaN while the other returns `x2`'s. The check runs only when `-Dvarka.checkBothBodies=true` is set, which only the option matrix and the new-test and mutation runners do. Nothing changes outside tests. ### Why are the changes needed? An option-matrix run failed on a correct kernel. `VarkaCoverageHarnessSuite`'s `try_add(x, x2)` row reported "dense and masked bodies disagree on output 0 at row 7 of a null-free batch of 10". That row of the fixture holds `x = -NaN` (`fff8000000000000`) and `x2 = NaN` (`7ff8000000000000`), and the two bodies returned different ones. A probe on an AVX-512 laptop reproduces it: - at default flags, the bodies disagree on 199 to 312 of 20,000 calls, in a window around calls 200 to 660, while the two loops sit on different tiers; - with the masked loop kept interpreted, they disagree on 49,598 of 50,000. `x * x2` can flip the same way. `x - x2` and `x / x2` cannot, since they are not commutative. The failure depends on compile timing, so it can hit any matrix run on any host. The cost of the change: this check no longer sees a body that picks the wrong NaN. The served answer is still held to Spark's bits by the suites that compare it with the row engine, and those already excuse exactly the NaN payloads Spark leaves open. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - A new `VarkaEvaluatorComponentsSuite` test of `compareBodies`: - two NaN doubles of different bits agree on a floating output, including the fixture's `-NaN` against `NaN` and a signalling-style NaN; - the same bytes on an 8-byte integral output still fail; - `+0.0` against `-0.0` still fails; - a NaN against a number fails, both ways round; - the same cases for 4-byte floats. - `VarkaKernelEvaluatorSuite` checks that a boolean output's flag is false. - `VarkaEvaluatorComponentsSuite`, `VarkaKernelEvaluatorSuite`, `VarkaFloatingLaneSuite` and `VarkaCoverageHarnessSuite` pass with `-Dvarka.checkBothBodies=true` and the memory sanitizer on: 1811 tests. - Error Prone, scalastyle, lint-java and the plan, quote and pre-commit checks pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…che#1320) ### What changes were proposed in this pull request? The Build's "Protobuf breaking change detection and Python CodeGen check" and "Run Spark UI tests" jobs now run only when their own files change. They ran on every pull request. - **The bug.** The precondition of `.github/workflows/build_and_test.yml` gives each job a file gate: `buf=false` unless a `.proto` or `_pb2` file changes, and `ui=false` unless `ui-test/` or a static UI resource does. Spark's own lines set `buf=true` and `ui=true` unconditionally at the end of the same branch. The gates sat above those lines, so the defaults ran after the gates and undid them. That has been true since the gates were added (apache#89), and both jobs ran on apache#1311, apache#1313 and apache#1316, the last of which changed only plan files. - **The fix.** `buf=true` and `ui=true` are now set just before the buf gate, and the later block keeps only `docs=true` and `java25=true`. The SparkR, Kubernetes and OIDC gates have no later default and are unchanged. - **A lint rule keeps the order.** A new `ci-gates` rule in `dev/varka_lint.py` reports a `x=true` at a gate's own depth, later in the same branch, after that gate's `x=false`. The pre-commit hook and the Build's lint self-test both run it. Against master's workflow it reports lines 203 and 204; against this change it reports nothing. - **Plan.** `sql/varka/plans/m8/VARKA-558.md` and PLAN.md row 558. ### Why are the changes needed? Each Build spent two runners on jobs that could not fail for the change at hand, about two minutes for the protobuf check and one for the UI suite. They run in parallel with the rest, so the cost is slots on the fork's 40 concurrent jobs, not wall time. The rule matters more than the minutes: a gate that silently does nothing looks the same as one that works. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - `dev/varka_lint.py --selftest`: 21 cases. Two are new: a gate undone by a later default is reported, and a default set before its gate is not. - The rule reports master's two lines and nothing on this change. - Ruff 0.14.8 format and check, the YAML parse, the plan lint, the quote check and the pre-commit hook pass. - This change itself edits the workflow, which no module of `modules.py` claims, so its own Build runs Spark's whole matrix and both jobs once more. The next pull request that touches neither protobuf nor UI files shows the fix by skipping both. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…tiers (apache#1332) ### What changes were proposed in this pull request? A new nightly workflow, `varka-tier-split.yml`, runs the sql module's Varka suites four more times. Each time, HotSpot is pinned so that a kernel's two bodies run at different JIT tiers: the dense one, for null-free batches, and the masked one, for batches with nulls or a selection. Varka's both-bodies check, which every suite already runs under `-Dvarka.checkBothBodies`, then compares answers across tiers on every batch. **Why a pinning is needed.** In the test sessions a kernel serves only a few batches, so both bodies normally stay interpreted, and an answer that depends on the tier is never seen. One such answer already reached CI: the NaN payload of a floating add depends on which tier computed it (the interpreter returns the right operand's NaN, C1 the left's, and C2 orders its inputs by node index), and it failed an option-matrix bin about once in many runs before apache#1313 accepted it. **The four configurations** (`sql/varka/ci/tier-split/*.json`, HotSpot compiler directives plus `CompileCommand` options): | name | held back | brought forward | | :--- | :--- | :--- | | `masked-interpreted` | the masked body's methods excluded from compilation and from inlining | the dense body compiled at C2 on its first calls (thresholds scaled by 0.0001, compiles synchronous, C1 kept off it) | | `dense-interpreted` | the mirror | the mirror | | `masked-c1` | the masked body pinned to C1 by a C2 exclusion | the dense body at C2 as above | | `dense-c1` | the mirror | the mirror | The patterns name only Varka's kernel classes and their methods. A new test in `VarkaMethodNamesSuite` checks every pattern against the names the kernel builders produce. **Proving the split happened.** The test JVMs run with `-XX:+IgnoreUnrecognizedVMOptions`, so a flag that took no effect would be silent, and a night could go green without splitting anything. `dev/varka_tier_split.py check` reads each JVM's compile records. It fails a configuration in any of these cases: - the brought-forward side reached its tier fewer than 10 times; - the held-back side compiled at all (under the `-interpreted` configurations a print-only directive makes it visible); - no batch was compared; - a JVM never finished. Compiles that HotSpot reports as `COMPILE SKIPPED` are not counted. `VarkaKernelRunner` counts the batches its both-bodies check compared and prints the count when the JVM exits, under the test flag only. The check has its own `--self-test` over fixture logs, which runs first in every configuration job. **The workflow.** - **Jobs:** a build job, then eight configuration jobs (two shares of each configuration, four jobs at a time), a report job and `report-scheduled-failure`. - **Shares** are split by measured weights (`sql/varka/ci/tier-split/suite-times.tsv`: laptop times under the slowest configuration × 2.2). The shares are predicted at about 25 and 28 minutes, under the 90-minute job cap; a count-based split could put two heavy suites in one 61-minute job. - **Timing:** it runs at 03:00 UTC, guarded to vecbricks/varka as the weekly matrix is, and can be dispatched on either repository with a branch and a subset of configurations. - **Watchdog:** the per-test watchdog rises to 30 minutes for these runs only. - **Skipped suites:** two suites whose subject is the JIT itself, with the reason in the script. - **One cancelled test:** an allocation test that needs the dense body at C2 cancels itself when the dense side is held back. **Also:** `varka-fuzz.yml`'s schedule is guarded to vecbricks/varka, as the weekly matrix's already is, so the fork's nightly fuzz runs only by dispatch. On the fork it took slots and reported its failures nowhere. ### Why are the changes needed? An answer that depends on which JIT tier compiled a kernel is a wrong answer some of the time, and today it surfaces only when a run happens to split the bodies across tiers, perhaps once in many runs. The NaN-payload failure fixed in apache#1313 was the first. This job forces the split every night, so the next tier-dependent answer fails at once and names its suite and configuration. ### Does this PR introduce _any_ user-facing change? No. It adds a CI workflow, a test-only counter and a dev script. ### How was this patch tested? - **The known failure, reproduced.** On a scratch branch with apache#1313's NaN acceptance removed, `VarkaCoverageHarnessSuite` failed `try_add(x, x2)` on 3 of 3 runs under `masked-interpreted` and 3 of 3 under `masked-c1`, with "dense and masked bodies disagree on output 0 at row 7 of a null-free batch". With the acceptance in place, all four configurations pass the suite. The compile records show the split in each case. For example, under `masked-c1` the masked methods compiled at tiers 1 and 3 only, and the dense ones at tier 4 only. The trial data is in `sql/varka/plans/m8/results/VARKA-557-trial.txt`. - **The whole sql suite set** ran under the slowest configuration, `dense-interpreted`. It compared 89,008 null-free and 15,136 nullable batches, with the masked body at C2 only and the dense body never compiled. It took 4.2 times the defaults. - **The check itself:** a control run with the exclusion removed made `check` fail on 31 held-side compiles. Its self-test covers a skipped tier-4 task, a held-side compile, a JVM with no exit status, and a directive file that doesn't name its held side. - **Independent reviews:** a high review found two ways a night could go green without a split. The held side's compiles were invisible under the `-interpreted` configurations, and `COMPILE SKIPPED` lines counted as compiles. Both are fixed, and a medium review checked the fixes. Every changed file is Varka-scoped, so this pull request's Build does not run Spark's whole module matrix. - `actionlint`, Error Prone, scalastyle, lint-java, ruff and the plan, quote and lint checks pass. The change counts 995 hand-written lines. After this merges, the planned last step runs the workflow from master twice. The first run, on the scratch branch with apache#1313's acceptance removed, must fail in `masked-interpreted` and `masked-c1`. The second, on master, must pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
…pache#1366) ### What changes were proposed in this pull request? Brings ten rows of milestone 8's plan up to date with the pull requests that merged their work. Row 572 asked for it, and this is its first part. - **Rows 560, 562 and 568 are `Done`.** 560 and 562 said "done when it merges", and apache#1326 and apache#1335 merged. Row 568's three done-when clauses hold on master since apache#1363: `nanByNess` is gone, the lint rule flags each shape in its self-test and finds no expression in the tree, and the opt-in sweeps passed 46 of 46. - **Rows 554, 555, 557, 558, 559, 563 and 546 stay `Started`,** each now naming the pull request that merged it (apache#1312, apache#1313, apache#1332, apache#1320, apache#1329, apache#1340 with apache#1344, and apache#1293) and its date. I did not mark them `Done`: their done-when clauses name checks, such as a Build failing a change over the cap or a matrix no longer failing a test, that I have not confirmed from a run. Row 563's text no longer lists its pull request as left. - **Row 572 is `Started`** and lists what is left: rows 497, 365 and 503, and the rows the triage named whose text is behind merged work (157, 348, 349, 538, 332, 333, 343, 341, 331, 340, 342, 344, 377 and 330). The PR numbers and merge dates were read from the pull requests. ### Why are the changes needed? A row is the only record of why a change exists. A row that still says "Started" or "left: the pull request" after the pull request merged misleads a reader and any count of the milestone's finished rows. ### Does this PR introduce _any_ user-facing change? No. It changes the plan only. ### How was this patch tested? - `dev/varka_plan_lint.py --check --offline`: 0 findings. - `dev/varka_quote_check.py`: 0 orphans. - The pre-commit rules pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Sonnet 5.5)
copied from original JIRA (https://issues.apache.org/jira/browse/SPARK-2294):
If an executor E is free, a task may be speculatively assigned to E when there are other tasks in the job that have not been launched (at all) yet. Similarly, a task without any locality preferences may be assigned to E when there was another NODE_LOCAL task that could have been scheduled.
This happens because TaskSchedulerImpl calls TaskSetManager.resourceOffer (which in turn calls TaskSetManager.findTask) with increasing locality levels, beginning with PROCESS_LOCAL, followed by NODE_LOCAL, and so on until the highest currently allowed level. Now, supposed NODE_LOCAL is the highest currently allowed locality level. The first time findTask is called, it will be called with max level PROCESS_LOCAL; if it cannot find any PROCESS_LOCAL tasks, it will try to schedule tasks with no locality preferences or speculative tasks. As a result, speculative tasks or tasks with no preferences may be scheduled instead of NODE_LOCAL tasks.
I added an additional parameter in resourceOffer and findTask, maxLocality, indicating when we should consider the tasks without locality preference