Repository navigation
Working PR from 2026-11-28: fixes from the default pipeline and agent runs (base for the next experiments) - #123
nicolasribeiro2028 wants to merge 8 commits into
Conversation
The judge route and the tactics_bench tuner columns hand Setup the judge's resolved preset. resolve_preset turns every '<rung>+fuzz' token into the bare 'fuzzed' and moves the rung into the fuzz.anchor override, so size_rung saw 'fuzzed' and started every session at XL: on an L+fuzz judge the session built XL inputs while the judge graded around L (OOM on a 16 GB machine, every kernel). The spawned session process cannot read the judge's override, so session_preset gives 'fuzzed' its anchor back in the caller's process, as the bench reads the rung of a fuzzed run (service.profile_size). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scratch a ScatterConflictCheck writes is never read before it is written and may carry stale values (DaCe's contract), so no oracle can predict it. The kernel check compared it with the oracle's zeros and judged the kernel wrong while the whole program was correct: ilu0, lulesh, qe_vexx_k and sparse_cholesky on the CPU target (T48-42). checked_probe now leaves out the outputs the kernel does not define (unspecified_outputs), resolved through nested SDFGs to the boundary's names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A kernel left inside a sequential loop takes the loop's iterator as a plain argument. Cut from the loop, DaCe can no longer prove an exponent such as K - _loop_it_0 - 1 nonnegative, so RelaxIntegerPowers keeps R**e as a libm pow, and every index and loop bound truncates it to an integer. When the device's pow(2, 11) rounds down, that drops elements: stockham_fft on the GPU left Tmp4[2048] and Tmp4[4095] unwritten at K = 12, and the whole program was wrong from K = 12 on (T48-49, Daint jobs 5480009 and 5484421). inherit_loop_ranges adds low <= it and it <= high for every counted loop around the kernel whose iterator it receives under its own name, to the extracted nest and to the ExternalCall's standalone SDFG, beside inherit_symbol_predicates. DaCe then emits ipow: stockham's doall27 and lib_linalg0 render with no pow in any index or bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
dace-extended 1.0.6 shifts range(1, K) to start at 0, so the iterator's range is 0 <= it <= K - 2 there and 1 <= it <= K - 1 on 1.0.5. The test now compares the kernel's assumed relations with the enclosing loop's own bounds, so it holds on both. The pow-to-ipow test is unchanged and still fails without the fix on both versions (1.0.6 renders int64_t(std::pow(R, K - _loop_it_0 - 2))). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dace-extended 1.0.6 (released 2026-11-29) shifts a loop such as range(1, T) to start at 0. With it, 7 unit tests and 1 integration test fail on this branch's parent 8d5a24e as well (split_doall, tree_view, comm_subsets, durbin costing, the middle loop value, quickstart's jacobi loops), and all of them pass on 1.0.5. There is no lock file, so CI took 1.0.6. The pin keeps this PR on the version its runs use (1.0.5 with spcl/dace#2811 applied) until Tactics is adapted to 1.0.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hold numpy_outputs passed every parameter of the bench's NumPy function from the data. cegterg_numpy takes its configuration flags as keywords with defaults (gamma_only=False, noncolin=False, ...), which the bench data does not hold, so the call raised KeyError: 'gamma_only' and qe_cegterg went ungraded wherever the bench's numba and C references cannot run. reference_parameters passes what the data holds and every parameter without a default, so a missing required input still fails by name; a defaulted one keeps its default, as the bench's own numba_call_order does. Tests: tests/test_bench_data.py gains a tagged reproducer on qe_cegterg's S data (ReferenceUnavailable: KeyError 'gamma_only' before) and a unit test of the required/defaulted rule. qe_cegterg (CPU, S) is now correct against its NumPy function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 5 built a session's kernels one after another: render the CPF unit, run the compiler, link. A program with many kernels (qe_cegterg: 29, about 420 s of builds on the GPU target at S on Daint) spent most of a checking unit waiting on one compiler at a time. Session.default_builds renders the kernels and looks them up in first_builds one after another (Python), runs the compilers of the kernels not built before in a thread pool of build_workers() (the compiler runs outside the interpreter, as in a sweep), then links each in the given order and keeps it as a first build. The result is the serial one's: the same units, variants and archives, bound in the same order; a failed build raises once the kernels before it are linked; a stop cancels the compilers not started. Only codegen "first" without a pass pipeline takes this path; other codegens build one after another as before. kernel_evidence (so performance) and finalize use it. first_build's key and keep step become first_build_key and remember_first_build, shared by both paths. Tests: tests/test_parallel_builds.py (same units and variants as the serial builds, the compilers overlap, a failed build in the middle, a second pass reuses what the serial pass reuses). qe_cegterg CPU at S in a Linux container with 8 cores: stage 5 21.6 s serial, 13.9 s parallel; the units match except a dependence comment whose solver example differs between two serial builds too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| Serial | Parallel | |
|---|---|---|
| qe_cegterg, CPU, S, Mac container (8 cores) | 21.6 s | 13.9 s |
| qe_cegterg, GPU, S, CSCS Daint GH200, same job (5496776) | 476.6 s | 113.3 s |
On the CPU target most of what remains is rendering (12.4 s of the 21.6 s), which stays serial. On the GPU target the compilers dominated, hence the 4.2x. GPU L and XL built in 113.0 s and 107.3 s. In that job every unit was correct against the bench's reference or its NumPy function, with the same 26 of 29 kernels on the GPU as the serial build. These are stage times from a checking job with 8 units on the node, not a benchmark.
The generated units match the serial build's except one comment in extcall_for0: a dependence solver's example values, which also differ between two serial builds.
Not in this commit
- The sweep path (
codegen="sweep") is unchanged. It already compiles each kernel's variants in parallel, then times them one at a time, kernel after kernel. Overlapping all kernels' compiles there is possible but a larger change, and only worth it if compiling, not timing, dominates a sweep. Not measured. - Stage 7's per-kernel checks still run one after another. On the GPU target each check runs in a fresh process; that is about 450 s of a qe_cegterg GPU unit and now its largest part.
- The first-build key includes
abi_order, which linking rewrites. One kernel of qe_cegterg therefore recompiles on a second pass. This happens on the serial path too and is not changed here. - Peak memory of many
nvccat once was not measured beyond that job (at most 4.4 GB per unit).
Task T49-06.
🤖 Generated with Claude Code
Tactics checked the whole program with a plain per-element allclose(rtol, atol), while HPCAgent-Bench's judge (grade_outputs) also raises atol to the accumulation floor eps_acc * sqrt(l) * ||expected||_inf and applies its strict-small checks, graded extent and mismatch fraction. lulesh's default was graded WRONG by Tactics and right by the bench: dxx/dyy/dzz failed allclose on 3-4 of 10^6 cancelled elements, error <= 5.2e-10 on values up to 1.3e5 (L and XL, with one thread and without FMA alike). Reference gains an optional ProgramRule (spec, accumulation lengths, eps_acc, bench names), built in bench_data from the bench's contracted_extents and grade_eps. With it, grade_program calls the bench's grade_outputs once per output on the spec restricted to that output, so every failing output is named, and ProgramReport.mismatch_detail carries the bench's error. A Reference without a rule keeps allclose. The move check at the check rung uses the same reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The working PR for Tactics from 2026-11-28 on: every Tactics fix found by the default pipeline (Daint checking jobs on the A/A shortlist) and by the local agent runs goes on this branch, and the experiments of the next days run on it. The DaCe fixes found the same way are in draft spcl/dace#2811; the runs use
dace-extended1.0.5 with #2811 applied on top until a release carries it.Fixes
183699aL+fuzzjudge and ran out of memory8d5a24ea98fa29K = 12on: indices truncated a floatingpowf5da9d5KeyError: 'gamma_only'e303f87Session.default_builds): write-upEach fix has a tagged reproducer test (
# Reproducer:), and each section below gives its symptom, cause, fix and tests. New fixes and changes are added to this table as they land.e303f87is a speed-up, not a fix; its reproducer-style tests are intests/test_parallel_builds.py.Pin.
7a40c72pinsdace-extended>=1.0.5,<1.0.6. 1.0.6 (released 2026-11-29) shifts a loop such asrange(1, T)to start at 0; with it, 7 unit tests and 1 integration test fail on this branch's parent8d5a24etoo, and they all pass on 1.0.5. The pin keeps this PR on the version its runs use (1.0.5 with spcl/dace#2811) until Tactics is adapted to 1.0.6.55a5d04makes the loop-range test of fix 3 read the loop's own bounds, so it holds on both versions.1. A session of a fuzzed judge runs at the fuzz anchor, not always XL
Symptom
On a judge whose preset is fuzzed around a rung other than XL (
HPCAGENT_BENCH_SERVICE_PRESET=L+fuzz), every Tactics session ran on XL inputs. This affected both the agent's judge route and thetactics_benchtuner columns. The judge itself grades around L, so the session measured at another size than the grade, and on a small machine it ran out of memory: on a 16 GB Mac under Docker, every Tactics column OOMed within about 15 s on every kernel tried,jacobi_1dincluded. TheXL+fuzzdefault hides it, because there both sides are XL.Cause
Both callers hand
Setupthe judge's resolved preset:plugin/tactics/routes/tactics.py:297:judge.cfg.preset.texttactics_bench/__init__.py:87:resolve_preset(service.preset).textFor any
<rung>+fuzztoken that text isfuzzed, becausehpcagent_bench.spec.resolve_presetreturns the basePreset.FUZZEDand moves the rung into the config overridefuzz.anchor.tactics.server.size_rung("fuzzed")then parses the bare token, whose anchor is XL. The session process is started withspawn, so it cannot read the judge's in-memory override itself.Fix
tactics.server.session_preset(preset), called in the caller's process, gives a barefuzzedits anchor back fromfuzz.anchor(fuzzed→L+fuzz) and keeps every other token. This is the reading the bench itself uses for the rung of a fuzzed run (hpcagent_bench/harness/service.py,profile_size). Both callers pass their token through it, andsize_rungis unchanged. The bench import is deferred, assize_rung's is.Tests
tests/test_bench_data.py::test_a_session_of_a_fuzzed_judge_keeps_the_anchor_rung. It checks thatresolve_preset("L+fuzz")thensession_presetgivesL+fuzzand rung L, thatXL+fuzzstill gives XL, and that other tokens are kept.size_rung(resolve_preset("L+fuzz").text)isXL; after it,size_rung(session_preset(...))isL.tests/test_bench_data.py: 7 passed (Linux container, dace-extended 1.0.5, hpcagent-bench 1.0.5).tests/test_bench_plugin.py::test_the_reference_column_starts_on_the_preset_the_token_resolves_toasserted the bug (["fuzzed"]forXL+fuzz). It now asserts["XL+fuzz", "L+fuzz"]with rungs XL and L. The rest of the file: the same 11 tests fail onorigin/main4c639aband on this branch in a plain Linux container (grading tests that need the bench's launch environment), and 68 pass on both.mypy(65 files) andmypy tests(149 files): no issues. pre-commit: ruff check, ruff format, gitleaks and headers pass.Ljudge (Mac, Docker, judge imagejudge-cpu-aarch64),dace_cpu_canon_tactics_defaultonquatrex_rgfgrades correct, hidden 5/5 (it OOMed before the fix withL+fuzz, as on every kernel). Mac times, not citable.Not in this fix
On the same Mac judge, grading children still fail for reasons outside Tactics. The numba/C baselines write temp files into the read-only checkout, and a grading child maps both libgomp and libomp. Both come from launching the judge by hand instead of through the bench's cluster scripts, and are tracked separately.
2. A kernel's check skips a ScatterConflictCheck's tag scratch
Symptom. On the CPU target, the conflict-check ("sort") kernels of ilu0, lulesh, qe_vexx_k and sparse_cholesky were judged wrong by their own check while the whole program was correct.
Cause. These kernels are
ScatterConflictChecknodes. Their flag matches the oracle. The only differing output is the check's tag scratch (_owner_out), which DaCe documents as never read before it is written and allowed to carry stale values, so no oracle can predict it. On ilu0'sextcall_lib_sort0, all 82654 elements of the scratchTmp0differ (the oracle's zeros against stale tags), while the flagtmp5is equal.Fix.
checked_probe(tactics/stages/kernel.py) leaves outunspecified_outputs(boundary): the outputs written through aScatterConflictCheck's scratch connector, resolved through nested SDFGs to the boundary's names (outermost_name).Tests.
tests/test_kernel_stage.py::test_a_scatter_checks_tag_scratch_is_not_graded, at the top level and nested.tests/test_kernel_stage.pyin a Linux container without a GPU: the same 7 GPU-only tests fail with and without the change; 28 pass with it.mypyandmypy tests: no issues. ruff and the header check pass.3. A kernel cut from a loop keeps the range of the loop's iterator
Symptom. npbench
stockham_ffton the GPU target: every kernel passes its own check, but the whole program'syis wrong on every element fromK = 12on (exact up toK = 11). The CPU target is right at everyK.Cause. A kernel left inside a sequential loop takes the loop's iterator as a plain argument. Cut from the loop, DaCe's
RelaxIntegerPowerscan no longer prove an exponent such asK - _loop_it_0 - 1nonnegative, soR**estays a libmpowthat every index and loop bound truncates toint64_t. On the devicepow(2, 11)rounds just below 2048, sodoall27leavesTmp4[2048]andTmp4[4095]unwritten andlib_linalg0misplaces one element.Fix.
inherit_loop_ranges(tactics/ir/extract.py) addslow <= it <= highfor every counted loop around the kernel whose iterator the kernel receives, to the extracted nest and to theExternalCall's standalone SDFG; DaCe then emitsipow.Tests. Two tagged tests in
tests/test_loop_iterator_symbols.py, failing without the fix and passing with it; no other test changes outcome. The full write-up (the replay that found the elements, the counts ofpowremoved, what was not checked): comment ona98fa29.4. A NumPy reference keeps the defaults of parameters the data does not hold
Symptom.
qe_cegtergwas never graded where the bench's numba and C references cannot run (the Linux container on a Mac:SealError). The fallback to the kernel's NumPy function failed too:ReferenceUnavailable: NumPy function of qe_cegterg: KeyError: 'gamma_only', so the outputs went unchecked.Cause.
numpy_outputs(tactics/server.py) passed every parameter of the NumPy function from the bench data.cegterg_numpyalso takes its configuration flags as keywords with defaults (gamma_only=False,noncolin=False,lspinorb=False, ...), and the bench data does not hold them.Fix.
reference_parameterspasses the parameters the data holds and every parameter without a default. A missing required input still fails, by name, and a defaulted one keeps its default. This is the same rule the bench uses for its own numba call (hpcagent_bench.harness.grading.numba_call_order).Tests.
tests/test_bench_data.py::test_a_numpy_reference_keeps_the_defaults_of_parameters_the_data_does_not_hold, on qe_cegterg's S data. The code of7a40c72raises theKeyErroron the same data.::test_a_required_parameter_the_data_lacks_still_fails_by_name.tests/test_bench_data.py(9 passed),mypyandmypy tests, ruff and the header check pass, in a Linux arm64 container.774047f913(which fixes the heap overrun that aborted its program run): every stage runs and the whole program is correct against its NumPy function. The GPU target and the bench's C reference were not checked yet.🤖 Generated with Claude Code