Skip to content

AppleAccelerate.jl severely decreases the performance of SVD #71

@ronisbr

Description

@ronisbr

Hi!

I noticed that after loading AppleAccelerate.jl, the SVD performance is severely decreased:

julia> using BenchmarkTools, LinearAlgebra

julia> A = rand(5, 5)
5×5 Matrix{Float64}:
 0.210478  0.485058    0.893071  0.0038541  0.242167
 0.618708  0.880626    0.35424   0.572958   0.721676
 0.539943  0.00980111  0.232398  0.220709   0.196985
 0.19735   0.441403    0.696092  0.527777   0.342491
 0.658019  0.397196    0.212173  0.518869   0.521641

julia> @btime svd($A)
  2.958 μs (7 allocations: 4.05 KiB)
SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}
U factor:
5×5 Matrix{Float64}:
 -0.379855  -0.756404   0.155695    0.472175    0.190718
 -0.633198   0.298961  -0.517143    0.298206   -0.39156
 -0.233213   0.192713   0.808918    0.056695   -0.500909
 -0.439546  -0.33197   -0.0529993  -0.826642   -0.102225
 -0.455171   0.437188   0.226196   -0.0396693   0.74091
singular values:
5-element Vector{Float64}:
 2.2379393452621
 0.8199698332648618
 0.4548207142220164
 0.32431597799931705
 0.019407475774695128
Vt factor:
5×5 Matrix{Float64}:
 -0.439643  -0.499995   -0.455901   -0.394957   -0.439184
  0.42926   -0.0910059  -0.808755    0.320191    0.225492
  0.633132  -0.671715    0.340672   -0.0610589  -0.1678
  0.386216   0.343976   -0.133626   -0.83768     0.113812
 -0.269129  -0.414974    0.0644648  -0.189869    0.845671

julia> using AppleAccelerate

julia> @btime svd($A)
  5.639 μs (7 allocations: 4.05 KiB)
SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}
U factor:
5×5 Matrix{Float64}:
 -0.379855  -0.756404   0.155695    0.472175    0.190718
 -0.633198   0.298961  -0.517143    0.298206   -0.39156
 -0.233213   0.192713   0.808918    0.056695   -0.500909
 -0.439546  -0.33197   -0.0529993  -0.826642   -0.102225
 -0.455171   0.437188   0.226196   -0.0396693   0.74091
singular values:
5-element Vector{Float64}:
 2.2379393452620997
 0.8199698332648626
 0.45482071422201675
 0.32431597799931694
 0.01940747577469517
Vt factor:
5×5 Matrix{Float64}:
 -0.439643  -0.499995   -0.455901   -0.394957   -0.439184
  0.42926   -0.0910059  -0.808755    0.320191    0.225492
  0.633132  -0.671715    0.340672   -0.0610589  -0.1678
  0.386216   0.343976   -0.133626   -0.83768     0.113812
 -0.269129  -0.414974    0.0644648  -0.189869    0.845671

System information:

  • M1 Ultra.
  • macOS 14.5.
  • Julia 1.10.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions