Skip to content

Commit

Permalink
[Profiler] Bug fixes (#2309)
Browse files Browse the repository at this point in the history
This PR contains refactoring and bug fixes for `create-visuals.py`, and
an updated README with instructions for using the profiler. More
specifically, `create-visuals.py` used to not account for "cells" as
distinct elements of the stack (so, the flame graph would not reflect it
when a non-main cell was taking extra cycles between groups), but this
PR fixes that issue.
  • Loading branch information
ayakayorihiro authored Oct 21, 2024
1 parent 22fc4bb commit d110eae
Show file tree
Hide file tree
Showing 4 changed files with 318 additions and 190 deletions.
20 changes: 18 additions & 2 deletions tools/profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,23 @@ This directory contains scripts for a first pass at profiling cycle counts in Ca

### Usage

- To run the profiling pipeline, you can run `get-profile-counts-info.sh` providing the Calyx file and the Memory data. ex) From the Calyx root directory
To run the profiling pipeline, you can run `get-profile-counts-info.sh` providing the Calyx file and the Memory data. ex) From the Calyx root directory
```
bash tools/vcd-parsing/get-profile-counts-info.sh examples/tutorial/language-tutorial-compute.futil examples/tutorial/data.json
bash tools/profiler/get-profile-counts-info.sh examples/tutorial/language-tutorial-compute.futil examples/tutorial/data.json
```

The script will create a directory `<CALYX>/tools/profiler/data/<CALYX_FILE_SHORTNAME>` where `<CALYX_FILE_SHORTNAME>` is the part of your `.futil` file before the `.futil` (ex. the shortname for `language-tutorial-compute.futil` would be `language-tutorial-compute`.) This directory contains two subdirectories:

- `generated-data`: Contains profiler results, flame graphs, and intermediate data
- `logs`: Contains log files from each profiling step

Some important files to check out in `generated-data`:

- `flame.svg`: The cycle counts flame graph. Can be zoomed in when viewed using a web browser
- `summary.csv`: Contains a text view of the profiled information.
- `timeline.json`: When viewed with [Perfetto UI](https://ui.perfetto.dev/), shows a timeline view (x axis is time, where 100ns is equivalent to one cycle)

Some additional flame graphs worth taking a look at:

- `components-flame.svg`: A cycle count flame graph that aggregates cycles across all groups in a component.
- `frequency-flame.svg`: [Currently under maintenance] A flame graph that displays the number of times a group was _active_.
Loading

0 comments on commit d110eae

Please sign in to comment.