Skip to content

Conversation

michel2323
Copy link
Member

No description provided.

Copy link
Contributor

github-actions bot commented Sep 17, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/lib/mkl/interfaces.jl b/lib/mkl/interfaces.jl
index 1ef1829..0558d8c 100644
--- a/lib/mkl/interfaces.jl
+++ b/lib/mkl/interfaces.jl
@@ -12,26 +12,26 @@ LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{
 LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, _add::MulAddMul) where {T <: Union{Float16, ComplexF16, BlasFloat}} =
     LinearAlgebra.generic_matmatmul!(C, tA, tB, A, B, _add.alpha, _add.beta)
 
-function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSR{T}, B::oneVector{T}, alpha::Number, beta::Number) where T <: BlasFloat
+function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSR{T}, B::oneVector{T}, alpha::Number, beta::Number) where {T <: BlasFloat}
     tA = tA in ('S', 's', 'H', 'h') ? 'N' : tA
-    sparse_gemv!(tA, alpha, A, B, beta, C)
+    return sparse_gemv!(tA, alpha, A, B, beta, C)
 end
 
-function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSC{T}, B::oneVector{T}, alpha::Number, beta::Number) where T <: BlasReal
+function LinearAlgebra.generic_matvecmul!(C::oneVector{T}, tA::AbstractChar, A::oneSparseMatrixCSC{T}, B::oneVector{T}, alpha::Number, beta::Number) where {T <: BlasReal}
     tA = tA in ('S', 's', 'H', 'h') ? 'T' : flip_trans(tA)
-    sparse_gemv!(tA, alpha, A, B, beta, C)
+    return sparse_gemv!(tA, alpha, A, B, beta, C)
 end
 
-function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where T <: BlasFloat
+function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSR{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where {T <: BlasFloat}
     tA = tA in ('S', 's', 'H', 'h') ? 'N' : tA
     tB = tB in ('S', 's', 'H', 'h') ? 'N' : tB
-    sparse_gemm!(tA, tB, alpha, A, B, beta, C)
+    return sparse_gemm!(tA, tB, alpha, A, B, beta, C)
 end
 
-function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where T <: BlasReal
+function LinearAlgebra.generic_matmatmul!(C::oneMatrix{T}, tA, tB, A::oneSparseMatrixCSC{T}, B::oneMatrix{T}, alpha::Number, beta::Number) where {T <: BlasReal}
     tA = tA in ('S', 's', 'H', 'h') ? 'T' : flip_trans(tA)
     tB = tB in ('S', 's', 'H', 'h') ? 'N' : tB
-    sparse_gemm!(tA, tB, alpha, A, B, beta, C)
+    return sparse_gemm!(tA, tB, alpha, A, B, beta, C)
 end
 
 function LinearAlgebra.generic_trimatdiv!(C::oneVector{T}, uploc, isunitc, tfun::Function, A::oneSparseMatrixCSR{T}, B::oneVector{T}) where T <: BlasFloat
diff --git a/lib/mkl/linalg.jl b/lib/mkl/linalg.jl
index 6aca07b..72c32a5 100644
--- a/lib/mkl/linalg.jl
+++ b/lib/mkl/linalg.jl
@@ -104,7 +104,7 @@ function LinearAlgebra.generic_matvecmul!(Y::oneVector, tA::AbstractChar, A::one
             end
         end
     end
-    LinearAlgebra.generic_matmatmul!(Y, tA, 'N', A, B, alpha, beta)
+    return LinearAlgebra.generic_matmatmul!(Y, tA, 'N', A, B, alpha, beta)
 end
 
 # triangular
@@ -126,7 +126,8 @@ if VERSION >= v"1.12-"
     for blas_flag in (LinearAlgebra.BlasFlag.SyrkHerkGemm, LinearAlgebra.BlasFlag.SymmHemmGeneric)
         @eval LinearAlgebra.generic_matmatmul_wrapper!(
             C::oneStridedMatrix, tA::AbstractChar, tB::AbstractChar, A::oneStridedVecOrMat, B::oneStridedVecOrMat,
-            alpha::Number, beta::Number, ::$blas_flag) =
+            alpha::Number, beta::Number, ::$blas_flag
+        ) =
             LinearAlgebra.generic_matmatmul!(C, tA, tB, A, B, alpha, beta)
     end
 end
diff --git a/src/compiler/reflection.jl b/src/compiler/reflection.jl
index 8539eef..ddc9eed 100644
--- a/src/compiler/reflection.jl
+++ b/src/compiler/reflection.jl
@@ -75,5 +75,5 @@ function return_type(@nospecialize(func), @nospecialize(tt))
     job = CompilerJob(source, config)
     interp = GPUCompiler.get_interpreter(job)
     sig = Base.signature_type(func, tt)
-    Core.Compiler._return_type(interp, sig)
+    return Core.Compiler._return_type(interp, sig)
 end
diff --git a/test/execution.jl b/test/execution.jl
index 596d0d8..1a7b654 100644
--- a/test/execution.jl
+++ b/test/execution.jl
@@ -307,12 +307,12 @@ end
     @oneapi kernel(arr)
     @test Array(arr)[] == 1
 
-    function kernel2(ptr)
+        function kernel2(ptr)
         ptr[] = 2
         return
     end
 
-    @oneapi kernel2(arr)
+        @oneapi kernel2(arr)
     @test Array(arr)[] == 2
 end
 

Copy link

codecov bot commented Sep 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.70%. Comparing base (3d3278d) to head (27fca08).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #529   +/-   ##
=======================================
  Coverage   79.70%   79.70%           
=======================================
  Files          45       45           
  Lines        2818     2818           
=======================================
  Hits         2246     2246           
  Misses        572      572           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@MagicMuscleMan MagicMuscleMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the one indent issue, this looks good to me.

I tested the change and it fixes the problem for me.

Thanks for creating and submitting the PR!

src/broadcast.jl Outdated
Comment on lines 15 to 17
Broadcast.BroadcastStyle(
::oneArrayStyle{N, B1},
::oneArrayStyle{N, B2}) where {N,B1,B2} =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both arguments should be indented identically or there should be no line break at all. I think 91 characters is still reasonable.

Suggested change
Broadcast.BroadcastStyle(
::oneArrayStyle{N, B1},
::oneArrayStyle{N, B2}) where {N,B1,B2} =
Broadcast.BroadcastStyle(::oneArrayStyle{N, B1}, ::oneArrayStyle{N, B2}) where {N,B1,B2} =

@michel2323
Copy link
Member Author

@maleadt Anything I can do here about? JuliaGPU/GPUCompiler.jl#101

<html>
<body>
<!--StartFragment-->
gpuarrays/math/intrinsics                     (3) \|     1.97 \|   0.00 \|  0.0 \|     153.90 \|  2049.44 \|
--
  | From worker 5:	InvalidBitWidth: Invalid bit width in input: 128
  | From worker 5:	InvalidBitWidth: Invalid bit width in input: 128
  | From worker 5:	InvalidBitWidth: Invalid bit width in input: 128
  | From worker 5:	InvalidBitWidth: Invalid bit width in input: 128
  | gpuarrays/statistics                          (5) \|         failed at 2025-09-19T14:03:47.020
  | TaskFailedException
  |  
  | nested task error: InterruptException:
  | Stacktrace:
  | [1] try_yieldto(undo::typeof(identity))
  | @ Base ./task.jl:1128
  | [2] throwto(t::Task, exc::Any)
  | @ Base ./task.jl:1145
  | [3] (::var"#58#59"{Dict{String, DateTime}, Task, var"#recycle_worker#recycle_worker##0"})()
  | @ Main /var/lib/buildkite-agent/builds/sagittarius-maleadt-net/julialang/oneapi-dot-jl/test/runtests.jl:263Testing finished in 4 minutes, 15 seconds, 68 milliseconds
  | Worker 5 failed running test gpuarrays/statistics:
  | Some tests did not pass: 48 passed, 0 failed, 4 errored, 0 broken.
  | gpuarrays/statistics: Error During Test at /root/.cache/julia-buildkite-plugin/depots/05c310bb-cd1d-4bbf-ad62-61f2372c55f0/packages/GPUArrays/ZRk7Q/test/testsuite/statistics.jl:54
  | Test threw exception
  | Expression: compare(cor, AT, rand(ET, s, 2), nans = true)
  | Failed to translate LLVM code to SPIR-V.
  | If you think this is a bug, please file an issue and attach /tmp/jl_lu9Ozc7qvM.bc.
  | Stacktrace:
  | [1] error(s::String)
  | @ Base ./error.jl:44
  | [2] mcgen(job::GPUCompiler.CompilerJob{GPUCompiler.SPIRVCompilerTarget, oneAPI.oneAPICompilerParams}, mod::LLVM.Module, format::LLVM.API.LLVMCodeGenFileType)
  | @ GPUCompiler ~/.cache/julia-buildkite-plugin/depots/05c310bb-cd1d-4bbf-ad62-61f2372c55f0/packages/GPUCompiler/Ecaql/src/spirv.jl:154
  | [3] macro expansion
  | @ ~/.cache/julia-buildkite-plugin/depots/05c310bb-cd1d-4bbf-ad62-61f2372c55f0/packages/Tracy/tYwAE/src/tracepoint.jl:163 [inlined]

<!--EndFragment-->
</body>
</html>

@maleadt
Copy link
Member

maleadt commented Sep 25, 2025

Normally we add a quirk to avoid widening to 128-bits integers.

@michel2323
Copy link
Member Author

Fixed by avoiding widemul in checkbounds

@michel2323 michel2323 changed the title Fix Julia 1.12 issues Support Julia 1.12 Oct 9, 2025
@michel2323 michel2323 force-pushed the julia1.12 branch 2 times, most recently from 8ec8249 to c2ad19b Compare October 10, 2025 13:40
@christiangnrd
Copy link
Member

@michel2323 JuliaGPU/OpenCL.jl#380 (and JuliaGPU/Metal.jl#576 and JuliaGPU/CUDA.jl#2917) has the fix for the current 1.12 error.

@michel2323
Copy link
Member Author

Oh thanks so much!

@PatrickHaecker
Copy link

With Julia 1.12 officially released, is there a reason not to merge this PR in its current state? It might not be perfect, but it probably is still better than "even the most simple case is not working at all". Follow-up PRs should still be possible.

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.

5 participants