Skip to content

Remove all instances of Flamegraph #2869

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

Merged
merged 1 commit into from
May 14, 2024
Merged
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
34 changes: 3 additions & 31 deletions recipes_source/recipes/profiler_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
# 4. Using profiler to analyze memory consumption
# 5. Using tracing functionality
# 6. Examining stack traces
# 7. Visualizing data as a flame graph
# 8. Using profiler to analyze long-running jobs
# 7. Using profiler to analyze long-running jobs
#
# 1. Import all necessary libraries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -122,7 +121,7 @@
# aten::select 1.668ms 2.292ms 8.988us 255
# --------------------------------- ------------ ------------ ------------ ------------
# Self CPU time total: 57.549m
#
#

######################################################################
# Here we see that, as expected, most of the time is spent in convolution (and specifically in ``mkldnn_convolution``
Expand Down Expand Up @@ -327,35 +326,8 @@
#
# (Warning: stack tracing adds an extra profiling overhead.)


######################################################################
# 7. Visualizing data as a flame graph
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Execution time (``self_cpu_time_total`` and ``self_cuda_time_total`` metrics) and stack traces
# can also be visualized as a flame graph. To do this, first export the raw data using ``export_stacks`` (requires ``with_stack=True``):

prof.export_stacks("/tmp/profiler_stacks.txt", "self_cuda_time_total")

######################################################################
# We recommend using `Flamegraph tool <https://github.com/brendangregg/FlameGraph>`_ to generate an
# interactive ``.svg`` file:
#
# .. code-block:: sh
#
# git clone https://github.com/brendangregg/FlameGraph
# cd FlameGraph
# ./flamegraph.pl --title "CUDA time" --countname "us." /tmp/profiler_stacks.txt > perf_viz.svg
#

######################################################################
#
# .. image:: ../../_static/img/perf_viz.png
# :scale: 25 %


######################################################################
# 8. Using profiler to analyze long-running jobs
# 7. Using profiler to analyze long-running jobs
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# PyTorch profiler offers an additional API to handle long-running jobs
Expand Down
Loading