Hi all, I have quite a heavyweight function call which hangs fairly non-deterministically (the function is a Monte Carlo Tree Search). I've tried determining the problem with tools like Profile, but they seem to depend on the function terminating. I'm hesitant to pull out the debugger for this kind of code with a very deep call stack - is there a tool, julia or otherwise, which could help me find where it's spending all it's time?
Maybe this helps:
A fixed duration cpu profile can now be triggered by the user during running tasks without Profile being loaded first and the report will show during execution. On MacOS & FreeBSD press ctrl-t or raise a SIGINFO. For other platforms raise a SIGUSR1 i.e. % kill -USR1 $julia_pid. Not currently available on windows (#43179).
(from the v1.8 release notes)
if you know that it's hanging, you can spam CTRL+C to force-throw an interrupt, which should print a stacktrace
profiling-by-stacktrace works, because statistically speaking you're going to hit the hottest code most of the time
Interesting. Does Julia employ a statistical or deterministic cpu profiler?
the builtin is statistical
if you want CPU statistics, you'd need something like LIKWID.jl or MCAnalyzer.jl, if you want to go the simulation route
I was curious because the language I'm used to has both builtin. The latter (edit) is not very "modern" but is used to profile a selection of functions, with instrumentation, rather than taking samples of everything.
Felix Kastner said:
Maybe this helps:
A fixed duration cpu profile can now be triggered by the user during running tasks without Profile being loaded first and the report will show during execution. On MacOS & FreeBSD press ctrl-t or raise a SIGINFO. For other platforms raise a SIGUSR1 i.e. % kill -USR1 $julia_pid. Not currently available on windows (#43179).
(from the v1.8 release notes)
That's a really cool feature, thanks for bringing that to my attention!
Laura Demkowicz-Duffy has marked this topic as resolved.
Last updated: Nov 06 2024 at 04:40 UTC