Skip to content

Support norm for Diagonal - #2860

Merged
kshyatt merged 2 commits into
masterfrom
ksh/diag_norm
Aug 28, 2025
Merged

kshyatt merged 2 commits into
masterfrom
ksh/diag_norm

Conversation

@kshyatt

@kshyatt kshyatt commented Aug 27, 2025

Copy link
Copy Markdown
Member

No description provided.

@kshyatt
kshyatt requested a review from amontoison August 27, 2025 14:52
@kshyatt kshyatt added cuda array Stuff about CuArray. cuda libraries Stuff about CUDA library wrappers. labels Aug 27, 2025
@github-actions

github-actions Bot commented Aug 27, 2025 •

Copy link
Copy Markdown
Contributor

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/cublas/linalg.jl b/lib/cublas/linalg.jl
index 8ab9670a1..de9ca5a19 100644
--- a/lib/cublas/linalg.jl
+++ b/lib/cublas/linalg.jl
@@ -121,7 +121,7 @@ function LinearAlgebra.norm(x::DenseCuArray{<:Union{Float16, ComplexF16, CublasF
         return invoke(norm, Tuple{AbstractGPUArray, Real}, x, p)
     end
 end
-LinearAlgebra.norm(x::Diagonal{T, <:StridedCuVector{T}}, p::Real=2) where {T<:Union{Float16, ComplexF16, CublasFloat}} = norm(x.diag, p)
+LinearAlgebra.norm(x::Diagonal{T, <:StridedCuVector{T}}, p::Real = 2) where {T <: Union{Float16, ComplexF16, CublasFloat}} = norm(x.diag, p)
 LinearAlgebra.norm2(x::DenseCuArray{<:Union{Float16, ComplexF16, CublasFloat}}) = nrm2(x)
 
 LinearAlgebra.BLAS.asum(x::StridedCuArray{<:CublasFloat}) = asum(length(x), x)

@kshyatt
kshyatt enabled auto-merge (squash) August 28, 2025 17:09
@kshyatt
kshyatt merged commit 8ff92f9 into master Aug 28, 2025
3 checks passed
@kshyatt
kshyatt deleted the ksh/diag_norm branch August 28, 2025 20:42
@codecov

codecov Bot commented Aug 28, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (3da87de) to head (0479f19).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2860      +/-   ##
==========================================
- Coverage   89.77%   89.62%   -0.16%     
==========================================
  Files         150      150              
  Lines       13249    13250       +1     
==========================================
- Hits        11894    11875      -19     
- Misses       1355     1375      +20     

☔ 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CUDA.jl Benchmarks

Details
Benchmark suite Current: 0479f19 Previous: 3da87de Ratio
latency/precompile 43115418381 ns 43091148296.5 ns 1.00
latency/ttfp 7012699873 ns 7011527319 ns 1.00
latency/import 3552835755 ns 3576055301 ns 0.99
integration/volumerhs 9627355 ns 9615926 ns 1.00
integration/byval/slices=1 146856 ns 147316 ns 1.00
integration/byval/slices=3 425893 ns 426264 ns 1.00
integration/byval/reference 145084 ns 145134 ns 1.00
integration/byval/slices=2 286617 ns 286886 ns 1.00
integration/cudadevrt 103525.5 ns 103713 ns 1.00
kernel/indexing 14313 ns 14307 ns 1.00
kernel/indexing_checked 14929 ns 15001 ns 1.00
kernel/occupancy 673.4649681528663 ns 668.811320754717 ns 1.01
kernel/launch 2192.6666666666665 ns 2183.1111111111113 ns 1.00
kernel/rand 14693 ns 17872 ns 0.82
array/reverse/1d 20009 ns 20122 ns 0.99
array/reverse/2d 24618 ns 25216 ns 0.98
array/reverse/1d_inplace 10447 ns 10612 ns 0.98
array/reverse/2d_inplace 11895 ns 12142 ns 0.98
array/copy 21104 ns 20890 ns 1.01
array/iteration/findall/int 158416 ns 157549.5 ns 1.01
array/iteration/findall/bool 140158 ns 140008 ns 1.00
array/iteration/findfirst/int 163128 ns 161714.5 ns 1.01
array/iteration/findfirst/bool 164591 ns 158865 ns 1.04
array/iteration/scalar 73785 ns 70461 ns 1.05
array/iteration/logical 217037 ns 215555 ns 1.01
array/iteration/findmin/1d 47142 ns 46851 ns 1.01
array/iteration/findmin/2d 97085 ns 96656 ns 1.00
array/reductions/reduce/Int64/1d 43124.5 ns 43153 ns 1.00
array/reductions/reduce/Int64/dims=1 47359 ns 50998.5 ns 0.93
array/reductions/reduce/Int64/dims=2 62571 ns 61632.5 ns 1.02
array/reductions/reduce/Int64/dims=1L 89134 ns 89235.5 ns 1.00
array/reductions/reduce/Int64/dims=2L 88047 ns 87152.5 ns 1.01
array/reductions/reduce/Float32/1d 35577 ns 34743 ns 1.02
array/reductions/reduce/Float32/dims=1 52178 ns 42152.5 ns 1.24
array/reductions/reduce/Float32/dims=2 59840 ns 59901 ns 1.00
array/reductions/reduce/Float32/dims=1L 52403 ns 52601 ns 1.00
array/reductions/reduce/Float32/dims=2L 70523.5 ns 70469 ns 1.00
array/reductions/mapreduce/Int64/1d 43530 ns 42220.5 ns 1.03
array/reductions/mapreduce/Int64/dims=1 55572 ns 47475.5 ns 1.17
array/reductions/mapreduce/Int64/dims=2 62620 ns 61905 ns 1.01
array/reductions/mapreduce/Int64/dims=1L 89092.5 ns 89183 ns 1.00
array/reductions/mapreduce/Int64/dims=2L 87357 ns 87008.5 ns 1.00
array/reductions/mapreduce/Float32/1d 35077 ns 34867 ns 1.01
array/reductions/mapreduce/Float32/dims=1 41967 ns 44301 ns 0.95
array/reductions/mapreduce/Float32/dims=2 60364 ns 60109 ns 1.00
array/reductions/mapreduce/Float32/dims=1L 52683 ns 52926 ns 1.00
array/reductions/mapreduce/Float32/dims=2L 70674 ns 70774 ns 1.00
array/broadcast 20174 ns 20143 ns 1.00
array/copyto!/gpu_to_gpu 12808 ns 11225 ns 1.14
array/copyto!/cpu_to_gpu 218810 ns 217050 ns 1.01
array/copyto!/gpu_to_cpu 285490 ns 284382 ns 1.00
array/accumulate/Int64/1d 125173 ns 124833 ns 1.00
array/accumulate/Int64/dims=1 83969 ns 83599 ns 1.00
array/accumulate/Int64/dims=2 158389 ns 158301 ns 1.00
array/accumulate/Int64/dims=1L 1709772 ns 1720861 ns 0.99
array/accumulate/Int64/dims=2L 966803 ns 968047 ns 1.00
array/accumulate/Float32/1d 109630 ns 109266 ns 1.00
array/accumulate/Float32/dims=1 81289 ns 80566 ns 1.01
array/accumulate/Float32/dims=2 148717 ns 148022 ns 1.00
array/accumulate/Float32/dims=1L 1619167 ns 1618691 ns 1.00
array/accumulate/Float32/dims=2L 699103 ns 701771 ns 1.00
array/construct 1297.2 ns 1218.2 ns 1.06
array/random/randn/Float32 45133 ns 44659 ns 1.01
array/random/randn!/Float32 24981 ns 25047 ns 1.00
array/random/rand!/Int64 27605 ns 27447 ns 1.01
array/random/rand!/Float32 8796.666666666666 ns 8705 ns 1.01
array/random/rand/Int64 30031 ns 38105 ns 0.79
array/random/rand/Float32 13393 ns 13236 ns 1.01
array/permutedims/4d 60613 ns 60763.5 ns 1.00
array/permutedims/2d 54395 ns 54489 ns 1.00
array/permutedims/3d 55530 ns 55278 ns 1.00
array/sorting/1d 2758253 ns 2757119 ns 1.00
array/sorting/by 3345319.5 ns 3355098.5 ns 1.00
array/sorting/2d 1081276 ns 1084658 ns 1.00
cuda/synchronization/stream/auto 1049.7 ns 1012.4166666666666 ns 1.04
cuda/synchronization/stream/nonblocking 7811.9 ns 7297.700000000001 ns 1.07
cuda/synchronization/stream/blocking 802.5869565217391 ns 809.6836734693877 ns 0.99
cuda/synchronization/context/auto 1168.8 ns 1166 ns 1.00
cuda/synchronization/context/nonblocking 9161.3 ns 7817.700000000001 ns 1.17
cuda/synchronization/context/blocking 897.4629629629629 ns 915.4561403508771 ns 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda array Stuff about CuArray. cuda libraries Stuff about CUDA library wrappers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants