Skip to content

Fix DecoupledLookback with a device-scope memory fence - #116

Draft
shreyas-omkar wants to merge 3 commits into
JuliaGPU:mainfrom
shreyas-omkar:sh/device-fence
Draft

Fix DecoupledLookback with a device-scope memory fence#116
shreyas-omkar wants to merge 3 commits into
JuliaGPU:mainfrom
shreyas-omkar:sh/device-fence

Conversation

@shreyas-omkar

Copy link
Copy Markdown
Member

No description provided.

shreyas-omkar and others added 3 commits August 21, 2026 23:12
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant