Repository navigation
gemm_ar: drop the fused epilogue's fence knob, which nothing selects - #691
Merged
Merged
Conversation
`compile_fused_gemm_scatter` took a `fence` argument with eleven values. Every
caller in the tree -- `op.py`, the tests, and `bench_gemm_ar.py`'s own default --
left it at `none`, so the two `const_expr` chains it drove never emitted
anything and three `StoreC` subclasses were unreachable.
They are unreachable for a reason that is worth stating where the code is
rather than in an option nobody picks: **the counter is already the release.**
The `acq_rel` atomic_add emits its own `buffer_wbl2`/`buffer_inv` pair, on
thread 0 only, so an added `__threadfence_system` redoes that work per lane.
gcnasm's `opus_chunk_sdma_submit` has the same shape and no fence, which is
what pointed at it. Measured at m=16384 blockscale on 8 ranks: no fence
1143.5/1144.8us, `agent` 1797.0/1798.5, `all` 1936.1/1937.5 -- all three at
relL2 2.350e-3. The fences cost 650-790us and bought no accuracy. That
paragraph now sits in the epilogue instead of in `--help`.
Removed: the parameter, its validation list, the `{fence[0]}` kernel-name tag,
both dispatch chains, `_RawWriteThroughStoreC` / `_WriteThroughStoreC` /
`_NonTemporalStoreC`, the now-dead `release_fence` import, and the benchmark's
`--fence` with its result field. `direct_fence` is untouched -- it is Direct
LSA's, it is live, and it defaults to `leader`.
Two stale pieces of text went with it, both of which contradicted the `none`
default they shipped alongside in #662: the module docstring's protocol sketch
still listed `__threadfence_system()` as a step, and the epilogue comment still
read "This fence is not optional". Read literally, either would send someone
looking for a release that is not there.
`kernels_sdma`'s own `publish` knob is a different parameter and is still in
use; only its two comments pointing at the deleted `_WriteThroughStoreC` were
trimmed.
Verified rather than assumed, 3 runs a side at m=16384 blockscale on 8 ranks:
median 1145.8 -> 1146.2us, +0.03%, against a 1.9-2.8us spread within each side,
and relL2 bit-identical across all six (2.350369e-03).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
yangyuhuiling
pushed a commit
that referenced
this pull request
Oct 28, 2026
…m_ar All three settings measured the same, and nothing selected anything but the default: the bench passed it only to fused-lsa, whose epilogue never read it. fused-sdma keeps the one-wave system fence it always used. Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compile_fused_gemm_scattertook afenceargument with eleven values. Every caller in the tree —op.py, the tests, andbench_gemm_ar.py's own default — left it atnone, so the twoconst_exprchains it drove never emitted anything and threeStoreCsubclasses were unreachable.Why they are unreachable
The counter is already the release. The
acq_relatomic_addemits its ownbuffer_wbl2/buffer_invpair, on thread 0 only, so an added__threadfence_systemredoes that work per lane. gcnasm'sopus_chunk_sdma_submithas the same shape and no fence, which is what pointed at it.Measured at m=16384 blockscale on 8 ranks, twice each — the data #662 already had, in
--help:--fencenoneagentallThe fences cost 650–790 us and bought no accuracy. That paragraph now sits in the epilogue, next to the code it explains, instead of in the help text of an option nobody picks.
What was removed
The parameter, its eleven-value validation list, the
{fence[0]}kernel-name tag, both dispatch chains,_RawWriteThroughStoreC/_WriteThroughStoreC/_NonTemporalStoreC, the now-deadrelease_fenceimport, and the benchmark's--fencewith its result field.direct_fenceis untouched — it is Direct LSA's, it is live, and it defaults toleader.kernels_sdma'spublishis a different knob and is also still in use; only its two comments pointing at the deleted_WriteThroughStoreCwere trimmed.Two stale pieces of text went with it
Both contradicted the
nonedefault they shipped alongside in #662: the module docstring's protocol sketch still listed__threadfence_system()as a step, and the epilogue comment still read "This fence is not optional". Read literally, either would send someone looking for a release that is not there.Verification
Not assumed — 3 runs a side at m=16384 blockscale on 8 ranks:
+0.03% against a 1.9–2.8 us spread within each side, and relL2 bit-identical across all six runs (
2.350369e-03).Note for reviewers
tests/python/cco/test_gemm_ar.py::test_fused_is_stable_across_repeatsfails on this branch — but it also fails on a cleanorigin/main(e7e9747), withERROR ... src/application/transport/sdma/anvil.cpp:237. It is a pre-existing failure in the SDMA transport, not a regression from this change, and it is not addressed here.🤖 Generated with Claude Code