FUTHARK-PROFILE(1)
π FUTHARK-PROFILE β ok so bestie, this is the manual β¨
Welcome to FUTHARK-PROFILE(1), a page from the Futhark manual. Pull up a chair, grab a boba, and let's profile some Futhark programs together π
πΈ NAME πΈ
futhark-profile β profile Futhark programs π«Ά
β¨ SYNOPSIS β¨
futhark profile JSONFILES
π DESCRIPTION π
Okay so real talk: this tool makes human-readable profiling information based on info that was collected with futhark bench <#futhark-bench-1>. That's it, that's the job πββοΈ
Futhark has basic support for profiling. The system can collect info about the runtime behaviour of your program and connect it back to the program source code as best it's able to (bless it, it's trying).
It works best for the GPU backends, and likeβ¦ not at all for the sequential backends π. Once you've got that collected info, you can use it to estimate where your inefficiencies are coming from. Detective mode πβ¨
π USAGE π
Step one, bestie: run futhark bench <#futhark-bench-1> on your program while passing --profile and --json. This gives you a JSON file with runtime measurements plus the collected profiling information, slay π
If you neglect to pass --profile, the profiling information will just be missing. Not a vibe, not a warning, just gone. So don't forget it π
The info in that JSON file is complete, sure, but it's really hard for humans to read β it's giving raw unhinged data dump fr fr.
Step two: run futhark profile on that JSON file. For a JSON file called prog.json, this creates a top level directory called prog.prof that contains files with human-readable profiling info. One set of files gets created for each benchmark dataset πβ¨
Now β if the original futhark bench invocation included multiple programs, then futhark profile will create subdirectories for each program (although all inside the same top level directory). Cute little family tree π§
You can also pass multiple JSON files to futhark profile. Each one will produce a distinct top level directory. No merge, no chaos, just separate vibes.
π Files produced
Let's say you've got a dataset called foo. futhark profile will produce the following files in the top level directory:
foo.logβ the running log produced during execution. Contains many details on dynamic behaviour, depending on the exact backend.foo.summaryβ a summary of memory usage and cost centres. For the GPU backends, the cost centres are kernel executions and memory copies.foo.timelineβ a list of all recorded profiling events, in the order in which they occurred, along with their runtime and other available information, most importantly the source locations π
The log file is often too verbose to be useful (it's giving novel), but the summary and timeline should be inspected β even if the latter is sometimes fairly large. Read your timeline bestie, it loves you π
π¦ Technicalities
The profiling information, including the log, is collected from a final run performed after all the measured runs. Profiling information is not collected during the runs that contribute to the runtime measurement reported by futhark bench.
However! Enabling profiling may still affect performance, as it changes the behaviour of the run time system. So likeβ¦ keep that in mind π
π Raw reports
Alternatively, the JSON file passed to futhark profile may also be a raw profiling report</> as produced by the C API function futhark_context_report().
A directory is still created, but it will only contain a single set of files, and it will not contain a log. Shorter, simpler, still valid π«Ά
π₯ EXAMPLES π₯
This shows the sequence of commands one might use to profile the program LocVolCalib.fut, which has three datasets associated with it, using the hip backend:
$ futhark bench --backend=hip --profile --json result.json LocVolCalib.fut
$ futhark profile result.json
$ tree result.prof/
result.prof/
βββ LocVolCalib-data_large.in.log
βββ LocVolCalib-data_large.in.summary
βββ LocVolCalib-data_medium.in.log
βββ LocVolCalib-data_medium.in.summary
βββ LocVolCalib-data_small.in.log
βββ LocVolCalib-data_small.in.summary
Look at that tree. Iconic. No .timeline files in this particular example, before you ask β we just list what's there πβ¨
π BUGS π
- Only the C-based backends currently support profiling.
- The
cbackend does not actually record useful profiling information. Not me exposing it π
π SEE ALSO π
futhark-bench <#futhark-bench-1>
π Copyright
2013-2020, DIKU, University of Copenhagen
Ok that's the whole page bestie, you ate it π
β¨ This was version 0.25.32 from Mar 11, 2026, of the Futhark manual β go profile something and slay π«Άπππβπ
π¦ where this page comes from
- ubuntu resolute: futhark 0.25.32-3build1 Β· ISC
- ubuntu stonking: futhark 0.25.32-3build1 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms