gdalle
October 23, 2024, 9:52am
1
When I run the profiling code from this example in VSCode with Julia 1.11, the flame graph is empty. With Julia 1.10 it displays the usual way.
function profile_test(n)
for i = 1:n
A = randn(100,100,20)
m = maximum(A)
Am = mapslices(sum, A; dims=2)
B = A[:,:,5]
Bsort = mapslices(sort, B; dims=1)
b = rand(100)
C = B.*b
end
end
# compilation
@profview profile_test(1)
# pure runtime
@profview profile_test(10)
Iβm not sure it is only a VSCode problem because I have observed similar behaviors with ProfileCanvas.jl and ProfileSVG.jl.
Yes I can also confirm its not working, with it always being empty on 1.11.
For me it works as normal on my Windows computer, but on Linux it seems to show something the very first time I call @profview , and is completely empty after that.
abulak
October 25, 2024, 3:07pm
4
what is worse is that for me even the profile information is empty (itβs not the issue with a particular visualization tool:
julia> @profile peakflops()
2.5633960272396997e11
julia> Profile.print()
Overhead β [+additional indent] Count File:Line; Function
=========================================================
β6708 @Base/task.jl:694; task_done_hook(t::Task)
β 6708 @Base/task.jl:1021; wait()
6707β 6708 @Base/task.jl:1012; poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
Total snapshots: 6708. Utilization: 0% across all threads and tasks. Use the `groupby` kwarg to break down by thread and/or task.
julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 Γ AMD Ryzen 7 7840U w/ Radeon 780M Graphics
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
Threads: 8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = 8
whereas
julia> @profile peakflops()
2.4386398606176114e11
julia> Profile.print()
Overhead β [+additional indent] Count File:Line; Function
=========================================================
β1937 @Base/Base.jl:608; (::Base.var"#1055#1056")()
β 1937 @Base/Base.jl:572; profile_printing_listener()
β 1937 @Base/asyncevent.jl:159; wait
β 1937 @Base/asyncevent.jl:142; _trywait(t::Base.AsyncCondition)
...... (lots of lines here)
β β β β 1233 β¦a/src/matmul.jl:113; *(A::Matrix{Float64}, B::Matrixβ¦
β β β β 18 @Base/array.jl:420; similar
β β β β β 18 @Base/boot.jl:487; Array
18β β β β β 18 @Base/boot.jl:479; Array
β β β β 1215 β¦a/src/matmul.jl:237; mul!
β β β β β 1215 β¦/src/matmul.jl:263; mul!
β β β β β 1215 β¦/src/matmul.jl:352; generic_matmatmul!
β β β β β 1215 β¦src/matmul.jl:605; gemm_wrapper!(C::Matrix{Floatβ¦
1215β β β β β 1215 β¦a/src/blas.jl:1524; gemm!(transA::Char, transB:β¦
3β β β β 3 β¦LinearAlgebra.jl:616; peakflops(n::Int64; eltype::Dataβ¦
β11622 @Base/task.jl:682; task_done_hook(t::Task)
β 11622 @Base/task.jl:1008; wait()
11622β 11622 @Base/task.jl:999; poptask(W::Base.IntrusiveLinkedListSynchronized{Tasβ¦
Total snapshots: 21307. Utilization: 36% across all threads and tasks. Use the `groupby` kwarg to break down by thread and/or task.
julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 Γ AMD Ryzen 7 7840U w/ Radeon 780M Graphics
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = 8
opened 03:08PM - 25 Oct 24 UTC
```julia
julia> @profile peakflops();
julia> Profile.print()
Overhead β [+additβ¦ ional indent] Count File:Line; Function
=========================================================
β6708 @Base/task.jl:694; task_done_hook(t::Task)
β 6708 @Base/task.jl:1021; wait()
6707β 6708 @Base/task.jl:1012; poptask(W::Base.IntrusiveLinkedListSynchronized{Task})
Total snapshots: 6708. Utilization: 0% across all threads and tasks. Use the `groupby` kwarg to break down by thread and/or task.
julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 Γ AMD Ryzen 7 7840U w/ Radeon 780M Graphics
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver4)
Threads: 8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = 8
```
whereas on julia-1.10.5:
```julia
julia> @profile peakflops();
julia> Profile.print()
Overhead β [+additional indent] Count File:Line; Function
=========================================================
β1937 @Base/Base.jl:608; (::Base.var"#1055#1056")()
β 1937 @Base/Base.jl:572; profile_printing_listener()
β 1937 @Base/asyncevent.jl:159; wait
β 1937 @Base/asyncevent.jl:142; _trywait(t::Base.AsyncCondition)
...... (lots of lines here)
β β β β 1233 β¦a/src/matmul.jl:113; *(A::Matrix{Float64}, B::Matrixβ¦
β β β β 18 @Base/array.jl:420; similar
β β β β β 18 @Base/boot.jl:487; Array
18β β β β β 18 @Base/boot.jl:479; Array
β β β β 1215 β¦a/src/matmul.jl:237; mul!
β β β β β 1215 β¦/src/matmul.jl:263; mul!
β β β β β 1215 β¦/src/matmul.jl:352; generic_matmatmul!
β β β β β 1215 β¦src/matmul.jl:605; gemm_wrapper!(C::Matrix{Floatβ¦
1215β β β β β 1215 β¦a/src/blas.jl:1524; gemm!(transA::Char, transB:β¦
3β β β β 3 β¦LinearAlgebra.jl:616; peakflops(n::Int64; eltype::Dataβ¦
β11622 @Base/task.jl:682; task_done_hook(t::Task)
β 11622 @Base/task.jl:1008; wait()
11622β 11622 @Base/task.jl:999; poptask(W::Base.IntrusiveLinkedListSynchronized{Tasβ¦
Total snapshots: 21307. Utilization: 36% across all threads and tasks. Use the `groupby` kwarg to break down by thread and/or task.
julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 Γ AMD Ryzen 7 7840U w/ Radeon 780M Graphics
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 8 default, 0 interactive, 4 GC (on 16 virtual cores)
Environment:
JULIA_NUM_THREADS = 8
```
gdalle
October 26, 2024, 8:45am
5
Judging by the discussion on GitHub, this only seems to happen when Julia is launched with multiple threads