Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1380,3 +1380,12 @@ this section verbatim). Each entry is one bullet starting with `- `.
retaining `memory_spans` as the extension fallback. Preserve its exact
emptiness semantics: a zero-length contiguous span is still one span, but
a strided view with an empty outer dimension has none.

125. **Validate hardware-gated fixture construction on ordinary CPU CI.**
The two-GPU peer-copy tests named a `GreedyScheduler` that mainline Dagger
never defined. Single-GPU jobs skipped the entire loop and hid the invalid
constructor until a two-device worker failed before checking any copies.
Share the valid constructor factory with a registered CPU test, retaining
fresh mutable scheduler state. Do not substitute another policy without
tracing its current call contract, hide an API typo with an optional guard,
or treat constructor checks as native peer-copy proof.
6 changes: 4 additions & 2 deletions test/gpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ using Krylov
using KernelAbstractions
end

include("gpu_peer_schedulers.jl")

# Sparse test bodies are shared with the CPU and MPI suites; see the file
# header for the acceleration/backend matrix they cover.
include(joinpath(@__DIR__, "array", "sparse_defs.jl"))
Expand Down Expand Up @@ -300,7 +302,7 @@ end
# and prior users of the allocations involved. Each case below would
# read stale or overwritten data if one of those orderings were lost.
ndevices > 1 && @testset "Cross-GPU copies, one process ($(nameof(typeof(sched))))" for sched in
(Dagger.RoundRobinScheduler(), Dagger.GreedyScheduler())
gpu_peer_copy_schedulers()
g1 = Dagger.scope(worker=1, cuda_gpu=1)
g2 = Dagger.scope(worker=1, cuda_gpu=2)
local_scope = Dagger.scope(worker=1, cuda_gpus=[1, 2])
Expand Down Expand Up @@ -546,7 +548,7 @@ end

# Two GPUs of one process: see the CUDA testset of the same name
ndevices > 1 && @testset "Cross-GPU copies, one process ($(nameof(typeof(sched))))" for sched in
(Dagger.RoundRobinScheduler(), Dagger.GreedyScheduler())
gpu_peer_copy_schedulers()
g1 = Dagger.scope(worker=1, rocm_gpu=1)
g2 = Dagger.scope(worker=1, rocm_gpu=2)
local_scope = Dagger.scope(worker=1, rocm_gpus=[1, 2])
Expand Down
11 changes: 11 additions & 0 deletions test/gpu_peer_schedulers.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Dagger, Test

# Build fresh instances of the supported policy for each vendor's test region.
# Mainline does not define the GreedyScheduler previously named here.
gpu_peer_copy_schedulers() = (Dagger.RoundRobinScheduler(),)

@testset "GPU peer-copy scheduler fixtures" begin
schedulers = gpu_peer_copy_schedulers()
@test schedulers isa Tuple{Dagger.RoundRobinScheduler}
@test first(schedulers) !== first(gpu_peer_copy_schedulers())
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ tests = [
("Task Affinity", "task-affinity.jl"),
("Thread Pinning", "threadpinning.jl"),
("Datadeps", "datadeps.jl"),
("GPU Peer-copy Fixtures", "gpu_peer_schedulers.jl"),
("Streaming", "streaming.jl"),
("Domain Utilities", "domain.jl"),
("Array - Allocation", "array/allocation.jl"),
Expand Down
Loading