Repository navigation
Conversation
A run config without an evaluation_tools section now runs the page-fault
guard, PyTorch CSAN, TileLens, rocJITsu Waitcheck, the rocJITsu race
detector and Triton FpSan on every schema-v3 task on gfx950, for any
target language and with no task configuration. GPU ASan is supported
for HIP, Triton and Gluon but stays opt-in: it needs a bare-metal host.
- The v3 runner gains `evaluate {baseline|candidate} sanitize LANE`.
Each lane checks the environment its sidecar set and runs the role on
the task's correctness cases. A capture lane records the dispatched
kernels for Waitcheck and rocJITsu replay capsules.
- Every tool gets a framework-owned v3 adapter, so task.yaml needs no
adapter fields.
- The new gated policy gives each tool a gate or signal role. A gate
blocks performance only on a definite finding that the baseline,
rechecked with the same tool, does not share. Unverified results are
recorded but never count as clean. A blocked tool gate scores zero.
- The runner resolves the default set, builds missing default images
and gives the Waitcheck sidecar the worker's GPU.
- Before building an evaluation-tool image, pull each pinned BASE_IMAGE and BUILDER_IMAGE through the Docker daemon, which BuildKit then uses locally. On hosts whose registry TLS only the daemon trusts, BuildKit otherwise fails to fetch the rocJITsu builder image. - The CSAN startup control imports torch._dynamo, whose cache path calls getpass. Give the new probes and lanes USER, LOGNAME and an inductor cache directory, because a sidecar UID need not exist in passwd.
A first hardware campaign over 24 schema-v3 baselines and seeded out-of-bounds variants showed five ways the v3 lanes misreported: - rocJITsu reported LDS races on two clean baselines from replays that did not reproduce the GPU's output. A race from a replay that was not attested (dispatch, capsule and golden output) is now inconclusive. - Waitcheck required a code object to hold exactly one kernel, so every HIP extension with two kernels was partial. The entry point now records the inventory size and the parser expects it. - FpSan and the Triton GPU ASan check looked up `<symbol>.hsaco`, which does not exist for `@triton.jit(repr=...)` kernels: Triton names the cache files after the Python function. The code object is now the metadata file's sibling. - FlyDSL capture recorded nothing: a launch reaches the compiled artifact through executor methods, not `__call__`. The observer now watches FlyDSL compiler frames, and MLIR string literals are decoded with all their escapes. - TileLens 3.1.1 failed on all Gluon kernels tried, so Gluon is now reported unsupported instead of being run.
The safe step read a tensor on a side stream without waiting for the default-stream write that produced it, which is a real race, so CSAN correctly rejected it and the sidecar never became ready. The side stream now waits for the default stream before the read, as the default stream already waited for the side stream after it. On MI355X the safe step now exits 0 with no report and the race step reports the race.
The campaign over all 385 schema-v3 entries blocked one clean baseline: the page-fault guard reported a FlyDSL split-K GEMM as allocator sensitive because one element of one case came out 14% over its baseline-relative bound. That is ordinary run-to-run variation, and the same check passed on the baseline recheck. - The guard now reports an output change only when it is gross: a non-finite value, an error over 10 times the bound, or more than 1% of elements outside it. Reading memory the role does not own produces values like that. A smaller excess is recorded as unverified. - The baseline recheck now excuses a candidate finding only when the baseline reports the same kinds. A baseline finding of another kind no longer hides, for example, a candidate fault. - The docs say that the first run builds the default images over the network and stops if a build fails.
TileLens checks Triton kernels symbolically and over-approximates loop-carried pointer updates and loaded indices. On the MI355X campaign it reported out-of-bounds accesses on clean production baselines, for example the cyclic K loop of ff_a16w16_fused_gated, which stays in bounds. As a gate it would block a correct candidate that uses the same pattern on a task whose baseline does not. A TileLens violation now triggers the new `bounds` lane in a fresh process: the same smallest case runs concretely in Triton's CPU interpreter (TRITON_INTERPRET=1), and every active load, store and atomic address is checked against the argument buffers of its launch. A stray access is recorded and masked off instead of performed. Only a reproduced access is a finding; otherwise the result is unverified (tilelens_unconfirmed). The TileLens startup control also runs the concrete check on the safe and off-by-one copies, so a broken check fails the control instead of silently disabling the gate. The image copies the lane module for that.
The full MI355X campaign blocked one clean baseline, Triton layer_norm bf16_d256: its per-row mean for a one-row case missed the bound by 11% once with the allocators off. One element is a 100% violation fraction, so the gross-mismatch rule took it for a finding, and the baseline recheck happened to pass. The fraction rule now also needs at least 8 elements outside the bound. Non-finite values and errors over 10 times the bound stay gross at any size. The recorded lane report of that run is now judged unverified.
jhinpan
left a comment
There was a problem hiding this comment.
Request changes. I reviewed 55e4e547 and tested the default path on 8x MI355X (gfx950). For single-GPU tasks, the results agree with the description. Three problems affect the gate: the multi-GPU tasks of #152, the mixed failure kind, and the baseline recheck.
What passed on MI355X
I used a run config without evaluation_tools and the claude_code agent. A stand-in CLI made one fixed edit. The host did not have the two rocJITsu images, and the runner built them on first use (8 min).
| Task | Candidate | Result |
|---|---|---|
Triton silu_and_mul/bf16_d4096 |
baseline copy | Allowed. All 6 tools are clean. |
HIP sigmoid/f32 |
baseline copy | Allowed. page_fault_guard, csan and Waitcheck are clean. |
FlyDSL softmax/f32_n4096 |
baseline copy | Allowed. page_fault_guard, csan and Waitcheck are clean. |
Gluon gemm_a8w8/n4096_k4096 |
baseline copy | Allowed. TileLens does not support Gluon, and rocJITsu is inconclusive. The other 4 tools are clean. |
Triton silu_and_mul/bf16_d4096 |
reads 2 bytes past the input | Correctness fails with a GPU memory fault. The tools do not run. |
Triton silu_and_mul/bf16_d4096 |
unused load one row past the input | tilelens:finding:found blocks it. The score is 0. |
Blocking
1. The default sanitizers do not run on the multi-GPU tasks of #152.
I merged this PR into #152 and kept both changes in the two conflicts. Then I ran the baseline copy of other/deepseek_v41_flash_attention_front/tp4.
page_fault_guardandcsanfailed all 9 cases withAttributeError: 'NoneType' object has no attribute 'items'. The Waitcheck capture failed with the same error.- Cause: a lane calls the operator in one process, without a rank (sanitize.py#L168-L173, sanitize.py#L123-L135). For a multi-GPU task,
make_inputsthen returnskernel=None(values.py#L168-L169 in #152). - The plugins record
inconclusive, and the gate allows the candidate. Thus a multi-GPU task gets no sanitizer check, butCANDIDATE.mdtells the agent that the sanitizers run. - The CPU tests pass on the merged tree. No test covers this case.
- Fix: run the lanes through the rank launcher of #152. Or return
unsupportedfor adistributedcontract in_v3_engine(v3_lanes.py#L38-L62). Add a test. - If #152 merges first, this PR must make the change. If this PR merges first, #152 must make it.
2. The mixed failure kind skips the gross-mismatch rule (v3_lanes.py#L162-L171).
I called PageFaultGuardPlugin.parse with three lane reports:
| Lane report | Result |
|---|---|
| One marginal mismatch | inconclusive |
| One execution error without a fault | inconclusive |
Both together (mixed) |
found: the gate blocks the candidate, and the score is 0 |
Fix: judge mixed by its parts.
3. The baseline recheck compares only the kind of finding (manager.py#L534-L543).
- If the baseline has a finding of one kind, the gate excuses each candidate finding of that kind. It also excuses a new race or OOB at a different location.
- The description lists baselines with such findings, for example
topk_topp_maskandprefix_prefill_attention_alibi. - Fix: compare the kind, the kernel and the location. Or list the excused findings in the report.
Decisions for maintainers
4. An unused load sets the score to 0. The blocked load in the last row of the first table is not in the GPU code. For gfx950, that variant has the same number of loads as the baseline: 2 in TTGIR and 8 in AMDGCN. A variant that uses the load has 3 and 12. TileLens and the bounds lane run each load in the CPU interpreter. If a source-level OOB must block, write this in CANDIDATE.md. If not, ignore findings on a load whose value the kernel does not use.
5. The default gate uses a boundary that the repository calls diagnostic. The example config says that the sidecar stage is "diagnostic rather than a tamper-resistant reward boundary" (evaluation_tools_advisory_mi355x.yaml#L17-L18). This PR makes it a default gate that sets the score to 0 (score.py#L144-L147). src/score.py needs approval from @sinarafati-amd (CODEOWNERS#L16).
Other items
6. The sidecars can run old code. ensure_eval_tool_image checks only that the fixed tag exists (docker_benchmark.sh#L1196-L1206). Each image contains a copy of src/eval_tools (Dockerfile#L9). The sidecar worker and the Waitcheck and rocJITsu entrypoint run from that copy (v3_tools.py#L43). After a source change, the host keeps the old copy, and no message tells the user. Fix: put a hash of the copied files in the tag, or compare an image label at startup.
7. The defaults also start for QA runs. runner_selection does not look at the agent (defaults.py#L57-L60). Thus a QA-auditor run also starts six sidecars. On a new host, it first builds the images.
8. Style (SGLang rules).
- docker_benchmark.sh#L1031:
if true; thenstays after the Waitcheck change. - manager.py#L475:
getattr(plugin, "baseline_check", False). Declare the attribute on each plugin. - rocjitsu.py#L112 and waitcheck.py#L50: an import in the middle of the module.
- worker.py#L923-L926:
_FAULT_REdoes not havehipErrorIllegalAddress, but aka_v3.py#L33-L37 has it. Keep one copy. - evaluator.py#L165: under the
gatedpolicy, the log says "required policy rejected performance". - Scope: please split this PR into three steps:
- The new tools and the v3 adapters, opt-in.
- The
gatedpolicy and the score change. - The default set.
Not tested: gfx942, GPU ASan on bare metal, and the 379-task campaign.
How I tested
- Node:
smci355-ccs-aus-n07-05, 8x MI355X. Image:lmsysorg/sglang@sha256:e2084966…. - I ran one job at a time. Before each job, each GPU was idle in 10–20 samples. Each GPU stayed locked during the job.
- I built the four small images by hand (2 min). The runner built
rocjitsuandrocjitsu-waitcheckon first use. - The stand-in CLI answers
--versionandauth status, makes the edit, and prints oneresultevent. HOME pointed to a new directory that holds only the stand-in, so the run used no credentials. mixed: a call ofPageFaultGuardPlugin.parsewith the report helpers oftests/eval_tools/test_v3_sanitizers.py.- Load count:
triton.compile(ASTSource(...), target=GPUTarget("hip", "gfx950", 64))for each variant. I countedtt.loadin TTGIR andglobal_load*in AMDGCN.
- Every v3 tool reports a multi-GPU task (a contract world_size above 1) as unsupported: a lane calls the operator once in one process without a rank. CANDIDATE.md now says the sanitizers run on single-GPU tasks. - The page-fault guard judges a mixed report by its failed cases. An execution error no longer makes a marginal mismatch gross. - A baseline check lists the baseline's findings and, when it excuses the candidate, the excused findings; the evaluator logs the excused kinds. - A tool image is labelled with a digest of its Dockerfile and the checkout files it copies. The runner rebuilds a default image whose label differs and warns about an overridden one. - A qa_auditor run starts no default tools. - Waitcheck, rocJITsu and GPU ASan report a language no tool is qualified on (asm) as unsupported instead of not applicable, like the other lanes. - Style: plugins declare baseline_check (now part of ToolPlugin); the GPU ASan constants move to adapters/hip_source.py, which removes the import cycle that forced mid-module imports; the sidecar worker uses the shared fault pattern and allocator settings; the runner drops an always-true conditional; the gated log names its policy and blocking findings.
- A baseline recheck excuses a candidate finding only when the baseline reports it in the same kernel at the same location. Findings with neither (a page fault, an allocator-sensitive output, a CSAN race) still match by kind. - The bounds lane records TileLens locations relative to the role's directory, so a candidate that copies the baseline reports the baseline's location; before, a baseline rerun recorded none. - asm candidates get the page-fault guard, CSAN and Waitcheck: capture writes every code object aka_asm handed to HIP. rocJITsu (no capsule capture for asm launches) and GPU ASan (no instrumentation) report asm unsupported. - CANDIDATE.md states that an out-of-bounds address in the Triton source blocks, even on a load the compiler removes. - The docs and the advisory example config state that the gated default is a scoring gate: a finding can withhold a score but never raise one.
|
@jhinpan thanks for the careful review and the MI355X runs. The fixes are in Blocking1. Multi-GPU tasks. Every v3 tool now reports a task whose contract has a
2. 3. Baseline recheck. A candidate finding is now excused only when the baseline reports it in the same kernel at the same location.
Decisions for maintainers4. Unused loads. We keep blocking. An out-of-bounds address in the source is undefined behavior, and a different compiler version or target can keep the load. 5. Default gate. We keep Other items
Also new since Validation
|
There was a problem hiding this comment.
@irvineoy Updated: I removed the requests that had no proven cause. At 52b905ca my earlier requests are fixed. I reverted five of the fixes one at a time, and the matching new test failed each time (CPU, test_v3_sanitizers.py and test_score.py). Two problems remain. Both come from the default selection. I traced them on CPU. I did not run Docker or a GPU.
- Serving runs stop at start.
example_configs/e2e_qwen3_codex_mi355x.yaml,e2e_qwen3_next_80b_codex_mi355x.yamlande2e_qwen3_smoke_mi355x.yamlhave noevaluation_toolssection.python3 src/eval_tools/defaults.py select <config> gfx950returns the six default tools for them.start_eval_tool_sidecarsthen callsverify_eval_tool_scoring_image, which stops the run when the image is not the pinned one. These configs use the serving lock images (sha256:b435b508…andsha256:7a3087bc…), not the pinnedsha256:e2084966…. Onmainthey select no tool. Fix: select no default tool for a run that has no schema-v3 kernel task, and add a runner test for a serving config. quality_looprejects every candidate that is not Triton.agents/quality_loop/orchestrator.py(lines 153, 436, 759) needstool_policy_satisfied. With the defaults undergated, a clean HIP, FlyDSL or asm candidate getsrocjitsu:capability:unsupported, and a clean Gluon candidate getstilelens:capability:unsupported. The flag is then false. Fix: readpass_tool_gatethere, or keep the defaults off forquality-loop.
The branch also conflicts with main in docs/reference/release-notes.md (from #150).
Summary
Schema-v3 kernel tasks now run sanitizers by default, for every target
language, with no task configuration. A run config without an
evaluation_toolssection runs the set insrc/eval_tools/defaults.pyonMI355X (
gfx950) under a newgatedpolicy.page_fault_guard(new)csan(new, PyTorch CUDA Sanitizer)tilelens(new, symbolic OOB in the CPU interpreter, confirmed by a concrete rerun)rocjitsu_waitcheckrocjitsu(race detector)triton_fpsangpu_asanMulti-GPU tasks (#152) are recorded as
unsupportedby every tool; running the lanes through #152's rank launcher is a follow-up.The change has three layers, and the sections below follow them, so it can be reviewed in that order:
evaluation_toolssection.gatedpolicy and the score change. How a tool result decides whether performance is scored.evaluation_toolssection starts.1. Tools and v3 adapters
v3 runner lanes.
src/tools/arena_eval/sanitize.pyaddspython3 -m _aka_eval.evaluate {baseline|candidate} sanitize LANEwith lanespage_fault_guard,csan,tilelens,bounds,fpsan,gpu_asanandcapture. Each lane:Page-fault guard. It reruns correctness with PyTorch's caching allocator and ROCr's fragment allocator off, so a stray access reaches an unmapped page and faults.
mixed) is judged by the kinds of its failed cases: an execution error does not turn a marginal mismatch into a finding.TileLens confirmation. TileLens 3.1.1 is symbolic. It over-approximates loop-carried pointers and loaded indices, so on its own it flagged 13 clean production baselines.
boundslane reproduces it. That lane reruns the same smallest case in Triton's interpreter and checks every active load, store and atomic address against the launch's argument buffers.CANDIDATE.mdsays so.HIP builds. The loader gains an allowlisted sanitizer flag and arch override (
AKA_HIP_SANITIZER_CFLAGS,AKA_HIP_OFFLOAD_ARCH); both enter the build hash.Framework adapters.
src/eval_tools/plugins/aka_v3.py,v3_lanes.pyandv3_tools.pygive every tool a v3 path, so notask.yamlfield is needed.__asansymbols), not from compiler metadata.unsupported(unverified), nevernot_applicable.Capture. Waitcheck and rocJITsu run the image-owned
adapters/aka_v3_entrypoint.py. It captures the role's dispatched kernels on the GPU:aka_asmhanded to HIP, vendored or assembled.It then runs Waitcheck on every captured kernel and replays every Triton/Gluon launch as a rocJITsu capsule (
adapters/aka_v3_capsules.py). A race from a replay that does not reproduce the GPU's output is unverified.Images. New
page-fault-guard,csanandtilelensimages. TileLens 3.1.1 and the modules it imports are hash-locked and kept outside the base environment. Each tool image carries a SHA-256 of its Dockerfile and the checkout files it copies (com.amd.agent-kernel-arena.eval-tool-source).2. The
gatedpolicy and the score changeToolPlangains arole(plan schema 3).baseline_also_found) only when the baseline reports it in the same kernel at the same location. A finding with neither (a page fault, an allocator-sensitive output, a CSAN race) matches by kind.pass_tool_gate: falsenow scores zero (src/score.py).gatedpolicy stays within that: a finding can only withhold a score, never raise one, so a candidate that evades or interferes with a tool scores no higher than it would with the stage off. The docs now say this.3. The default set
src/eval_tools/defaults.pyis the single source of truth for the set, the roles and the policy; the runner and the config parser both read it.docker_benchmark.sh:defaults.py, ongfx950only, and not for aqa_auditorrun, which never evaluates a candidate;AKA_EVAL_TOOL_IMAGE_<TOOL>is used as given, with a warning when its label differs;evaluation_tools: false(orenabled: []) turns the stage off; an explicit section is used exactly as written.CANDIDATE.md,AGENTS.mdand release notes cover the defaults and roles, the per-lane coverage limits, the confirmation, gross-mismatch and baseline-matching rules, and why ConSan, HIP-FpSan and Triton's ownconsan/gsanmodes are not enabled.Validation
Review fixes (
aa5b0ea4,52b905ca, on a merge ofmain8e7a7b32)CPU (Linux container, Python 3.12, torch CPU):
python -m pytest -q testsgives 2717 passed and 128 skipped;tests/test_docker_benchmark.shpasses. CI is green onaa5b0ea4.MI355X, default path end to end on
aa5b0ea4.docker_benchmark.sh parallel-runwith a run config withoutevaluation_toolsand a credential-freeclaudestand-in:silu_and_mul, HIPsigmoid, Gluongemm_a8w8and FlyDSLsoftmax: 4/4 accepted, no gate finding.tilelens:finding:found, score 0.MI355X, the tools through the manager on
52b905ca(one GPU, every default sidecar, baseline as the candidate unless seeded):topk_softmax,gemm_a16w16,gemm_a8w8_blockscale,gemm_afp4wfp4topk_softmaxplus a kernel that stores 64 MiB pasttopk_weightspage_fault_guard(gpu-memory-fault)topk_softmaxplus a kernel that reads a loaded VGPR befores_waitcnt vmcntrocjitsu_waitcheck(wait-hazard-wait-counter); ordinary correctness passessilu_and_mulnear and far out-of-bounds storespage_fault_guardandtilelens; the TileLens finding names the kernel andkernel.py:61, and the baseline recheck is cleantopk_topp_mask,kda_chunk_attention(rocJITsu VGPR race),prefix_prefill_attention_alibi(Waitcheck,_fwd_kernel_alibiat.text+0x2288)kda_chunk_kktAn earlier run of this set on
68a6c8fdfound that the TileLens sidecar's startup control did not pass after the location change, so TileLens was unavailable (recorded, not blocking).52b905cafixes it and adds regression tests.Follow-up jobs on the nodes found no container or temp directory left by these runs.
Not run on GPU: rebuilding an image with an old label (shell test only), a multi-GPU task (none on
main), and themixedrule (unit tests).Original revision (
55e4e547)CPU
tests/eval_tools/test_v3_sanitizers.py(54) andtests/test_arena_eval_sanitize.py(16) are new and pass.mainshares on the same macOS host.make check-perf-helperspasses.tests/test_docker_benchmark.shfails at the same GEAK check on this branch and onmainon a host without apythonexecutable. The DeepSeek image check passes; this change had to adapt it because defaults now start sidecars.Startup controls and images
boundscheck must agree on both an in-bounds copy and an off-by-one copy.GPU ASan, bare-metal MI355X host
Checked with both ordinary and hardened container flags:
gl.load/gl.store: the safe probes are clean, and the seeded out-of-bounds probes reportheap-buffer-overflow.Full campaign, virtualized MI355X cluster
Every schema-v3 task (379) ran its baseline as the candidate through the manager, with the default set under
gated. Six seeded out-of-bounds variants were added: Triton, HIP, Gluon and FlyDSL, near and far. Total: 385 entries.page_fault_guardcsantilelenstriton_fpsan(signal)rocjitsu_waitcheckrocjitsuGating.
Median cost per clean baseline, by tool:
page_fault_guard: 24 to 27 s.csan: 3.6 to 10.9 s.rocjitsu_waitcheck: 3.5 to 11 s.rocjitsu: 5.3 s.triton_fpsan: 3.6 s.tilelens: 2.4 s.Unverified on clean Triton baselines.
These record, but do not block. They mark where the default set gives no assurance.
Fixes from this campaign, all with regression tests:
layer_normbf16_d256. Itsmeanoutput for a one-row case is a single element, 11% over the bound. That counted as 100% of elements over it. The fraction rule now needs at least 8 elements over the bound; the run's own report is judged unverified under the new rule.TileLens confirmation and concrete bounds check
Run on the TileLens commit with the default images.
unified_attentionbf16_q8_kv4_d256_p16_swa1024:End to end
QA path.
make docker-runwithqa_auditorover 10 tasks (Triton, Gluon, HIP and FlyDSL), with the default set resolved and its images built: 10/10 QAPASS. The QA auditor finishes before tool evaluation, so this shows only that the defaults do not disturb the QA path.Agent path.
main.pythroughdocker_benchmark.sh parallel-run, with a run config that has noevaluation_toolssection. The agent is a credential-free stand-in for theclaudeCLI that makes a fixed edit. It covers one task per target language: Tritonsilu_and_mul, HIPsigmoid, Gluongemm_a8w8and FlyDSLsoftmax.pass_tool_gate: trueboth times.pass_tool_gate: false, blocked bytilelens:finding:found, and scores 0.All three runs used the final commit.
Findings on clean baselines, not triaged
The baseline recheck excuses these, because the same finding is reported on the baseline. They are reported here rather than fixed in this PR:
topk_topp_maskf32_v151936 and onkda_chunk_attentionbf16_h12_d128, and an LDS race onkda_chunk_kktbf16_h32_k128_c64.s_waitcnt vmcntonprefix_prefill_attention_alibi.ff_a16w16_fused_gatedagainst itself.unified_attentionblock-table read above.Not covered
unsupported. The page-fault guard, CSAN and the Waitcheck capture could run per rank through Add sgl-amd-mono monokernel tasks, multi-GPU kernel tasks and a compare decode hook #152's launcher; TileLens and rocJITsu cannot model peer-memory access. That is a follow-up once Add sgl-amd-mono monokernel tasks, multi-GPU kernel tasks and a compare decode hook #152 merges.HSA_XNACK=1a GPU access tomalloc()memory faults there, and so does the ASan runtime's heap-initialization kernel. It stays opt-in for bare-metal hosts. A GPU ASan campaign over every baseline on a bare-metal host did not get a host in time; only its probes above ran.gfx942remains unverified, and the runner keeps the stage off there.src/eval_tools, every default image is rebuilt on its next use. A host that cannot reach the package indexes stops the run instead of running old tool code; one validation node failed this way.aka-eval-<run label>-<tool>-<pid>and needdocker rm -f; reaping them at the start of a run is a follow-up.