Repository navigation
Conversation
c5e8461 to
f3190c6
Compare
3b3b556 to
54500a2
Compare
f3190c6 to
a9d9558
Compare
fsx950223
left a comment
There was a problem hiding this comment.
Reviewed exact head a9d9558 against the supplied base. No concrete blocking defect was found. Four targeted gfx942 tests passed with pinned FlyDSL 0.5.0, covering the shared launch refactor. Essential validation of the new gfx1250 recorded-launch path remains unavailable on the configured hosts.
Validation:
- PASS on
local:git -C checkout rev-parse HEAD
Verified a9d9558 in the isolated checkout. - PASS on
local:python3 -m compileall -q checkout/aiter/ops/flydsl/pa_decode.py checkout/op_tests/test_flydsl_pa_decode.py
Exit status 0. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:flock -w 30 /tmp/codex-pr-review-7869-a9d9558c/gpu.lock timeout 300 /tmp/codex-pr-review-7869-a9d9558c/venv/bin/python -m pytest -q op_tests/test_flydsl_pa_decode.py -k "bf16-decode or bf16-window or bf16-cluster8"
Exit status 0: 4 passed, 480 deselected in 11.03s. Verified gfx942, exact checkout SHA, intended aiter import, and isolated FlyDSL 0.5.0 import. Used idle GPU 0 and separate compilation caches. Details in validation-record.json and gfx942-tests-retry.log. - FAIL on
dzm-mi355-gpu34-dev:ssh -o BatchMode=yes -o ConnectTimeout=10 -o RequestTTY=no -o ControlMaster=no -o ControlPath=none -o RemoteCommand=none dzm-mi355-gpu34-dev "squeue -h -u zhiming_ding_qle -o '%i|%N|%t'"
SSH exit status 255: connection to aac16.amd.com port 22 timed out. Allocation discovery and gfx950 testing could not proceed; evidence in allocation.log. - SKIP on
gfx1250:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py
No configured gfx1250 host. The recorded-launch reuse and fused FP8 repeat/new-plan cases were not executed by this review.
Remaining validation:
- gfx942 tests validate the shared launch refactor but do not exercise the gfx1250 cache-hit path.
- The author's reported gfx1250 results were not independently reproduced; GitHub exposed no CI results or existing review feedback.
- Multi-GPU cache reuse and the claimed host-time improvement were not measured.
- The initial isolated-environment attempt failed before test execution because torch was absent from its import path; the corrected attempt passed. Both logs are preserved.
Automated Codex review of commit a9d9558c806c.
a9d9558 to
db7efd1
Compare
DRAFT — evaluation pausedPR Self-ReviewRevision This pull request is a draft, so readiness evaluation is paused and no verdict applies. Evaluation resumes when it is marked ready for review and the required CI completes. |
fsx950223
left a comment
There was a problem hiding this comment.
Reviewed exact head db7efd1 and its complete merge-base diff. No concrete blocking defect was found in the launch-cache key or shared launch refactor. Four targeted gfx942 regression tests passed, but essential validation of the new gfx1250 cache-hit path remains unavailable on the configured hosts.
Validation:
- PASS on
local:git -C checkout rev-parse HEAD
Exit 0; verified db7efd1 in an isolated checkout. Merge-base d6ea3d1; complete PR diff preserved in pr.diff. - PASS on
local:python3 -m compileall -q checkout/aiter/ops/flydsl/pa_decode.py checkout/op_tests/test_flydsl_pa_decode.py
Exit 0; output preserved in compileall.log. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:flock -w 30 /tmp/codex-pr-review-20261119-7869-db7efd1a/gpu.lock timeout 300 python3 -m pytest -q op_tests/test_flydsl_pa_decode.py -k "bf16-decode or bf16-window or bf16-cluster8"
Exit 0: 4 passed, 491 deselected in 10.41s. Verified exact head SHA, gfx942, intended aiter checkout import, and isolated pinned FlyDSL 0.5.0 import. Used idle GPU 1 with HIP_VISIBLE_DEVICES=1 and separate AITER, FlyDSL and Triton caches. Logs preserved in gfx942-setup.log, gfx942-activity.log and gfx942-tests.log. - FAIL on
dzm-mi355-gpu34-dev:ssh -o BatchMode=yes -o ConnectTimeout=10 -o RequestTTY=no -o ControlMaster=no -o ControlPath=none -o RemoteCommand=none dzm-mi355-gpu34-dev "squeue -h -u zhiming_ding_qle -o '%i|%N|%t'"
Exit 255: connection to aac16.amd.com port 22 timed out. Allocation discovery and gfx950 tests could not proceed. Evidence preserved in allocation.log. - SKIP on
gfx1250:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py
No configured gfx1250 environment. Recorded-launch reuse and fused FP8 repeat/new-plan cases were not independently executed.
Remaining validation:
- gfx942 tests validate the shared launch refactor; they do not exercise the gfx1250 cache-hit path. The author's reported gfx1250 results were not independently reproduced.
- Current CI has a failed Aiter Test Gate. The failing shard reports an unrelated all-reduce rank-agreement test failure: CustomAllreduce lacks _is_gfx1250. Detailed evidence is preserved in ci-raw.log; this failure is outside the PR diff.
- Multi-GPU cache reuse and the claimed host-time improvement were not measured.
Automated Codex review of commit db7efd1ad405.
…cking it Token-graph and eager sparse prefill are host-bound: one ATOM sparse PA call spent ~50 us in aiter's pa_decode, ~6 us of it in the FlyDSL launch itself. pa_decode now records a validated gfx1250 tile launch that writes the final output (direct or cluster merge; no reducer, no standalone-quant fallback), keyed on everything its checks and dispatch read except tensor addresses: operand shapes, strides, dtypes and devices, scalar options, the plan's fields (not its identity, so a per-forward plan of the same shape reuses it), the partials' alignment and the current device. The shapes and the plan capacity also fix the cluster mode (cluster_seqs, cluster_steps, cluster_runs). A later call with the same key re-reads the addresses and launches. The checked call and the recorded one share one launch builder, so their arguments cannot drift. The table is bounded (cleared at 1024 keys), and the key is computed only when the table has entries or a launch is recorded, so calls on other archs pay nothing. No new compiled kernels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… launch With caller workspace (as ATOM passes it), a repeated fused FP8-output call and a call with a new plan of the same fields must compile nothing and still give bytes equal to PA + the standalone per-token quant. Launches recorded by earlier cases are cleared first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
db7efd1 to
4eaa731
Compare
fsx950223
left a comment
There was a problem hiding this comment.
Reviewed exact head 4eaa731, the complete diff, validation and dispatch logic, callers, tests, and earlier review feedback. No concrete blocking defect was found. Four targeted gfx942 regression tests passed, but essential validation of the new gfx1250 recorded-launch path remains unavailable on the configured hosts.
Validation:
- PASS on
local:git -C checkout rev-parse HEAD
Verified 4eaa731 in the isolated checkout. Supplied-base and merge-base diffs are preserved in complete.diff and merge-base.diff. - PASS on
local:python3 -m compileall -q checkout/aiter/ops/flydsl/pa_decode.py checkout/op_tests/test_flydsl_pa_decode.py
Exit status 0; compileall.log preserved. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:flock -w 30 /tmp/codex-pr-review-20261120-7869-4eaa7319/gpu.lock timeout 300 /tmp/codex-pr-review-20261120-7869-4eaa7319/venv/bin/python -m pytest -q op_tests/test_flydsl_pa_decode.py -k 'bf16-decode or bf16-window or bf16-cluster8'
Exit status 0: 4 passed, 538 deselected in 11.11s. Verified gfx942, idle GPU 0, intended source import, isolated FlyDSL 0.5.0 import, and separate compilation caches. Remote HEAD matched the supplied SHA and git diff --exit-code passed. Logs: gfx942-env.log, gfx942-sha.log, gfx942-tests-retry.log. - FAIL on
hjbog-srdc-39.amd.com / sixifang_dev:Initial isolated virtual-environment import check
Stopped before test execution with ModuleNotFoundError: No module named 'torch'. Corrected the import path to include the container's torch installation; the subsequent targeted tests passed. Initial evidence preserved in gfx942-tests.log. - FAIL on
dzm-mi355-gpu34-dev:ssh -o BatchMode=yes -o ConnectTimeout=10 -o RequestTTY=no -o ControlMaster=no -o ControlPath=none -o RemoteCommand=none dzm-mi355-gpu34-dev "squeue -h -u zhiming_ding_qle -o '%i|%N|%t'"
SSH connection to aac16.amd.com port 22 timed out. Allocation discovery and gfx950 testing could not proceed. Evidence preserved in allocation.log. - SKIP on
gfx1250:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py
No configured gfx1250 environment. Recorded-launch reuse and fused FP8 repeat/new-plan cases were not independently executed.
Remaining validation:
- gfx942 tests cover the shared launch refactor, not the gfx1250 cache-hit path. The author's reported gfx1250 results were not independently reproduced.
- Available CI statuses are green, including MI35X test shards, but do not establish gfx1250 recorded-launch coverage.
- Multi-GPU cache reuse and the claimed host-time improvement were not measured.
Automated Codex review of commit 4eaa73192821.
|
@coderfeli could you take a look when you have a moment? CI is green at 4eaa731, there are no open review threads, and the automated review found no blocking issues. This PR only needs a code-owner approval. |
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (5)
- Don't compute the 16-tensor signature for gfx1250 calls that can never be recorded.
aiter/ops/flydsl/pa_decode.py:831. Once any launch is recorded, every later gfx1250 call builds_launch_signatureand then misses. That covers reducer plans, sinks, the standalone-quant fallback, calls without caller workspace and FP8 calls withNonescales. The miss costs about 12-13 µs per call on CPU (control 0.03 µs), so about 0.7 ms per step at about 60 layers in a mixed sparse-prefill batch. Run the cheap reject tests first (sinks is None, all three workspace tensors given,output.stride() == query.stride(), scale tensors present for FP8). Better, record the eligibility verdict with the key, so a miss on a known-ineligible shape stays cheap. Another option is an explicitprepare-style API that returns_tile_launch's callable to the caller. That would remove the global table and the hand-kept key. - Build
key_inputsonly when it is used. "Other archs pay nothing" is not true today.pa_decode.py:786-830. Every call on every arch buildsscale_tensors, both key tuples andtemporary_output.data_ptr() % 8before theif _VALIDATED_LAUNCHEStest. That is about 0.5 µs per call, and ATOM calls FlyDSLpa_decodeper layer on gfx942/gfx950 underATOM_PA_FLYDSL, so about 30 µs per step. Wrap the build in a local function and call it only in the lookup branch and the record branch. Then fix the comment at:791-792and the commit/PR text. - Clear the table for every test, not only in
_check_quant_output.op_tests/test_flydsl_pa_decode.py:2826._run_pa_decode_case(:2550-2588) and other gfx1250 tests that pass caller workspace also record entries. A later case with the same signature then skips dispatch, socompile_kwargs[-1]/_check_pipe_policysee a stale or empty list, and the result depends on test order (reruns in one process,pytest-repeat). Add an autouse fixture:monkeypatch.setattr(pa_module, "_VALIDATED_LAUNCHES", {}). Also assertlen(compile_kwargs)is unchanged across the graph-capture block, so the test proves that capture takes the recorded path. Fix the PR body sentence "The table is cleared before each case". - Key the scalar options by type as well as value, or narrow the comment.
pa_decode.py:806-829.True == 1and0 == 0.0hash equal. A hit therefore launches forstore_output=1,quantized_pad_rows=False,sliding_window=0.0,query_length=Trueandmax_context_length=True, all of which the checked path rejects (:865/871/891/897/1352). Use(type(x), x). The comment at:569-574says the key holds "everything the checks and the dispatch read except tensor addresses". That is not accurate either: the arch is not keyed, and one address property (temporary_output % 8) is. - Re-measure at this head and post the numbers. The 50.6 -> 24.7 µs and end-to-end figures come from an earlier stack, combined with #7401. Post before/after
pa_decodehost time at 4eaa731 for a hit, for a gfx1250 miss with a non-empty table (item 1), and for a gfx950 call (item 2). No CI lane runs gfx1250, so the hit path is covered only by your MI455X run. Please include that log.
Checked and fine: the hit path passes the same pointers as the checked path (scales are reshape/squeeze views, the workspace tensors are the caller's own, and the reducer and quant fallback are never recorded). Every PADecodePlan field is keyed (capacity = work_info.shape[0]). The NHD data_ptr % 16 check is gfx950-only. Device and stream match.
Reviewed at 4eaa731 (Deep; hunter A + independent pass B + orchestrator probe re-run). First valarLip review.
fsx950223
left a comment
There was a problem hiding this comment.
Reviewed exact head 4eaa731. A host-side reproduction confirms that scalar-type collisions let cached calls bypass explicit argument validation. Four targeted gfx942 regression tests passed. Independent validation of the gfx1250 cache-hit path remains unavailable.
[P2] Preserve scalar types in the validated-launch key — aiter/ops/flydsl/pa_decode.py:614
After a valid gfx1250 call records a launch, repeating the same operands with store_output=1, quantized_pad_rows=False (instead of 0), or sliding_window=0.0 (instead of 0) hits the same key because Python hashes and compares these values equal to their valid counterparts. The cached path launches and returns before the explicit type checks, whereas the checked path rejects each call. This makes argument acceptance depend on cache history and violates the validated-launch contract. The exact-head host-side reproduction confirmed all three cases using a mocked cached launch. Include types in keys for type-sensitive scalar options and plan fields, or perform their type checks before cache lookup.
Validation:
- PASS on
local:git -C source rev-parse HEAD
Exit 0; verified 4eaa731 in an isolated checkout. Complete supplied-base and merge-base diffs preserved. - PASS on
local:python3 -m compileall -q source/aiter/ops/flydsl/pa_decode.py source/op_tests/test_flydsl_pa_decode.py
Exit 0. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:docker exec -i sixifang_dev python3 - < scalar-repro.py
Exit 0. Exact-head functions extracted through AST, with real CPU tensors and mocked current device/cached launch. All three invalid scalar calls invoked the cached launch; the checked path raised the expected TypeError or ValueError. Evidence: scalar-repro.py and scalar-repro.log. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:flock -w 30 /tmp/codex-pr-review-20261125-7869-4eaa7319/gpu.lock timeout 300 python3 -m pytest -q op_tests/test_flydsl_pa_decode.py -k 'bf16-decode or bf16-window or bf16-cluster8'
Exit 0: 4 passed, 538 deselected in 13.73s. Verified remote HEAD, clean tracked source, gfx942, idle GPU 0, intended aiter import, isolated FlyDSL 0.5.0 and compilation caches. Commands and output preserved in gfx942-run.sh, gfx942-sha.log and gfx942-tests.log. - FAIL on
dzm-mi355-gpu34-dev:ssh -o BatchMode=yes -o ConnectTimeout=10 -o RequestTTY=no -o ControlMaster=no -o ControlPath=none -o RemoteCommand=none dzm-mi355-gpu34-dev "squeue -h -u zhiming_ding_qle -o '%i|%N|%t'"
Exit 255: connection to aac16.amd.com port 22 timed out. Allocation discovery and gfx950 testing could not proceed. Evidence: gfx950-discovery.log. - SKIP on
gfx1250:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py
No configured gfx1250 environment; recorded-launch GPU reuse and fused FP8 repeat/new-plan cases were not independently executed.
Remaining validation:
- gfx942 tests cover the shared launch refactor, not gfx1250 cache-hit GPU behavior.
- The scalar reproduction validates host control flow with a mocked launch; it does not demonstrate GPU numerical corruption.
- Author-reported MI455X results were not independently reproduced. Available green MI35X CI statuses do not establish gfx1250 coverage.
- Multi-GPU cache reuse and host-time performance claims were not measured. Detailed validation records are preserved in validation-record.json.
Automated Codex review of commit 4eaa73192821.
… by type Review of ROCm#7869: - A gfx1250 call that is never recorded no longer reads 16 tensor signatures once a launch is recorded. Sinks and missing caller workspace are turned away before any key. The lookup takes two keys in turn, the call's options and plan and then its operands: a call whose options and plan recorded no launch (reducer plans, the standalone-quant fallback, constant FP8 scales) reads the plan's three tensors only, and an output with other strides than the query's stops after three operands. - No call builds a key until a checked call could record a launch (the table is None until then), so gfx942/gfx950 calls test one global. key_inputs, which every call built on every arch, is gone; so are the three null pointers and the closure that every checked call built for its launch and its second read of the current stream, and the checks now map the operands' dtypes to FlyDSL types once instead of every launch doing it. - Scalar options and plan fields are keyed with their types. store_output=1, quantized_pad_rows=False, sliding_window=0.0, query_length=1.0, a float max_context_length and a plan with a float max_batch_size no longer take the launch recorded for the value they equal, and an unhashable option reaches the checks instead of raising from the lookup. - Tests: an autouse fixture gives every test an empty table, graph capture must take the recorded launch of a fused plan and the checks of a fallback plan, and a new test pins the refusals above, that a launch reads the plan it is called with, and what the first calls of a process do. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ch-cache Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Thanks for the review. All five items are addressed in 2d45f7f (one commit on top of 4eaa731). CPU numbers below are Python 3.12 with the pinned FlyDSL 0.5.0, kernel compile and launch mocked, so the checks, the dispatch and the launch-argument marshalling are the real code. 1. No 16-tensor signature for calls that are never recorded. Both of your suggestions are in.
2.
3. The table is empty for every test.
4. Scalar options and plan fields are keyed with their types (
5. Numbers at this head. Host time of one MI455X, at 224c2b0 (2d45f7f with
CPU, launch mocked (median of 15 batches of 3000 calls):
The recorded path alone, 4eaa731 against this head in 12 separate processes: -0.42 µs on average (-0.74 to -0.10). MI455X at 224c2b0:
The end-to-end figures in the PR body are still the earlier stack's and are labelled so. Concurrent calls are as safe as before: a recording is a few single dict operations with a |
|
Fixed in 2d45f7f. [P2] Preserve scalar types in the validated-launch key. Scalar options and plan fields are now keyed with their types (
Validation on gfx1250 (MI455X) at 224c2b0, which is 2d45f7f with
|
fsx950223
left a comment
There was a problem hiding this comment.
Reviewed exact head 224c2b0 and the complete diff against e6d2d31. The earlier blocking scalar-type collision is addressed by typed keys and the new refusal test. No concrete blocking defect was found. Five targeted gfx942 tests passed, but essential independent GPU validation of the gfx1250 recorded-launch path remains unavailable.
Validation:
- PASS on
local:git -C source rev-parse HEAD
Verified the supplied head SHA in an isolated checkout. The merge-base equals the supplied base. Complete diff preserved in complete.diff. - PASS on
local:python3 -m compileall -q source/aiter/ops/flydsl/pa_decode.py source/op_tests/test_flydsl_pa_decode.py
Exit 0. git diff --check also passed; logs preserved. - PASS on
hjbog-srdc-39.amd.com / sixifang_dev:flock -w 30 /tmp/codex-pr-review-20261127-7869-224c2b0e/gpu.lock timeout 300 /tmp/codex-pr-review-20261127-7869-224c2b0e/venv/bin/python -m pytest -q op_tests/test_flydsl_pa_decode.py -k 'recorded_launch_refusals or bf16-decode or bf16-window or bf16-cluster8'
Exit 0: 5 passed, 538 deselected in 11.62s. Verified exact remote HEAD, clean tracked source, gfx942, idle GPU 0, intended aiter import and isolated FlyDSL 0.5.3 import. Final run used isolated AITER, FlyDSL runtime and Triton caches. Commands and output preserved in gfx942-final.sh and gfx942-tests-final.log. - FAIL on
hjbog-srdc-39.amd.com / sixifang_dev:Initial isolated-environment import check
Stopped before tests because PYTHONPATH selected the container's FlyDSL 0.4.0. Corrected import precedence; subsequent tests passed. Initial log preserved in gfx942-tests.log. - FAIL on
dzm-mi355-gpu34-dev:ssh -o BatchMode=yes -o ConnectTimeout=10 -o RequestTTY=no -o ControlMaster=no -o ControlPath=none -o RemoteCommand=none dzm-mi355-gpu34-dev "squeue -h -u zhiming_ding_qle -o '%i|%N|%t'"
SSH exit 255: connection to aac16.amd.com port 22 timed out. Allocation discovery and gfx950 testing could not proceed. Evidence preserved in gfx950-discovery.log. - SKIP on
gfx1250:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py
No configured gfx1250 environment. Recorded-launch GPU reuse, fused FP8 repeat/new-plan behavior and graph capture were not independently executed.
Remaining validation:
- gfx942 results validate the shared launcher and refusal/key assertions, but do not exercise gfx1250 cache-hit GPU execution.
- Author-reported MI455X correctness and performance results were reviewed but not independently reproduced.
- Available CI checks are green and MI35X logs list this test file; they do not establish gfx1250 recorded-launch coverage.
- Multi-GPU cache reuse and host-time performance claims were not independently measured. Detailed evidence is preserved in this task directory.
Automated Codex review of commit 224c2b0e03aa.
|
Closing: MiniMax-M3.1 now uses the NVFP4 sparse PA ops ( |
What this PR does
Sparse-prefill PA calls on gfx1250 are host-bound: an ATOM sparse PA call spent about 50 µs inside aiter's
pa_decode, mostly in argument checks and dispatch, and only about 6 µs in the FlyDSL launch itself.pa_decodenow records the validated launch of a gfx1250 tile kernel that writes the final output itself (direct or cluster merge; no reducer, no standalone-quant fallback)._tile_launch, so their arguments cannot drift.Noneuntil then), so a gfx942/gfx950 call tests one module global. Its launch goes through_tile_launch, with shared null pointers and FlyDSL types that the checks work out once; againstmainthat is about -0.6 µs per BF16-KV call and about +0.2 µs per FP8-KV call on the host (table below).Benefit
Host time of one
pa_decodecall in µs. The three revisions ofpa_decode.pyare loaded side by side and run the same calls in alternating batches; the value is the median. "recorded" is a repeated call whose launch is recorded, "launches recorded" a call that is never recorded while the table holds launches, "nothing recorded" what every gfx942/gfx950 call sees.MI455X (gfx1250), at 224c2b0 (2d45f7f with
mainmerged in;pa_decode.pyis the same file):measure_pa_decode_host.py, a script outside the tree; median of 9 batches of 2000 calls per revision, alternating):CPU, kernel compile and launch mocked (the checks, the dispatch and the launch-argument marshalling are the real code; Python 3.12, FlyDSL 0.5.0, median of 15 batches of 3000 calls). gfx942 gives the same picture as gfx950:
main99211b6End to end, the author's measurements on an earlier gfx1250 stack, before rebasing onto
main; not re-measured: MiniMax-M3 TP4 on MI455X with ROCm/ATOM#2949. These numbers combine this PR with #7401's fused FP8 output (now onmain), which were measured together. Method: CUDA events aroundrun_model, slowest rank, 2 interleaved server runs per arm.Testing
MI455X, one idle GPU, image
rocm/fw-bringup:gfx1250-minimax-m3-20261112, at 224c2b0: 2d45f7f withmaine6d2d31 merged in, which changes nothing underpa_decode.python3 -m pytest -q op_tests/test_flydsl_pa_decode.py: 369 passed, 174 skipped in 292 s (4eaa731: 368 passed, 174 skipped).python3 -m pytest -q op_tests/test_flydsl_pa_decode.py op_tests/test_flydsl_pa_decode.py --keep-duplicates -k 'recorded_launch or merge_alignment or (test_pa_decode and (cluster or merge or graph-workspace))': 258 passed (the 129 tests that pass caller workspace or pin a merge path, each twice in one process).The fused FP8-output cases that pass caller workspace, as ATOM does, repeat the call twice: once as-is and once with a new plan cloned from the first one's fields (the next forward's plan). This covers the M3 decode shapes on the cluster8 and cluster16 step splits. Neither repeat may compile anything, and both must stay bitwise equal to PA + the standalone quant. Graph capture must then take the recorded launch too, and the checks for a fallback plan, which is never recorded.
test_pa_decode_recorded_launch_refusals: a recorded launch does not serve a call that the checks refuse. That is an option of another type that compares equal to the recorded one (store_output=1,quantized_pad_rows=False,sliding_window=0.0,query_length=1.0, a floatmax_context_length, a plan with a floatmax_batch_size), or an operand that is never recorded (alibi_slopes,query_scale,sinks). Each refused call differs from the recorded valid one in that argument only. The test also checks that a launch reads the plan it is called with (the recorded call's plan is emptied and a plan of the same fields in other tensors must still serve), and what a new process does: gfx1250 opens the table by itself and repeats the launch by the third call; gfx942/gfx950 record nothing. No CI lane records a launch, so it also asserts on every arch, without a launch, that the keys tell apart equal values of other types, a plan of another capacity and partials at another alignment.An autouse fixture gives every test an empty table, so a launch recorded by another test cannot hide the dispatch that the tests pin. The second command runs the workspace cases twice in one process.
The recorded launch and the checked path build their arguments with the same
_tile_launch, so the two cannot drift apart.Never recorded: reducer calls, and FP8-output calls that fall back to the standalone quant (shared clusters, several KV heads, the last-arriver merge, query-split tiles).
On the host, without a GPU (CPU tensors, kernel compile and launch mocked, pinned FlyDSL 0.5.0):
mainlaunches on all three (about 5750 calls each).IndexErrorin_check_pipe_policy); gfx950 and gfx942 fail only whatmainfails in that harness.black --check,ruff checkandgit diff --checkare clean.Not covered
PADecodePlanplans always take the checked path.pa_decodeallocates it) are not recorded and always take the checked path.PR Self-Review
Reviewed revision
224c2b0
Behavior and intent
pa_decoderecords the validated launch of a gfx1250 tile kernel that writes the final output itself (direct or cluster merge; no reducer, no standalone-quant fallback) under two keys, the call's options and plan and then its operands: scalar options and plan fields with their types, the shape, strides, dtype and device of each operand and plan tensor, the partials' address modulo 8 and the current device.pa_decode(mostly checks/dispatch) vs ~6 us for the launch itself, and 50.6 -> 24.7 us per call after this change on an earlier gfx1250 stack.Noneuntil a checked gfx1250 call could record a launch.Validation and unverified scope
Head 224c2b0 merges
maine6d2d31 into 2d45f7f (the branch base predates main's Triton 3.9 fixes, soop_tests/test_gemm_a4w4.pywould fail in CI): no conflicts, and main changed nothing underaiter/ops/flydsl/kernels/pa_decode*,aiter/ops/flydsl/pa_decode.pyor the op test since that base. The CPU evidence below was taken at 2d45f7f.MI455X, one idle GPU, at 224c2b0: the full op test, the workspace cases twice in one process, and the host time per call of
main, 4eaa731 and this head:python3 -m pytest -q op_tests/test_flydsl_pa_decode.py: 369 passed, 174 skipped in 292 s (4eaa731: 368 passed, 174 skipped).python3 -m pytest -q op_tests/test_flydsl_pa_decode.py op_tests/test_flydsl_pa_decode.py --keep-duplicates -k 'recorded_launch or merge_alignment or (test_pa_decode and (cluster or merge or graph-workspace))': 258 passed (the 129 tests that pass caller workspace or pin a merge path, each twice in one process).Host time per call (
measure_pa_decode_host.py, a script outside the tree; median of 9 batches of 2000 calls per revision, alternating):host_diff_fuzz.py,host_cross_rev.py,host_threads.py,host_tests.py,measure_pa_decode_host.py --host, each on gfx1250, gfx950 and gfx942): 0 of 5736 call variants diverge from the checks with launches recorded; the checked path launches whatmainlaunches; no call raises under eight threads; the op test's path assertions pass on gfx1250, also with every test run twice; the host times above.black --check,ruff checkandgit diff --checkare clean._tile_launch; reducer calls and FP8-output calls that fall back to the standalone quant (shared clusters, several KV heads, last-arriver merge, query-split tiles) are never recorded.PADecodePlanplans and calls without caller workspace always take the checked path; no gfx942/gfx950 GPU run of this head besides CI.pa_decode.py(no kernel builder or compile argument changes).PR-specific question
Could a recorded launch be reused for a call that the full checks would have rejected or dispatched differently?
Truefrom1and0.0from0while a tuple key does not.work_info,reduce_infoandarrival_counters; their addresses, the values inside them andcapacityare read at call time, as the checked path does._tile_launchlimits drift in argument building, but not in the key; this is a reviewer point.Changed op tests
op_tests/test_flydsl_pa_decode.pytest_pa_decode_recorded_launch_refusalspins that a recorded launch serves neither an option of another type that compares equal to the recorded one nor an operand that is never recorded, that a launch reads the plan it is called with, what the first calls of a process do, and (on every arch, without a launch) that the keys hold the option types, the plan's size and the partials' alignment. An autouse fixture gives every test an empty launch table._VALIDATED_LAUNCHES. At 4eaa731 the new test fails (store_output=1is not refused) and a rerun of a workspace case in one process fails in_check_pipe_policy._check_quant_output; the new test is the only one that calls with equal values of other types, the only one that moves a plan's records to other tensors while the first plan is emptied, and the only one that starts from the table of a new process.