Aurora LTS 2523.40#574
Open
michel2323 wants to merge 26 commits into
Open
Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/deps/generate_interfaces.jl b/deps/generate_interfaces.jl
index 8c62b75..108a001 100644
--- a/deps/generate_interfaces.jl
+++ b/deps/generate_interfaces.jl
@@ -337,34 +337,34 @@ function generate_headers(library::String, filename::Vector{String}, output::Str
end
end
- # Dedup: when two signatures map to the same C function name (because MKL
- # added an overload), keep the one with more parameters — typically the
- # newer signature (e.g. set_csr_data gained an `nnz` arg in MKL 2025.3.1).
- # Without this the generated onemkl.cpp has duplicate function definitions
- # and won't compile.
- _fn_name(h) = (pos = findfirst('(', h); strip(split(strip(h[1:pos-1]))[end]))
- _param_cnt(h) = (pos = findfirst('(', h); ep = findnext(')', h, pos); count(==(','), h[pos+1:ep-1]) + 1)
- keep_idx = Dict{String,Int}()
- keep_pc = Dict{String,Int}()
- for (i, sig) in enumerate(signatures)
- (sig[2] in blacklist) && continue
- fn = _fn_name(sig[1])
- pc = _param_cnt(sig[1])
- if !haskey(keep_idx, fn) || pc > keep_pc[fn]
- keep_idx[fn] = i
- keep_pc[fn] = pc
+ # Dedup: when two signatures map to the same C function name (because MKL
+ # added an overload), keep the one with more parameters — typically the
+ # newer signature (e.g. set_csr_data gained an `nnz` arg in MKL 2025.3.1).
+ # Without this the generated onemkl.cpp has duplicate function definitions
+ # and won't compile.
+ _fn_name(h) = (pos = findfirst('(', h); strip(split(strip(h[1:(pos - 1)]))[end]))
+ _param_cnt(h) = (pos = findfirst('(', h); ep = findnext(')', h, pos); count(==(','), h[(pos + 1):(ep - 1)]) + 1)
+ keep_idx = Dict{String, Int}()
+ keep_pc = Dict{String, Int}()
+ for (i, sig) in enumerate(signatures)
+ (sig[2] in blacklist) && continue
+ fn = _fn_name(sig[1])
+ pc = _param_cnt(sig[1])
+ if !haskey(keep_idx, fn) || pc > keep_pc[fn]
+ keep_idx[fn] = i
+ keep_pc[fn] = pc
+ end
end
- end
- keep_set = Set(values(keep_idx))
+ keep_set = Set(values(keep_idx))
path_oneapi_headers = joinpath(@__DIR__, output)
oneapi_headers = open(path_oneapi_headers, "w")
- for (i, (header, name_routine, version, type_routine, template)) in enumerate(signatures)
+ for (i, (header, name_routine, version, type_routine, template)) in enumerate(signatures)
# Blacklist
(name_routine in blacklist) && continue
- # Dedup
- (i in keep_set) || continue
+ # Dedup
+ (i in keep_set) || continue
# Pass scalars (e.g. alpha/beta inputs) as references instead of values
for type in ("short", "float", "double", "float _Complex", "double _Complex")
diff --git a/lib/level-zero/cmdlist.jl b/lib/level-zero/cmdlist.jl
index 1df4bb9..4a0e9d5 100644
--- a/lib/level-zero/cmdlist.jl
+++ b/lib/level-zero/cmdlist.jl
@@ -87,14 +87,14 @@ synchronize is forced before the event gating the submitted work is signaled.
"""
function sync_each_submission(f::Base.Callable, enable::Bool)
old = sync_each_submission!(enable)
- try
+ return try
f()
finally
sync_each_submission!(old)
end
end
-function execute!(queue::ZeCommandQueue, lists::Vector{ZeCommandList}, fence=nothing)
+function execute!(queue::ZeCommandQueue, lists::Vector{ZeCommandList}, fence = nothing)
r = zeCommandQueueExecuteCommandLists(queue, length(lists), lists, something(fence, C_NULL))
sync_each_submission() && synchronize(queue)
return r
diff --git a/lib/level-zero/oneL0.jl b/lib/level-zero/oneL0.jl
index 6963641..111543d 100644
--- a/lib/level-zero/oneL0.jl
+++ b/lib/level-zero/oneL0.jl
@@ -232,7 +232,7 @@ function __init__()
validation_layer[] = parse(Bool, get(ENV, "ZE_ENABLE_VALIDATION_LAYER", "false"))
parameter_validation[] = parse(Bool, get(ENV, "ZE_ENABLE_PARAMETER_VALIDATION", "false"))
- sync_each_submission!(parse_env_bool("ONEAPI_SYNC_EACH_SUBMISSION", false))
+ return sync_each_submission!(parse_env_bool("ONEAPI_SYNC_EACH_SUBMISSION", false))
end
end
diff --git a/lib/support/Support.jl b/lib/support/Support.jl
index 5fe9fc3..391a37c 100644
--- a/lib/support/Support.jl
+++ b/lib/support/Support.jl
@@ -35,9 +35,9 @@ function _check_sparse_abi()
_sparse_abi_ok[] && return
error(
"The loaded oneAPI_Support_jll binary predates the current sparse wrappers and has an " *
- "incompatible ABI; calling sparse routines against it would corrupt memory or crash. " *
- "Rebuild the support library from source with `julia --project deps/build_local.jl` " *
- "(or install a oneAPI_Support_jll built from the updated onemkl.cpp)."
+ "incompatible ABI; calling sparse routines against it would corrupt memory or crash. " *
+ "Rebuild the support library from source with `julia --project deps/build_local.jl` " *
+ "(or install a oneAPI_Support_jll built from the updated onemkl.cpp)."
)
end
@@ -53,7 +53,7 @@ function __init__()
# Probe the loaded support binary for a symbol that only the regenerated (wide-ABI)
# sparse wrappers export; `_check_sparse_abi` gates the affected calls on the result.
handle = Libdl.dlopen(oneAPI_Support_jll.liboneapi_support; throw_error = false)
- if handle !== nothing
+ return if handle !== nothing
_sparse_abi_ok[] =
Libdl.dlsym(handle, :onemklSsparse_set_csc_data; throw_error = false) !== nothing
end
diff --git a/lib/support/liboneapi_support.jl b/lib/support/liboneapi_support.jl
index e1b7327..c3d9958 100644
--- a/lib/support/liboneapi_support.jl
+++ b/lib/support/liboneapi_support.jl
@@ -6429,194 +6429,240 @@ function onemklZunmqr_batch_scratchpad_size(device_queue, side, trans, m, n, k,
end
function onemklXsparse_init_matrix_handle(p_spmat)
- @ccall liboneapi_support.onemklXsparse_init_matrix_handle(p_spmat::Ptr{matrix_handle_t})::Cint
+ return @ccall liboneapi_support.onemklXsparse_init_matrix_handle(p_spmat::Ptr{matrix_handle_t})::Cint
end
function onemklXsparse_release_matrix_handle(device_queue, p_spmat)
@ccall liboneapi_support.onemklXsparse_release_matrix_handle(device_queue::syclQueue_t,
- p_spmat::Ptr{matrix_handle_t})::Cint
+ p_spmat::Ptr{matrix_handle_t}
+ )::Cint
end
-function onemklSsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
+function onemklSsparse_set_csr_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
col_ind, values)
@ccall liboneapi_support.onemklSsparse_set_csr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ spmat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int32},
col_ind::ZePtr{Int32},
values::ZePtr{Cfloat})::Cint
end
-function onemklSsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
- row_ptr, col_ind, values)
+function onemklSsparse_set_csr_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
+ row_ptr, col_ind, values
+ )
@ccall liboneapi_support.onemklSsparse_set_csr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int64},
col_ind::ZePtr{Int64},
values::ZePtr{Cfloat})::Cint
end
-function onemklDsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
+function onemklDsparse_set_csr_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
col_ind, values)
@ccall liboneapi_support.onemklDsparse_set_csr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ spmat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int32},
col_ind::ZePtr{Int32},
values::ZePtr{Cdouble})::Cint
end
-function onemklDsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
- row_ptr, col_ind, values)
+function onemklDsparse_set_csr_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
+ row_ptr, col_ind, values
+ )
@ccall liboneapi_support.onemklDsparse_set_csr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int64},
col_ind::ZePtr{Int64},
values::ZePtr{Cdouble})::Cint
end
-function onemklCsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
+function onemklCsparse_set_csr_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
col_ind, values)
@ccall liboneapi_support.onemklCsparse_set_csr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ spmat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int32},
col_ind::ZePtr{Int32},
values::ZePtr{ComplexF32})::Cint
end
-function onemklCsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
- row_ptr, col_ind, values)
+function onemklCsparse_set_csr_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
+ row_ptr, col_ind, values
+ )
@ccall liboneapi_support.onemklCsparse_set_csr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int64},
col_ind::ZePtr{Int64},
values::ZePtr{ComplexF32})::Cint
end
-function onemklZsparse_set_csr_data(device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
+function onemklZsparse_set_csr_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ptr,
col_ind, values)
@ccall liboneapi_support.onemklZsparse_set_csr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ spmat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int32},
col_ind::ZePtr{Int32},
values::ZePtr{ComplexF64})::Cint
end
-function onemklZsparse_set_csr_data_64(device_queue, spmat, nrows, ncols, nnz, index,
- row_ptr, col_ind, values)
+function onemklZsparse_set_csr_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
+ row_ptr, col_ind, values
+ )
@ccall liboneapi_support.onemklZsparse_set_csr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
+ nnz::Int64, index::onemklIndex,
row_ptr::ZePtr{Int64},
col_ind::ZePtr{Int64},
values::ZePtr{ComplexF64})::Cint
end
-function onemklSsparse_set_csc_data(device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
- row_ind, values)
- @ccall liboneapi_support.onemklSsparse_set_csc_data(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int32},
- row_ind::Ptr{Int32},
- values::Ptr{Cfloat})::Cint
-end
-
-function onemklSsparse_set_csc_data_64(device_queue, spMat, nrows, ncols, nnz, index,
- col_ptr, row_ind, values)
- @ccall liboneapi_support.onemklSsparse_set_csc_data_64(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int64},
- row_ind::Ptr{Int64},
- values::Ptr{Cfloat})::Cint
-end
-
-function onemklDsparse_set_csc_data(device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
- row_ind, values)
- @ccall liboneapi_support.onemklDsparse_set_csc_data(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int32},
- row_ind::Ptr{Int32},
- values::Ptr{Cdouble})::Cint
-end
-
-function onemklDsparse_set_csc_data_64(device_queue, spMat, nrows, ncols, nnz, index,
- col_ptr, row_ind, values)
- @ccall liboneapi_support.onemklDsparse_set_csc_data_64(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int64},
- row_ind::Ptr{Int64},
- values::Ptr{Cdouble})::Cint
-end
-
-function onemklCsparse_set_csc_data(device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
- row_ind, values)
- @ccall liboneapi_support.onemklCsparse_set_csc_data(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int32},
- row_ind::Ptr{Int32},
- values::Ptr{ComplexF32})::Cint
-end
-
-function onemklCsparse_set_csc_data_64(device_queue, spMat, nrows, ncols, nnz, index,
- col_ptr, row_ind, values)
- @ccall liboneapi_support.onemklCsparse_set_csc_data_64(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int64},
- row_ind::Ptr{Int64},
- values::Ptr{ComplexF32})::Cint
-end
-
-function onemklZsparse_set_csc_data(device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
- row_ind, values)
- @ccall liboneapi_support.onemklZsparse_set_csc_data(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int32},
- row_ind::Ptr{Int32},
- values::Ptr{ComplexF32})::Cint
-end
-
-function onemklZsparse_set_csc_data_64(device_queue, spMat, nrows, ncols, nnz, index,
- col_ptr, row_ind, values)
- @ccall liboneapi_support.onemklZsparse_set_csc_data_64(device_queue::syclQueue_t,
- spMat::matrix_handle_t,
- nrows::Int64, ncols::Int64,
- nnz::Int64, index::onemklIndex,
- col_ptr::Ptr{Int64},
- row_ind::Ptr{Int64},
- values::Ptr{ComplexF32})::Cint
-end
-
-function onemklSsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, index, row_ind,
+function onemklSsparse_set_csc_data(
+ device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
+ row_ind, values
+ )
+ return @ccall liboneapi_support.onemklSsparse_set_csc_data(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int32},
+ row_ind::Ptr{Int32},
+ values::Ptr{Cfloat}
+ )::Cint
+end
+
+function onemklSsparse_set_csc_data_64(
+ device_queue, spMat, nrows, ncols, nnz, index,
+ col_ptr, row_ind, values
+ )
+ return @ccall liboneapi_support.onemklSsparse_set_csc_data_64(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int64},
+ row_ind::Ptr{Int64},
+ values::Ptr{Cfloat}
+ )::Cint
+end
+
+function onemklDsparse_set_csc_data(
+ device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
+ row_ind, values
+ )
+ return @ccall liboneapi_support.onemklDsparse_set_csc_data(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int32},
+ row_ind::Ptr{Int32},
+ values::Ptr{Cdouble}
+ )::Cint
+end
+
+function onemklDsparse_set_csc_data_64(
+ device_queue, spMat, nrows, ncols, nnz, index,
+ col_ptr, row_ind, values
+ )
+ return @ccall liboneapi_support.onemklDsparse_set_csc_data_64(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int64},
+ row_ind::Ptr{Int64},
+ values::Ptr{Cdouble}
+ )::Cint
+end
+
+function onemklCsparse_set_csc_data(
+ device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
+ row_ind, values
+ )
+ return @ccall liboneapi_support.onemklCsparse_set_csc_data(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int32},
+ row_ind::Ptr{Int32},
+ values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklCsparse_set_csc_data_64(
+ device_queue, spMat, nrows, ncols, nnz, index,
+ col_ptr, row_ind, values
+ )
+ return @ccall liboneapi_support.onemklCsparse_set_csc_data_64(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int64},
+ row_ind::Ptr{Int64},
+ values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklZsparse_set_csc_data(
+ device_queue, spMat, nrows, ncols, nnz, index, col_ptr,
+ row_ind, values
+ )
+ return @ccall liboneapi_support.onemklZsparse_set_csc_data(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int32},
+ row_ind::Ptr{Int32},
+ values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklZsparse_set_csc_data_64(
+ device_queue, spMat, nrows, ncols, nnz, index,
+ col_ptr, row_ind, values
+ )
+ return @ccall liboneapi_support.onemklZsparse_set_csc_data_64(
+ device_queue::syclQueue_t,
+ spMat::matrix_handle_t,
+ nrows::Int64, ncols::Int64,
+ nnz::Int64, index::onemklIndex,
+ col_ptr::Ptr{Int64},
+ row_ind::Ptr{Int64},
+ values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklSsparse_set_coo_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ind,
col_ind, values)
@ccall liboneapi_support.onemklSsparse_set_coo_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int32, ncols::Int32,
nnz::Int32, index::onemklIndex,
row_ind::ZePtr{Int32},
@@ -6624,10 +6670,11 @@ function onemklSsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, inde
values::ZePtr{Cfloat})::Cint
end
-function onemklSsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, index,
+function onemklSsparse_set_coo_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
row_ind, col_ind, values)
@ccall liboneapi_support.onemklSsparse_set_coo_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
nnz::Int64, index::onemklIndex,
row_ind::ZePtr{Int64},
@@ -6635,10 +6682,11 @@ function onemklSsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, i
values::ZePtr{Cfloat})::Cint
end
-function onemklDsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, index, row_ind,
+function onemklDsparse_set_coo_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ind,
col_ind, values)
@ccall liboneapi_support.onemklDsparse_set_coo_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int32, ncols::Int32,
nnz::Int32, index::onemklIndex,
row_ind::ZePtr{Int32},
@@ -6646,10 +6694,11 @@ function onemklDsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, inde
values::ZePtr{Cdouble})::Cint
end
-function onemklDsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, index,
+function onemklDsparse_set_coo_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
row_ind, col_ind, values)
@ccall liboneapi_support.onemklDsparse_set_coo_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
nnz::Int64, index::onemklIndex,
row_ind::ZePtr{Int64},
@@ -6657,10 +6706,11 @@ function onemklDsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, i
values::ZePtr{Cdouble})::Cint
end
-function onemklCsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, index, row_ind,
+function onemklCsparse_set_coo_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ind,
col_ind, values)
@ccall liboneapi_support.onemklCsparse_set_coo_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int32, ncols::Int32,
nnz::Int32, index::onemklIndex,
row_ind::ZePtr{Int32},
@@ -6668,10 +6718,11 @@ function onemklCsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, inde
values::ZePtr{ComplexF32})::Cint
end
-function onemklCsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, index,
+function onemklCsparse_set_coo_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
row_ind, col_ind, values)
@ccall liboneapi_support.onemklCsparse_set_coo_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
nnz::Int64, index::onemklIndex,
row_ind::ZePtr{Int64},
@@ -6679,10 +6730,11 @@ function onemklCsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, i
values::ZePtr{ComplexF32})::Cint
end
-function onemklZsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, index, row_ind,
+function onemklZsparse_set_coo_data(
+ device_queue, spmat, nrows, ncols, nnz, index, row_ind,
col_ind, values)
@ccall liboneapi_support.onemklZsparse_set_coo_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int32, ncols::Int32,
nnz::Int32, index::onemklIndex,
row_ind::ZePtr{Int32},
@@ -6690,10 +6742,11 @@ function onemklZsparse_set_coo_data(device_queue, spmat, nrows, ncols, nnz, inde
values::ZePtr{ComplexF64})::Cint
end
-function onemklZsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, index,
+function onemklZsparse_set_coo_data_64(
+ device_queue, spmat, nrows, ncols, nnz, index,
row_ind, col_ind, values)
@ccall liboneapi_support.onemklZsparse_set_coo_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
+ spmat::matrix_handle_t,
nrows::Int64, ncols::Int64,
nnz::Int64, index::onemklIndex,
row_ind::ZePtr{Int64},
@@ -6701,128 +6754,160 @@ function onemklZsparse_set_coo_data_64(device_queue, spmat, nrows, ncols, nnz, i
values::ZePtr{ComplexF64})::Cint
end
-function onemklSsparse_set_bsr_data(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklSsparse_set_bsr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64, blk_ncols::Int64,
- blk_nnz::Int64, row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int32},
- bsr_col_ind::Ptr{Int32},
- bsr_values::Ptr{Cfloat})::Cint
-end
-
-function onemklSsparse_set_bsr_data_64(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklSsparse_set_bsr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64,
- blk_ncols::Int64, blk_nnz::Int64,
- row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int64},
- bsr_col_ind::Ptr{Int64},
- bsr_values::Ptr{Cfloat})::Cint
-end
-
-function onemklDsparse_set_bsr_data(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklDsparse_set_bsr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64, blk_ncols::Int64,
- blk_nnz::Int64, row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int32},
- bsr_col_ind::Ptr{Int32},
- bsr_values::Ptr{Cdouble})::Cint
-end
-
-function onemklDsparse_set_bsr_data_64(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklDsparse_set_bsr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64,
- blk_ncols::Int64, blk_nnz::Int64,
- row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int64},
- bsr_col_ind::Ptr{Int64},
- bsr_values::Ptr{Cdouble})::Cint
-end
-
-function onemklCsparse_set_bsr_data(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklCsparse_set_bsr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64, blk_ncols::Int64,
- blk_nnz::Int64, row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int32},
- bsr_col_ind::Ptr{Int32},
- bsr_values::Ptr{ComplexF32})::Cint
-end
-
-function onemklCsparse_set_bsr_data_64(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklCsparse_set_bsr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64,
- blk_ncols::Int64, blk_nnz::Int64,
- row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int64},
- bsr_col_ind::Ptr{Int64},
- bsr_values::Ptr{ComplexF32})::Cint
-end
-
-function onemklZsparse_set_bsr_data(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklZsparse_set_bsr_data(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64, blk_ncols::Int64,
- blk_nnz::Int64, row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int32},
- bsr_col_ind::Ptr{Int32},
- bsr_values::Ptr{ComplexF32})::Cint
-end
-
-function onemklZsparse_set_bsr_data_64(device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
- row_blk_size, col_blk_size, blk_layout, index,
- bsr_row_ptr, bsr_col_ind, bsr_values)
- @ccall liboneapi_support.onemklZsparse_set_bsr_data_64(device_queue::syclQueue_t,
- spmat::matrix_handle_t,
- blk_nrows::Int64,
- blk_ncols::Int64, blk_nnz::Int64,
- row_blk_size::Int64,
- col_blk_size::Int64,
- blk_layout::onemklLayout,
- index::onemklIndex,
- bsr_row_ptr::Ptr{Int64},
- bsr_col_ind::Ptr{Int64},
- bsr_values::Ptr{ComplexF32})::Cint
+function onemklSsparse_set_bsr_data(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklSsparse_set_bsr_data(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64, blk_ncols::Int64,
+ blk_nnz::Int64, row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int32},
+ bsr_col_ind::Ptr{Int32},
+ bsr_values::Ptr{Cfloat}
+ )::Cint
+end
+
+function onemklSsparse_set_bsr_data_64(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklSsparse_set_bsr_data_64(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64,
+ blk_ncols::Int64, blk_nnz::Int64,
+ row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int64},
+ bsr_col_ind::Ptr{Int64},
+ bsr_values::Ptr{Cfloat}
+ )::Cint
+end
+
+function onemklDsparse_set_bsr_data(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklDsparse_set_bsr_data(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64, blk_ncols::Int64,
+ blk_nnz::Int64, row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int32},
+ bsr_col_ind::Ptr{Int32},
+ bsr_values::Ptr{Cdouble}
+ )::Cint
+end
+
+function onemklDsparse_set_bsr_data_64(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklDsparse_set_bsr_data_64(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64,
+ blk_ncols::Int64, blk_nnz::Int64,
+ row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int64},
+ bsr_col_ind::Ptr{Int64},
+ bsr_values::Ptr{Cdouble}
+ )::Cint
+end
+
+function onemklCsparse_set_bsr_data(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklCsparse_set_bsr_data(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64, blk_ncols::Int64,
+ blk_nnz::Int64, row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int32},
+ bsr_col_ind::Ptr{Int32},
+ bsr_values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklCsparse_set_bsr_data_64(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklCsparse_set_bsr_data_64(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64,
+ blk_ncols::Int64, blk_nnz::Int64,
+ row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int64},
+ bsr_col_ind::Ptr{Int64},
+ bsr_values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklZsparse_set_bsr_data(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklZsparse_set_bsr_data(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64, blk_ncols::Int64,
+ blk_nnz::Int64, row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int32},
+ bsr_col_ind::Ptr{Int32},
+ bsr_values::Ptr{ComplexF32}
+ )::Cint
+end
+
+function onemklZsparse_set_bsr_data_64(
+ device_queue, spmat, blk_nrows, blk_ncols, blk_nnz,
+ row_blk_size, col_blk_size, blk_layout, index,
+ bsr_row_ptr, bsr_col_ind, bsr_values
+ )
+ return @ccall liboneapi_support.onemklZsparse_set_bsr_data_64(
+ device_queue::syclQueue_t,
+ spmat::matrix_handle_t,
+ blk_nrows::Int64,
+ blk_ncols::Int64, blk_nnz::Int64,
+ row_blk_size::Int64,
+ col_blk_size::Int64,
+ blk_layout::onemklLayout,
+ index::onemklIndex,
+ bsr_row_ptr::Ptr{Int64},
+ bsr_col_ind::Ptr{Int64},
+ bsr_values::Ptr{ComplexF32}
+ )::Cint
end
function onemklXsparse_init_matmat_descr(p_desc)
diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl
index 3b572c9..7a55f62 100644
--- a/src/compiler/compilation.jl
+++ b/src/compiler/compilation.jl
@@ -320,7 +320,7 @@ end
# TODO: emit printf format strings in constant memory
extensions = String[
"SPV_EXT_relaxed_printf_string_address_space",
- "SPV_EXT_shader_atomic_float_add"
+ "SPV_EXT_shader_atomic_float_add",
]
# The LTS SPIR-V stack cannot codegen native bfloat in generic kernels (clamp! ->
# InvalidIRError, and SPV_KHR_bfloat16 segfaults NEO), so keep bf16 off entirely on
diff --git a/src/context.jl b/src/context.jl
index 17219d7..f625a40 100644
--- a/src/context.jl
+++ b/src/context.jl
@@ -244,8 +244,10 @@ function register_queue!(ctx::ZeContext, dev::ZeDevice, queue::ZeCommandQueue)
GC.enable_finalizers(false)
try
@lock queue_registry_lock begin
- push!(get!(Vector{Tuple{WeakRef,ZeCommandQueue}}, queue_registry, (ctx, dev)),
- (WeakRef(current_task()), queue))
+ push!(
+ get!(Vector{Tuple{WeakRef, ZeCommandQueue}}, queue_registry, (ctx, dev)),
+ (WeakRef(current_task()), queue)
+ )
end
finally
GC.enable_finalizers(true)
@@ -265,17 +267,17 @@ end
# task-local, so once their task is dead no new work can reach them, and the entry can
# be dropped (allowing the queue to be finalized) after a final synchronize.
const queue_registry_lock = ReentrantLock()
-const queue_registry = Dict{Tuple{ZeContext,ZeDevice},Vector{Tuple{WeakRef,ZeCommandQueue}}}()
+const queue_registry = Dict{Tuple{ZeContext, ZeDevice}, Vector{Tuple{WeakRef, ZeCommandQueue}}}()
# synchronize all known queues that target the given context (and device, if specified),
# i.e., all queues whose in-flight work could possibly reference an allocation that is
# about to be freed.
-function synchronize_all_queues(ctx::ZeContext, dev::Union{ZeDevice,Nothing})
+function synchronize_all_queues(ctx::ZeContext, dev::Union{ZeDevice, Nothing})
# only the LTS stack populates the queue registry (see `global_queue`); on the
# rolling stack this is a no-op and `release` frees directly.
oneL0.LTS[] || return
queues = ZeCommandQueue[]
- stale = Tuple{WeakRef,ZeCommandQueue}[]
+ stale = Tuple{WeakRef, ZeCommandQueue}[]
GC.enable_finalizers(false)
try
@lock queue_registry_lock begin
diff --git a/src/mapreduce.jl b/src/mapreduce.jl
index f37e786..2734c0e 100644
--- a/src/mapreduce.jl
+++ b/src/mapreduce.jl
@@ -167,7 +167,7 @@ function GPUArrays.mapreducedim!(f::F, op::OP, R::oneWrappedArray{T},
# loop forever (StackOverflowError). Fall through instead so the normal path raises
# the usual kernel-conversion error for the unsupported host input.
if Acontig isa oneArray
- return GPUArrays.mapreducedim!(identity, op, R, Acontig; init=init)
+ return GPUArrays.mapreducedim!(identity, op, R, Acontig; init = init)
end
end
@@ -216,12 +216,15 @@ function GPUArrays.mapreducedim!(f::F, op::OP, R::oneWrappedArray{T},
# from the driver), rather than a hardcoded 256 that can exceed the kernel's max
# work-group size on some devices and fail the launch.
cargs = (f, op, init, Rreduce, Rother, R′, A)
- ckernel = zefunction(coalesced_mapreduce_device,
- Tuple{Core.Typeof.(kernel_convert.(cargs))...})
+ ckernel = zefunction(
+ coalesced_mapreduce_device,
+ Tuple{Core.Typeof.(kernel_convert.(cargs))...}
+ )
items = clamp(length(Rother), 1, launch_configuration(ckernel))
groups = min(cld(length(Rother), items), 1024)
- @oneapi items=items groups=groups coalesced_mapreduce_device(
- f, op, init, Rreduce, Rother, R′, A)
+ @oneapi items = items groups = groups coalesced_mapreduce_device(
+ f, op, init, Rreduce, Rother, R′, A
+ )
return R
end
diff --git a/src/utils.jl b/src/utils.jl
index 3c14edc..1a07016 100644
--- a/src/utils.jl
+++ b/src/utils.jl
@@ -2,8 +2,10 @@
function versioninfo(io::IO=stdout)
if Sys.islinux()
println(io, "Binary dependencies:")
- for jll in [oneL0.NEO_jll, oneL0.NEO_jll.libigc_LTS_jll, oneL0.NEO_jll.gmmlib_jll,
- SPIRV_LLVM_Backend_jll, SPIRV_LLVM_Translator_jll, SPIRV_Tools_jll, oneAPI_Support_jll]
+ for jll in [
+ oneL0.NEO_jll, oneL0.NEO_jll.libigc_LTS_jll, oneL0.NEO_jll.gmmlib_jll,
+ SPIRV_LLVM_Backend_jll, SPIRV_LLVM_Translator_jll, SPIRV_Tools_jll, oneAPI_Support_jll,
+ ]
name = string(jll)
print(io, "- $(name[1:end-4]): $(Base.pkgversion(jll))")
if jll.host_platform !== nothing
diff --git a/test/array.jl b/test/array.jl
index e4be18b..c14e342 100644
--- a/test/array.jl
+++ b/test/array.jl
@@ -106,22 +106,22 @@ end
end
@testset "strided mixed reductions" begin
- # The Aurora LTS IGC miscompiles a reduction kernel's global reads when the *innermost*
- # reduced axis is strided (dim 1 kept, e.g. `dims=2`); mapreducedim! routes those to a
- # coalesced kernel. Reductions that also reduce dim 1 (e.g. `dims=(1,3)`) keep a contiguous
- # innermost axis and stay correct on the workgroup-per-slice kernel — including with a small
- # leading dim, where the contiguous run is short. Use Int32 (exact, associative) so the
- # check is immune to Float32 accumulation-order rounding. Regression for PR_REVIEW.md #7.
- for (sz, dts) in (
- ((2, 512, 64), ((1, 3), (2,), (3,), (2, 3), (1, 2, 3), 1)),
- ((3, 256, 48), ((1, 3), (2,), (1, 2, 3))),
- ((7, 300, 20), ((1, 3), (2,), (3,))),
- ((2, 128, 8, 32), ((1, 3), (1, 4), (2, 4), (1, 2, 4))),
- )
- A = rand(Int32(1):Int32(4), sz...)
- dA = oneArray(A)
- for dt in dts
- @test Array(sum(dA; dims = dt)) == sum(A; dims = dt)
+ # The Aurora LTS IGC miscompiles a reduction kernel's global reads when the *innermost*
+ # reduced axis is strided (dim 1 kept, e.g. `dims=2`); mapreducedim! routes those to a
+ # coalesced kernel. Reductions that also reduce dim 1 (e.g. `dims=(1,3)`) keep a contiguous
+ # innermost axis and stay correct on the workgroup-per-slice kernel — including with a small
+ # leading dim, where the contiguous run is short. Use Int32 (exact, associative) so the
+ # check is immune to Float32 accumulation-order rounding. Regression for PR_REVIEW.md #7.
+ for (sz, dts) in (
+ ((2, 512, 64), ((1, 3), (2,), (3,), (2, 3), (1, 2, 3), 1)),
+ ((3, 256, 48), ((1, 3), (2,), (1, 2, 3))),
+ ((7, 300, 20), ((1, 3), (2,), (3,))),
+ ((2, 128, 8, 32), ((1, 3), (1, 4), (2, 4), (1, 2, 4))),
+ )
+ A = rand(Int32(1):Int32(4), sz...)
+ dA = oneArray(A)
+ for dt in dts
+ @test Array(sum(dA; dims = dt)) == sum(A; dims = dt)
+ end
end
- end
end
diff --git a/test/level-zero.jl b/test/level-zero.jl
index bbf8f46..101b7c6 100644
--- a/test/level-zero.jl
+++ b/test/level-zero.jl
@@ -210,21 +210,21 @@ pool = ZeEventPool(ctx, 2)
signal_event = pool[1]
wait_event = pool[2]
-# This is a submit-then-signal pattern: the kernel is gated on `wait_event`, which is
-# only signaled *after* submission. The ONEAPI_SYNC_EACH_SUBMISSION=1 workaround (Aurora
-# LTS) makes `execute!` block in zeCommandQueueSynchronize right after submitting, which
-# would deadlock here since the kernel cannot retire before `wait_event` is signaled. No
-# production code path submits event-gated work, so disable the workaround just here.
-oneL0.sync_each_submission(false) do
- execute!(queue) do list
- append_launch!(list, kernel, 1, signal_event, wait_event)
- end
- @test !Base.isdone(signal_event)
-
- signal(wait_event)
- synchronize(queue)
- @test Base.isdone(signal_event)
-end
+ # This is a submit-then-signal pattern: the kernel is gated on `wait_event`, which is
+ # only signaled *after* submission. The ONEAPI_SYNC_EACH_SUBMISSION=1 workaround (Aurora
+ # LTS) makes `execute!` block in zeCommandQueueSynchronize right after submitting, which
+ # would deadlock here since the kernel cannot retire before `wait_event` is signaled. No
+ # production code path submits event-gated work, so disable the workaround just here.
+ oneL0.sync_each_submission(false) do
+ execute!(queue) do list
+ append_launch!(list, kernel, 1, signal_event, wait_event)
+ end
+ @test !Base.isdone(signal_event)
+
+ signal(wait_event)
+ synchronize(queue)
+ @test Base.isdone(signal_event)
+ end
end
diff --git a/test/onemkl.jl b/test/onemkl.jl
index 4a4c7fc..518c179 100644
--- a/test/onemkl.jl
+++ b/test/onemkl.jl
@@ -14,7 +14,7 @@ k = 13
@testset "Version" begin
version_onemkl = oneMKL.version()
- @test version_onemkl ≥ v"2025.2.0"
+ @test version_onemkl ≥ v"2025.2.0"
end
############################################################################################ |
eec2785 to
991d29e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #574 +/- ##
==========================================
+ Coverage 79.02% 81.00% +1.97%
==========================================
Files 49 49
Lines 3333 3332 -1
==========================================
+ Hits 2634 2699 +65
+ Misses 699 633 -66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
32d11d7 to
b13cc3e
Compare
8493ceb to
1a91e1a
Compare
Aurora ships the Intel "LTS" GPU software stack rather than the rolling
release that upstream oneAPI.jl targets. Pin the whole toolchain to it:
- JLLs: NEO_LTS_jll =25.18.33578, oneAPI_Level_Zero_Loader_LTS_jll
=1.24, oneAPI_Level_Zero_Headers_LTS_jll, libigc_LTS_jll, and the
oneMKL 2025.3.1 support library. lib/level-zero/oneL0.jl aliases the
*_LTS_jll packages back to their canonical names so the rest of the
code is unchanged.
- Keep the SPIR-V Translator (SPIRV_LLVM_Translator_jll 21,
SPIRVIntrinsics 0.5). The LTS NEO/IGC runtime does not accept the
output of upstream's LLVM SPIR-V back-end (#491), so revert the
back-end switch in src/compiler/compilation.jl, src/oneAPI.jl and
src/utils.jl and restore the explicit SPIR-V extension list.
- Regenerate the oneMKL C bindings against 2025.3.1 (deps/src/onemkl.*,
lib/support/liboneapi_support.jl, deps/generate_interfaces.jl) and
fix the sparse CSR argument types (ZePtr/onemklIndex) in the
regenerated bindings and res/support.toml. Stay on oneMKL 2025.3.1,
declining the upstream oneAPI 2026.0.0 migration (#582).
- Prepend NEO's libze_intel_gpu directory to LD_LIBRARY_PATH in
__init__ so libsycl's bundled ze_lib finds the driver by path when
no system NEO is installed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The LTS IGC silently miscompiles strided memory accesses inside the
reduction kernels, producing wrong results with no error. Add two
complementary guards in src/mapreduce.jl:
- A coalesced reduction kernel for the case where the contiguous
leading dimension is reduced (size(Rreduce, 1) == 1, e.g.
sum(A; dims=2)), avoiding the strided per-thread loads.
- Materialize strided / non-dense inputs (Transpose, Adjoint,
PermutedDimsArray, SubArray, ...) to a dense array before reducing,
via _dense_reduce_input; this fixes e.g. `a == transpose(b)`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On the LTS NEO stack (25.18) freeing a buffer does not drain queues that
still have work in flight referencing it: the in-flight kernel then
faults and the context is banned, surfacing later as a
ZE_RESULT_ERROR_UNKNOWN at an unrelated op. global_queue is task-local,
so a test file's task can also die with work still queued.
- Register every global queue in a per-(context,device) registry that
holds the queue strongly, keyed by a weak reference to the owning
task (src/context.jl). A WeakRef to the queue would be cleared in the
same GC cycle that queues its finalizer, hiding it from release
exactly when its in-flight work still references buffers being freed.
- Before any BLOCKING_FREE, synchronize all queues that could
reference the buffer (src/pool.jl, synchronize_all_queues).
- Synchronize outside the registry lock with finalizers disabled, skip
already-finalized queues, and retire queues of dead tasks.
- In the queue finalizer, drain (unchecked, since a banned context
returns an error) then destroy, and null the handle so a concurrent
synchronize_all_queues skips it (lib/level-zero/cmdqueue.jl).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DFT wrappers passed pointer(lengths) / pointer(strides) to the descriptor create/set calls. A raw Ptr does not keep the backing vector alive, so the GC could collect it mid-call and oneMKL would read garbage dimensions/strides, failing commit with FFT_INVALID_DESCRIPTOR or a SIGFPE depending on heap reuse. Pass the arrays themselves so ccall roots them for the duration of the call (lib/mkl/fft.jl). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Aurora LTS NEO stack intermittently drops the tail of a command list, silently corrupting results. Add an off-by-default workaround (ONEAPI_SYNC_EACH_SUBMISSION=1) that synchronizes the queue after every command-list submission (lib/level-zero/cmdlist.jl, parsed in lib/level-zero/oneL0.jl __init__). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Set up the GitHub Actions job for the Aurora LTS self-runner
(.github/workflows/ci.yml):
- Enable per-worker GPU spreading (ONEAPI_TEST_SPREAD_GPUS=1) and the
per-submission synchronize workaround (ONEAPI_SYNC_EACH_SUBMISSION=1).
- Run the test step through `julia -C native,-avx512fp16` to avoid
Sapphire Rapids AVX512-FP16 host miscompilation of Float16 work under
concurrent oneMKL load (the GPU results are correct; the corruption
is on the host CPU).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Make the Intel LTS-stack support opt-in so this branch can eventually merge
into main without affecting the rolling stack: with the flag off, every LTS
code path is bypassed and behavior matches upstream.
Introduce oneL0.LTS[], resolved at the top of oneL0.__init__ from ONEAPI_LTS
(default on for this branch; set ONEAPI_LTS=0 for the rolling-stack paths).
Resolved before the driver-availability early returns so it is set even on a
host without a functional GPU. Gate on it:
- Layer 1 (behavior): the strided-reduction materialization and the
coalesced-kernel dispatch in mapreducedim!; the command-queue registry
(global_queue / synchronize_all_queues), the pre-free synchronize in
release, and the queue-finalizer drain + handle-null in cmdqueue.jl.
- Layer 2 (codegen): _compiler_config now selects the SPIRVCompilerTarget
backend (:khronos translator vs :llvm back-end) and the SPIR-V extension
list from the flag. GPUCompiler loads the tool lazily, so both SPIR-V JLLs
can coexist as deps and the choice is made at compile time.
Deferred to layer 3: driver-JLL selection (NEO/loader/headers/igc) via
Preferences and the oneMKL support-library ABI. The oneMKL FFT GC-rooting is
left as-is (already fixed upstream via GC.@preserve).
Verified: precompiles and loads; ONEAPI_LTS unset/1 -> on, ONEAPI_LTS=0 -> off.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gpuarrays/math/intrinsics BFloat16 subtest failed two ways: 1. Host-side: Core.BFloat16 exists on Julia 1.12 but has no Real->bf16 constructors (those live in BFloat16s.jl), so ET(-1) threw a MethodError before any GPU work. Add BFloat16s as a test dep and load it in the worker so the CPU reference path works. 2. Codegen: _device_supports_bfloat16() is a hardware check, but the Aurora LTS SPIR-V stack (Khronos translator + NEO/IGC) cannot codegen native bfloat in generic kernels -- clamp! fails with InvalidIRError, and declaring SPV_KHR_bfloat16 crashes the LTS runtime. Gate the bf16 eltypes push on !oneL0.LTS[] so BFloat16 is only exercised as a generic element type off the LTS stack (storage/conversions/oneMKL bf16 are unaffected).
434bd6c to
f158ea6
Compare
The examples testset runs bfloat16.jl as a subprocess, and it unconditionally compiles the scale_bf16 kernel. The example uses Core.BFloat16 as storage only (all math via Float32 reinterpret round-trips), but even a bfloat load/store forces the bfloat LLVM type into the module, which the LTS Khronos translator cannot emit without SPV_KHR_bfloat16 (rejected by the LTS runtime). So it fails with "Failed to translate LLVM code to SPIR-V" regardless of device support. Add an oneL0.LTS[] skip-guard alongside the existing old-Julia and unsupported-device guards, so the example exits cleanly on the LTS stack. Claude-Session: https://claude.ai/code/session_01QM51M7h61UVk7uKU5o5sCZ
Wrap the SYNC_EACH_SUBMISSION Ref in sync_each_submission() getter, sync_each_submission!(enable) setter, and a scoped sync_each_submission(f, enable) do-block form. Use the scoped form to disable the workaround around the submit-then-signal block in test/level-zero.jl. That block launches a kernel gated on a wait_event that is only signaled after submission; under ONEAPI_SYNC_EACH_SUBMISSION=1, execute! synchronizes on submission and deadlocks waiting for a kernel that cannot retire yet. No production path submits event-gated work, so the workaround stays safe everywhere it matters.
Rebase artifacts regressed the package version 2.6.2 -> 2.6.1 (which would make the registry reject a tag and Pkg treat the branch as a downgrade) and dropped GPUToolbox 3 from the compat entry (GPUToolbox 3.0.0 is registered, so environments holding v3 could no longer resolve this package). Restore both to match main. Addresses PR_REVIEW.md finding #9.
ONEAPI_SYNC_EACH_SUBMISSION accepted only ("1","true","yes") while the
sibling ONEAPI_LTS also accepted "on". A deployment setting
ONEAPI_SYNC_EACH_SUBMISSION=on therefore ran with the dropped-tail
workaround silently disabled. Route both flags through a shared
parse_env_bool helper that accepts on/off/yes/no/1/0/true/false and warns
on an unrecognized value instead of silently defaulting to off.
Addresses PR_REVIEW.md finding #8.
The queue registry that synchronize_all_queues/release rely on to drain in-flight work before freeing a buffer was only populated by global_queue. KA.priority! replaced the task-local queue with a directly constructed, unregistered ZeCommandQueue, so after priority!(backend, :high) all work ran on a queue release() never synchronizes: freeing a dead oneArray whose last kernel had not retired reused the buffer under the running kernel, the exact use-after-free (GPU pagefault -> banned context) the registry exists to prevent on the LTS NEO stack. Extract the registry insertion into a shared register_queue! helper and call it from both global_queue and priority!. Addresses PR_REVIEW.md finding #4.
…puts _dense_reduce_input(::AbstractArray) is false for a plain CPU array, so the LTS materialization fallback materialized it (to another CPU array) and re-called GPUArrays.mapreducedim!, which failed the same predicate and recursed forever -> StackOverflowError, where main failed fast with a kernel-conversion error. Only recurse when materialization actually produced a dense oneArray; otherwise fall through to the normal path so the usual conversion error surfaces for an unsupported host input. Addresses PR_REVIEW.md finding #5.
…rever The LTS finalizer drained the queue with unchecked_zeCommandQueueSynchronize( obj, typemax(UInt64)) before destroy, to avoid the destroy-with-work-in-flight fault that bans the context on the LTS NEO stack. But a task that submits event-gated work and dies before signaling the event leaves the queue permanently unfinishable, so that infinite wait hangs the finalizer — and with it GC and process exit — forever. Wait with a bounded 10 s timeout instead; on timeout, warn and leak the queue deliberately rather than destroy it (which would trigger the very fault+ban the drain exists to prevent). Addresses PR_REVIEW.md finding #6.
Finding #7 conjectured that a reduction including dim 1 plus a strided dim (e.g. sum(A; dims=(1,3)) with a small leading dim) would still hit the LTS IGC strided-load miscompile, since size(Rreduce,1) != 1 routes it to partial_mapreduce_device. Empirically it does not: consecutive work-item lanes step through consecutive Rreduce entries whose first axis is dim 1, so when dim 1 is reduced the innermost reduced axis is contiguous and those reads coalesce — correct even when a strided dim is also reduced. A sweep of dims=(1,3)-style reductions with small leading dims (n1 in 2..7) matched the CPU exactly. The size(Rreduce,1)==1 guard is therefore the correct predicate; record the reasoning and verification rather than add needless materialization. Addresses PR_REVIEW.md finding #7.
The branch removed SPIRV_LLVM_Backend_jll from deps and replaced using SPIRV_LLVM_Backend_jll with using SPIRV_LLVM_Translator_jll, but the non-LTS path (ONEAPI_LTS=0) still selects backend=:llvm. GPUCompiler resolves that back-end through a LazyModule that checks Base.loaded_modules, so with the JLL neither a dep nor loaded, the first @oneapi launch on the rolling stack failed in mcgen and no kernel could compile at all. Re-add SPIRV_LLVM_Backend_jll to deps/compat and load it alongside the translator: GPUCompiler picks the tool from the target's backend field, so both coexist (LTS -> :khronos translator, rolling -> :llvm back-end). Verified that oneAPI still precompiles, both JLLs load, and kernels compile/run on the LTS stack (Backend JLL loaded but unused there). Addresses PR_REVIEW.md finding #2.
The refactor dropped supports_bfloat16 from the SPIRVCompilerTarget call on both branches of the oneL0.LTS[] check, so GPUCompiler defaulted it to false and validate_ir rejected any bfloat value with InvalidIRError even on a bf16-capable rolling-stack device (e.g. PVC) where main compiled and ran it. Restore the main behavior on the non-LTS branch: supports_bfloat16 = _device_supports_bfloat16(), declare SPV_KHR_bfloat16 when the runtime advertises it, and otherwise lower bfloat->i16 in finish_ir! (restored _driver_supports_bfloat16_spirv / lower_bfloat_to_i16! / eliminate_bf16_bitcasts!). Keep bf16 forced off on the LTS branch, where the SPIR-V stack cannot codegen native bfloat (the finish_ir! lowering is gated !oneL0.LTS[] so it stays inert there). Verified on the LTS stack: supports_bfloat16=false, the restored helpers run without error, kernels still compile and run. Addresses PR_REVIEW.md finding #3.
The regenerated sparse wrappers widened the ABI: onemklX sparse_set_{csr,csc,coo}
setters gained a 64-bit nnz argument and 64-bit dims, and new set_csc_data /
set_bsr_data entry points were added. These only match a liboneapi_support built
from the updated onemkl.cpp; the registry's oneAPI_Support_jll 0.9.2 binary
predates them, so a stock install (or CI, which does not run deps/build_local.jl)
calls a sparse setter against the old 8-arg C function — nnz lands in an index
slot, every pointer shifts, and MKL dereferences garbage (segfault / silent
corruption).
Probe the loaded support binary once at load for onemklSsparse_set_csc_data (a
symbol only the rebuilt binary exports) and, when it is absent, make the sparse
CSR/CSC/COO constructors raise an actionable error pointing at
deps/build_local.jl instead of crashing. Verified: probe returns true against a
locally rebuilt binary, construction works, and the guard throws the expected
message when the flag is cleared.
Addresses PR_REVIEW.md finding #1.
Setting ENV["LD_LIBRARY_PATH"] inside __init__ cannot affect the running
process's dlopen search paths: glibc captures LD_LIBRARY_PATH once at process
startup, so the stated purpose (letting libsycl's bundled ze_lib find NEO's
libze_intel_gpu in-process) was never served for the current process — only for
child processes that inherit the environment.
dlopen the NEO driver by full path in __init__ so it is resident before libsycl
loads; a later dlopen("libze_intel_gpu.so.1") by libsycl's bundled loader then
resolves to it by soname without a path search. Keep extending LD_LIBRARY_PATH
but correct the comment to say it only covers spawned worker processes. Verified
oneMKL (which loads libsycl and needs NEO discovery) still works.
Addresses PR_REVIEW.md finding #10.
rev = "atomic-float-ops" tracked a mutable branch head, so builds were not reproducible and a force-push to the fork would silently change what users resolve. Pin to commit 4257d40, whose lib/intrinsics subtree matches the currently resolved Manifest exactly (git-tree-sha1 87509a31), so this is a no-op today but freezes the input going forward. Addresses PR_REVIEW.md additional observation (mutable [sources] branch pin).
The coalesced-reduction launch used a hardcoded items = clamp(length(Rother), 1, 256), which can exceed the kernel's max work-group size on some devices and fail the launch. Query launch_configuration(kernel) for the actual limit, like the main partial_mapreduce_device path already does. Verified the coalesced path (dim-1-kept reductions) stays correct across a range of sizes, including large Rother. Addresses PR_REVIEW.md additional observation (hardcoded coalesced items).
…uctions Follow-up to the #7 resolution, addressing the adversarial-review caveats: the prior comment overstated coalescing for a small leading dim, and the empirical sweep left nothing committed and used Float32 (which can pass or fail for the wrong reason on large sums). Tighten the comment to the precise mechanism (the miscompile needs adjacent lanes a *full* stride apart on every lane; reducing dim 1 keeps a contiguous innermost axis, so lanes read stride-1 within each length-n1 run) and add an Int32 regression test covering dims=(1,3)/(1,4)/(1,2,3) plus the coalesced dims=2/3 cases. Int32 is exact and associative, so it is immune to the Float32 accumulation-order rounding that made a stress sweep of >2^24-length sums look corrupted when it was not; verified all cases match the CPU exactly, including small leading dims and large strided sizes. Refines PR_REVIEW.md finding #7.
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.