Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend flamegraphs to show alloc diff #238

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,31 @@ steps:
command: "julia --color=yes --project=perf perf/flame.jl --run_name 2"
artifact_paths: "perf/output/perf_coarse_single_modular/*"
agents:

slurm_mem: 20GB

- label: ":rocket: flame graph and allocation tests: perf_target_amip_n32_shortrun"
command: "julia --color=yes --project=perf perf/flame.jl --run_name 3"
artifact_paths: "perf/output/perf_target_amip_n32_shortrun/*"
agents:
slurm_mem: 20GB

- label: ":rocket: performance: flame graph diff: perf_default_modular"
command: "julia --color=yes --project=perf perf/flame_diff.jl --run_name 1"
artifact_paths: "perf/output/perf_diff_default_modular/*"
agents:
slurm_mem: 20GB

- label: ":rocket: performance: flame graph diff: perf_coarse_single_modular"
command: "julia --color=yes --project=perf perf/flame_diff.jl --run_name 2"
artifact_paths: "perf/output/perf_diff_coarse_single_modular/*"
agents:
slurm_mem: 20GB

- label: ":rocket: performance: flame graph diff: perf_target_amip_n32_shortrun"
command: "julia --color=yes --project=perf perf/flame_diff.jl --run_name 3"
artifact_paths: "perf/output/perf_diff_target_amip_n32_shortrun/*"
agents:
slurm_mem: 20GB

- wait

Expand All @@ -208,4 +226,5 @@ steps:
command:
- build_history staging # name of branch to plot
artifact_paths:
- "build_history.html"
- "build_history.html"

3 changes: 2 additions & 1 deletion docs/src/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

## Flame Graph Interpretation
- use for single-process (un)threaded performance CPU profiling of individual stack traces. It provides a tree representation of a set of backtraces, showing the dependence and CPU cost of each function.
- here is an example of a flame graph of ClimaCoupler's AMIP run:
- here is an example of a flame graph of ClimaCoupler's AMIP run, produced by Buildkite running the `perf/flame.jl` script:

![canvas](images/canvas_coupler.png)

- each row along the y-axis represents a level of backtraces. In this case the lowermost level is at the top, and the top level represents what is directly being run on the CPU. The stacks in each level are sorted alphabetically (not chronologically, like flame _charts_). The column width is proportional to the presence in samples (related to allocations). The colors are grouped into runtime-dispatch, gc, compilation and default. The intensity is random.
- we also have a local beta version of flame graphs (in `perf/ProfileCanvasDiff.jl` and `perf/ProfileViewerDiff.js`), triggered by the `perf/flame_diff.jl` script, which plots the same flame graphs as above but with the color corresponding to whether the stack allocation has been reduced (blue) or increased (red) compared to the last staged runs. The color intensity is proportional to the fractional change, and black signifies untracked traces.

## References
- [Description of flame graphs and their interpretation](https://github.com/CliMA/slurm-buildkite/wiki/Flame-Graphs)
Expand Down
Loading