Repository navigation
Support norm for Diagonal - #2860
Merged
Merged
Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. 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) |
amontoison
approved these changes
Aug 27, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
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.
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.