Hi, I am using FlameGraphs.jl and ProfileView.jl to profile my code with matrix operations. I am fairly new to these profiling tools.
On MacOS M1 the matrix operations are not showing up in the flame graph. Here is a MWE:
using Profile, ProfileView, FlameGraphs
function do_blas_work(N, n1, n2)
A = rand(n1, n2)
b = rand(n2)
c = rand(n1)
for _ in 1:N
x = A * b .+ c
end
end
@profview do_blas_work(10, 10_000, 7000) # compile
@profview do_blas_work(10, 10_000, 7000) # compile again
ProfileView.closeall()
@profview do_blas_work(100, 10_000, 7000)
The result shows only the time spent on drawing the random samples:
How can I show the matrix operations as well?
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 10 Ă— Apple M1 Max
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 8 virtual cores
julia> using LinearAlgebra; BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries:
â”” [ILP64] libopenblas64_.dylib