Fix DecoupledLookback with a device-scope memory fence - #116
Draft
shreyas-omkar wants to merge 3 commits into
Draft
Fix DecoupledLookback with a device-scope memory fence#116shreyas-omkar wants to merge 3 commits into
shreyas-omkar wants to merge 3 commits into
Conversation
Replace the raw UnsafeAtomics.fence(acquire/release) in the DecoupledLookback lookback with an overridable `_decoupled_fence()` (generic no-op fallback). A plain fence is not device-scope and fails to select on recent NVPTX, so cross-block publish/consume was not coherent: correct on high-occupancy GPUs but racy where blocks run in waves. Each GPU backend supplies a native device fence via `@device_override` in its package extension. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Override `_decoupled_fence()` with a native device-scope fence per backend: CUDA threadfence; AMDGPU agent-scope seq_cst fence; oneAPI and OpenCL/POCL a SPIR-V device-scope atomic_work_item_fence; Metal an atomic_thread_fence over device memory at device scope (Metal 3.2+). Each extension is a single override so it lifts cleanly into KernelAbstractions if a portable fence lands there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a small-tile (block_size 16-64, one item per thread) non-uniform scan loop in both directions, run for every algorithm. It maximises the number of inter-block publish/consume handoffs so DecoupledLookback exercises the device fence on many blocks; a fence that is not device scoped drops whole-block carries and fails here. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.