carm-paraver 1.0.0.dev0__tar.gz → 1.0.1.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. carm_paraver-1.0.1.dev0/PKG-INFO +170 -0
  2. carm_paraver-1.0.1.dev0/README.md +153 -0
  3. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/GUI_utils.py +24 -2
  4. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/Paraver_CARM.py +360 -110
  5. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/style.css +13 -18
  6. carm_paraver-1.0.1.dev0/carm_paraver.egg-info/PKG-INFO +170 -0
  7. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver.egg-info/SOURCES.txt +1 -3
  8. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver.egg-info/requires.txt +1 -0
  9. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver.egg-info/top_level.txt +1 -0
  10. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/pyproject.toml +3 -2
  11. carm_paraver-1.0.0.dev0/PKG-INFO +0 -140
  12. carm_paraver-1.0.0.dev0/README.md +0 -124
  13. carm_paraver-1.0.0.dev0/carm_paraver/paraver_carm_configs/IntelV2/__init__.py +0 -0
  14. carm_paraver-1.0.0.dev0/carm_paraver/paraver_carm_configs/__init__.py +0 -0
  15. carm_paraver-1.0.0.dev0/carm_paraver.egg-info/PKG-INFO +0 -140
  16. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/LICENSE +0 -0
  17. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/__init__.py +0 -0
  18. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/__main__.py +0 -0
  19. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/analysis_helpers.py +0 -0
  20. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/CARM_icon3.svg +0 -0
  21. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/CHAMP_logo.svg +0 -0
  22. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/__init__.py +0 -0
  23. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/bsc.svg +0 -0
  24. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/carm_bsc.png +0 -0
  25. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/carm_bsc.svg +0 -0
  26. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/assets/menu_icon.png +0 -0
  27. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_AVX2_DP.cfg +0 -0
  28. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_AVX2_SP.cfg +0 -0
  29. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_AVX512_DP.cfg +0 -0
  30. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_AVX512_SP.cfg +0 -0
  31. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_SSE_DP.cfg +0 -0
  32. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_SSE_SP.cfg +0 -0
  33. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_Scalar_DP.cfg +0 -0
  34. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_FP_Scalar_SP.cfg +0 -0
  35. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_Loads.cfg +0 -0
  36. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel/Intel_Stores.cfg +0 -0
  37. {carm_paraver-1.0.0.dev0/carm_paraver/carm_results → carm_paraver-1.0.1.dev0/carm_paraver/paraver_carm_configs/Intel}/__init__.py +0 -0
  38. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_AVX2_DP.cfg +0 -0
  39. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_AVX2_SP.cfg +0 -0
  40. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_AVX512_DP.cfg +0 -0
  41. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_AVX512_SP.cfg +0 -0
  42. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_SSE_DP.cfg +0 -0
  43. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_SSE_SP.cfg +0 -0
  44. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_Scalar_DP.cfg +0 -0
  45. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_FP_Scalar_SP.cfg +0 -0
  46. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_Loads.cfg +0 -0
  47. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/IntelV2/Intel_Stores.cfg +0 -0
  48. {carm_paraver-1.0.0.dev0/carm_paraver/carm_results/roofline → carm_paraver-1.0.1.dev0/carm_paraver/paraver_carm_configs/IntelV2}/__init__.py +0 -0
  49. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel_CARM_DP.cfg +0 -0
  50. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel_CARM_DPV2.cfg +0 -0
  51. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel_CARM_DP_Extrae.xml +0 -0
  52. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel_CARM_SPV2.cfg +0 -0
  53. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver/paraver_carm_configs/Intel_CARM_SP_Extrae.xml +0 -0
  54. {carm_paraver-1.0.0.dev0/carm_paraver/paraver_carm_configs/Intel → carm_paraver-1.0.1.dev0/carm_paraver/paraver_carm_configs}/__init__.py +0 -0
  55. {carm_paraver-1.0.0.dev0/carm_paraver/carm_results → carm_paraver-1.0.1.dev0/carm_paraver/sample_data}/roofline/MN5_roofline.csv +0 -0
  56. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver.egg-info/dependency_links.txt +0 -0
  57. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/carm_paraver.egg-info/entry_points.txt +0 -0
  58. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/setup.cfg +0 -0
  59. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/tests/test_analysis_helpers.py +0 -0
  60. {carm_paraver-1.0.0.dev0 → carm_paraver-1.0.1.dev0}/tools/aggregate_profiles.py +0 -0
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.4
2
+ Name: carm-paraver
3
+ Version: 1.0.1.dev0
4
+ Summary: Dash-based CARM analysis for Paraver traces
5
+ Author: CARM Contributors
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: dash>=4.1.0
10
+ Requires-Dist: dash-bootstrap-components>=2.0.4
11
+ Requires-Dist: dash-daq>=0.6.0
12
+ Requires-Dist: numpy>=2.0.0
13
+ Requires-Dist: pandas>=2.3.3
14
+ Requires-Dist: platformdirs>=4.2.2
15
+ Requires-Dist: plotly>=6.0.0
16
+ Dynamic: license-file
17
+
18
+ # CARM-Paraver GUI
19
+
20
+ This GUI allows the analysis of [Paraver](https://tools.bsc.es/paraver) traces on the Cache-Aware Roofline Model (CARM) for floating-point operations. It can be launched from the Paraver interface and send labeled events back to Paraver for visualization.
21
+
22
+ The CARM allows for roofline analysis of your application, displaying its computational bursts as points on the roofline. This can be used to identify bottlenecks and optimization opportunities for the respective code section. Points on the memory-bound or the compute-bound sections of the roof benefit from different optimization strategies, and the distance of your points to the roofline can be used to identify how much performance can be gained by optimizing your code.
23
+
24
+ # Requirements
25
+ - Python (tested with 3.9.25, 3.10.12, 3.12.3)
26
+ - [Paraver, Extrae](https://tools.bsc.es/downloads)
27
+
28
+ # How to use
29
+
30
+ ## Installation
31
+ **The recommended way to install the package** is via `pip`:
32
+ ```bash
33
+ pip install carm-paraver
34
+ ```
35
+ Alternatively, you can install it from source by cloning this repository and running:
36
+ ```bash
37
+ pip install .
38
+ ```
39
+ If the install fails due to dependency conflicts, you can use a Python virtual environment to install the package and its dependencies in an isolated environment. To do this, you can run:
40
+ ```bash
41
+ python -m venv .venv
42
+ source .venv/bin/activate
43
+ pip install carm-paraver
44
+ ```
45
+ If you install in a virtual environment, make sure to run Paraver from the same environment:
46
+ ```bash
47
+ source .venv/bin/activate
48
+ wxparaver
49
+ ```
50
+
51
+ ## First-time Setup
52
+ CARM-Paraver needs `paramedir` to be in your PATH in order to run. To add it, add Paraver's bin directory to your PATH. You can make this permanent by appending it to your `.bashrc` or `.bash_profile` (change the path accordingly):
53
+
54
+ ```bash
55
+ export PATH=/path/to/paraver/bin:$PATH
56
+ ```
57
+
58
+ ## Running
59
+ The GUI is launched via the Paraver interface like so:
60
+ 1. Use [Extrae](https://github.com/bsc-performance-tools/extrae) to generate a trace with the required counters ([see how to configure Extrae below](#paraver-trace-requirements)).
61
+ 2. Load the trace in Paraver, and zoom into a section of interest.
62
+ 3. Right click the timeline and select the option to launch the CARM GUI.
63
+ 4. Configure the options in Paraver to your liking (see [Launch Configuration](#launch-configuration)), and click "Run".
64
+ 5. Click the link printed in the Paraver console to open the GUI in your browser.
65
+
66
+ You will now have the CARM GUI open, showing the architecture's roofline, and the events from the Paraver trace represented as points on the plot. Their position on the roofline, which is determined by their performance and arithmetic intensity, can be used to identify bottlenecks and optimization opportunities for the respective code section. Check the [CARM GUI Features](#carm-gui-features) section for more details about the GUI, and how you can label events and send them back to Paraver for visualization.
67
+
68
+ If you get any errors, be sure to consult the [First-time Setup](#first-time-setup) and [Paraver Trace Requirements](#paraver-trace-requirements) sections.
69
+
70
+ ## Paraver Trace Requirements
71
+
72
+ To enable CARM analysis, your Paraver trace needs to include information on the floating-point and memory operations performed by the application. To do this, [configure Extrae](https://tools.bsc.es/doc/html/extrae/xml.html#xml-section-performance-counters) to include the counters in the tables below.
73
+
74
+ #### Which counters to include?
75
+ Include only the necessary counters for your analysis, so they fit in a single counter set. If too many counters are active, accuracy may be reduced.
76
+
77
+ Take the application examples below. For each case, the tables below indicate which counters you should include in your Extrae configuration:
78
+ - **App 1**: The application only uses double precision, but you don't know which vector ISAs it uses.
79
+ - **App 2**: The application is vectorized with AVX2, using both precisions.
80
+
81
+ If you are unsure, include all counters and prune them later as you learn more about the application. Using separate load and store counters is recommended, as it allows for a more detailed analysis.
82
+
83
+ #### Intel CPUs
84
+ | FP/Mem Operation | Intel Counter | App 1 | App 2 |
85
+ | ---------------- | ------------------------------------------ | ------- | ------- |
86
+ | Scalar DP Insts | `FP_ARITH_INST_RETIRED:SCALAR_DOUBLE` | ✓ | ✓ |
87
+ | Scalar SP Insts | `FP_ARITH_INST_RETIRED:SCALAR_SINGLE` | | ✓ |
88
+ | SSE DP Insts | `FP_ARITH_INST_RETIRED:128B_PACKED_DOUBLE` | ✓ | |
89
+ | SSE SP Insts | `FP_ARITH_INST_RETIRED:128B_PACKED_SINGLE` | | |
90
+ | AVX2 DP Insts | `FP_ARITH_INST_RETIRED:256B_PACKED_DOUBLE` | ✓ | ✓ |
91
+ | AVX2 SP Insts | `FP_ARITH_INST_RETIRED:256B_PACKED_SINGLE` | | ✓ |
92
+ | AVX512 DP Insts | `FP_ARITH_INST_RETIRED:512B_PACKED_DOUBLE` | ✓ | |
93
+ | AVX512 SP Insts | `FP_ARITH_INST_RETIRED:512B_PACKED_SINGLE` | | |
94
+ | Loads | `MEM_INST_RETIRED:ALL_LOADS` | ✓ | ✓ |
95
+ | Stores | `MEM_INST_RETIRED:ALL_STORES` | ✓ | ✓ |
96
+ | Loads and Stores | `MEM_INST_RETIRED:ALL` | | |
97
+
98
+ #### AMD CPUs
99
+ | FP/Mem Operation | AMD Counter | App 1 | App 2 |
100
+ | ---------------- | ---------------------------------------------- | ------- | ------- |
101
+ | Mul/Add DP Flops | `retired_sse_avx_operations:dp_mult_add_flops` | ✓ | ✓ |
102
+ | Mul/Add SP Flops | `retired_sse_avx_operations:sp_mult_add_flops` | | ✓ |
103
+ | Add/Sub DP Flops | `retired_sse_avx_operations:dp_add_sub_flops` | ✓ | ✓ |
104
+ | Add/Sub SP Flops | `retired_sse_avx_operations:sp_add_sub_flops` | | ✓ |
105
+ | Mul DP Flops | `retired_sse_avx_operations:dp_mult_flops` | ✓ | ✓ |
106
+ | Mul SP Flops | `retired_sse_avx_operations:sp_mult_flops` | | ✓ |
107
+ | Div DP Flops | `retired_sse_avx_operations:dp_div_flops` | ✓ | ✓ |
108
+ | Div SP Flops | `retired_sse_avx_operations:sp_div_flops` | | ✓ |
109
+ | Loads | `ls_dispatch:ld_dispatch` | ✓ | ✓ |
110
+ | Stores | `ls_dispatch:store_dispatch` | ✓ | ✓ |
111
+
112
+ #### Additional recommendations
113
+ For best results, when labeling your code with [Extrae events](https://tools.bsc.es/doc/html/extrae/api.html), e.g. with `Extrae_eventandcounters` calls, **avoid labeling regions that include MPI calls**. Focus on labeling regions of pure computation, as MPI calls will cause the region and hardware counter timestamps to not match, preventing them from being shown on the CARM GUI.
114
+
115
+ ## CARM Benchmarking
116
+
117
+ To benchmark your architecture and display its roofline in the CARM GUI, use the [CARM Tool](https://github.com/champ-hub/carm-roofline). **Note: for compatibility, use the [latest version of the CARM Tool](https://pypi.org/project/carm-roofline/)**
118
+
119
+ This tool ships a series of sample rooflines from a MareNostrum 5 GPP node.
120
+
121
+ ## CARM GUI Features
122
+
123
+ ### Launch Configuration
124
+ **Use window colors:**
125
+ Controls which coloring scheme is used in the CARM GUI: the same colors as the Paraver timeline (if enabled) or the selected CARM GUI coloring scheme (see right sidebar options).
126
+
127
+ **Use Semantic Window:**
128
+ Controls whether the Paraver semantic window is used: if enabled, the GUI displays only the timestamps that are within the semantic window of the Paraver timeline. If disabled, all timestamps in the trace are displayed.
129
+
130
+ **Accumulate values:**
131
+ Controls whether timestamps (with the same underlying Paraver value) are averaged. Allows for similar timestamps to be grouped into a single, per-thread point, or to plot all timestamps individually.
132
+
133
+ ### Left Sidebar
134
+
135
+ **Use Paraver/CARM Colors:**
136
+ Same as above's "Use window colors"
137
+
138
+ **Use Semantic Window / All Timestamps:**
139
+ Same as above's "Use Semantic Window"
140
+
141
+ **Plot Raw/Accumulated Values:**
142
+ Same as above's "Accumulate values"
143
+
144
+ **Re-Sync Timeline With Paraver:**
145
+ Re-syncs the plotted timestamps in the CARM GUI with the timestamps being viewed in the Paraver timeline from which the CARM GUI was launched. This first requires the **Time Sync** button to be clicked on the Paraver side, the CARM GUI will usually keep itself synced to the Paraver timeline whenever the **Time Sync** button is clicked in the Paraver interface. In case the user changes the displayed timestamps in the CARM GUI and wishes to return to the same interval that they have in the Paraver timeline, they can use the **Re-Sync Timeline With Paraver** button.
146
+
147
+ **Send Timestamps Roof Labels:**
148
+ Labels the timestamps based on which roof they are under, for viewing in Paraver. The path of the generated trace will be printed in the Paraver console, and can be clicked to open the trace in Paraver. You can then select the trace and click *New single timeline window* to view the timestamps with the new labels.
149
+
150
+ **Send Timestamps LD/ST Percentage Colors:**
151
+ Same as above, but labels the timestamps based on the percentage of loads to stores.
152
+
153
+ **Send Timestamps SP/DP Percentage Colors:**
154
+ Same as above, but labels the timestamps based on the percentage of single to double precision operations.
155
+
156
+ ### Right Sidebar
157
+ The right sidebar controls the CARM GUI specific features, which include various filtering and coloring options as well as graphical annotations.
158
+
159
+ Useful options include:
160
+ - **Filter points** by vector ISA or precision
161
+ - **Color points** based on thread ID, precision, vector ISA or load/store ratio
162
+ - Note that this requires the left sidebar option to be set to "Use CARM GUI Colors".
163
+
164
+ The plot can be configured to normalize the performance roof to the number of threads. The normalized roofs represent the performance per thread, which matches the Paraver timestamps (also per thread). This mode is recommended when relating application performance to the underlying hardware. The non-normalized roofs represent the overall performance of the architecture, and is best for understanding the hardware capabilities.
165
+
166
+ ## GUI Performance
167
+ The GUI may become slow when plotting a very large number of events. To improve performance, you can:
168
+ - Enable the "Accumulate values" option to group similar events into a single point.
169
+ - Enable the "Use Semantic Window" option to only plot events visible in Paraver.
170
+ - Focus your analysis on a smaller time window in the Paraver timeline.
@@ -0,0 +1,153 @@
1
+ # CARM-Paraver GUI
2
+
3
+ This GUI allows the analysis of [Paraver](https://tools.bsc.es/paraver) traces on the Cache-Aware Roofline Model (CARM) for floating-point operations. It can be launched from the Paraver interface and send labeled events back to Paraver for visualization.
4
+
5
+ The CARM allows for roofline analysis of your application, displaying its computational bursts as points on the roofline. This can be used to identify bottlenecks and optimization opportunities for the respective code section. Points on the memory-bound or the compute-bound sections of the roof benefit from different optimization strategies, and the distance of your points to the roofline can be used to identify how much performance can be gained by optimizing your code.
6
+
7
+ # Requirements
8
+ - Python (tested with 3.9.25, 3.10.12, 3.12.3)
9
+ - [Paraver, Extrae](https://tools.bsc.es/downloads)
10
+
11
+ # How to use
12
+
13
+ ## Installation
14
+ **The recommended way to install the package** is via `pip`:
15
+ ```bash
16
+ pip install carm-paraver
17
+ ```
18
+ Alternatively, you can install it from source by cloning this repository and running:
19
+ ```bash
20
+ pip install .
21
+ ```
22
+ If the install fails due to dependency conflicts, you can use a Python virtual environment to install the package and its dependencies in an isolated environment. To do this, you can run:
23
+ ```bash
24
+ python -m venv .venv
25
+ source .venv/bin/activate
26
+ pip install carm-paraver
27
+ ```
28
+ If you install in a virtual environment, make sure to run Paraver from the same environment:
29
+ ```bash
30
+ source .venv/bin/activate
31
+ wxparaver
32
+ ```
33
+
34
+ ## First-time Setup
35
+ CARM-Paraver needs `paramedir` to be in your PATH in order to run. To add it, add Paraver's bin directory to your PATH. You can make this permanent by appending it to your `.bashrc` or `.bash_profile` (change the path accordingly):
36
+
37
+ ```bash
38
+ export PATH=/path/to/paraver/bin:$PATH
39
+ ```
40
+
41
+ ## Running
42
+ The GUI is launched via the Paraver interface like so:
43
+ 1. Use [Extrae](https://github.com/bsc-performance-tools/extrae) to generate a trace with the required counters ([see how to configure Extrae below](#paraver-trace-requirements)).
44
+ 2. Load the trace in Paraver, and zoom into a section of interest.
45
+ 3. Right click the timeline and select the option to launch the CARM GUI.
46
+ 4. Configure the options in Paraver to your liking (see [Launch Configuration](#launch-configuration)), and click "Run".
47
+ 5. Click the link printed in the Paraver console to open the GUI in your browser.
48
+
49
+ You will now have the CARM GUI open, showing the architecture's roofline, and the events from the Paraver trace represented as points on the plot. Their position on the roofline, which is determined by their performance and arithmetic intensity, can be used to identify bottlenecks and optimization opportunities for the respective code section. Check the [CARM GUI Features](#carm-gui-features) section for more details about the GUI, and how you can label events and send them back to Paraver for visualization.
50
+
51
+ If you get any errors, be sure to consult the [First-time Setup](#first-time-setup) and [Paraver Trace Requirements](#paraver-trace-requirements) sections.
52
+
53
+ ## Paraver Trace Requirements
54
+
55
+ To enable CARM analysis, your Paraver trace needs to include information on the floating-point and memory operations performed by the application. To do this, [configure Extrae](https://tools.bsc.es/doc/html/extrae/xml.html#xml-section-performance-counters) to include the counters in the tables below.
56
+
57
+ #### Which counters to include?
58
+ Include only the necessary counters for your analysis, so they fit in a single counter set. If too many counters are active, accuracy may be reduced.
59
+
60
+ Take the application examples below. For each case, the tables below indicate which counters you should include in your Extrae configuration:
61
+ - **App 1**: The application only uses double precision, but you don't know which vector ISAs it uses.
62
+ - **App 2**: The application is vectorized with AVX2, using both precisions.
63
+
64
+ If you are unsure, include all counters and prune them later as you learn more about the application. Using separate load and store counters is recommended, as it allows for a more detailed analysis.
65
+
66
+ #### Intel CPUs
67
+ | FP/Mem Operation | Intel Counter | App 1 | App 2 |
68
+ | ---------------- | ------------------------------------------ | ------- | ------- |
69
+ | Scalar DP Insts | `FP_ARITH_INST_RETIRED:SCALAR_DOUBLE` | ✓ | ✓ |
70
+ | Scalar SP Insts | `FP_ARITH_INST_RETIRED:SCALAR_SINGLE` | | ✓ |
71
+ | SSE DP Insts | `FP_ARITH_INST_RETIRED:128B_PACKED_DOUBLE` | ✓ | |
72
+ | SSE SP Insts | `FP_ARITH_INST_RETIRED:128B_PACKED_SINGLE` | | |
73
+ | AVX2 DP Insts | `FP_ARITH_INST_RETIRED:256B_PACKED_DOUBLE` | ✓ | ✓ |
74
+ | AVX2 SP Insts | `FP_ARITH_INST_RETIRED:256B_PACKED_SINGLE` | | ✓ |
75
+ | AVX512 DP Insts | `FP_ARITH_INST_RETIRED:512B_PACKED_DOUBLE` | ✓ | |
76
+ | AVX512 SP Insts | `FP_ARITH_INST_RETIRED:512B_PACKED_SINGLE` | | |
77
+ | Loads | `MEM_INST_RETIRED:ALL_LOADS` | ✓ | ✓ |
78
+ | Stores | `MEM_INST_RETIRED:ALL_STORES` | ✓ | ✓ |
79
+ | Loads and Stores | `MEM_INST_RETIRED:ALL` | | |
80
+
81
+ #### AMD CPUs
82
+ | FP/Mem Operation | AMD Counter | App 1 | App 2 |
83
+ | ---------------- | ---------------------------------------------- | ------- | ------- |
84
+ | Mul/Add DP Flops | `retired_sse_avx_operations:dp_mult_add_flops` | ✓ | ✓ |
85
+ | Mul/Add SP Flops | `retired_sse_avx_operations:sp_mult_add_flops` | | ✓ |
86
+ | Add/Sub DP Flops | `retired_sse_avx_operations:dp_add_sub_flops` | ✓ | ✓ |
87
+ | Add/Sub SP Flops | `retired_sse_avx_operations:sp_add_sub_flops` | | ✓ |
88
+ | Mul DP Flops | `retired_sse_avx_operations:dp_mult_flops` | ✓ | ✓ |
89
+ | Mul SP Flops | `retired_sse_avx_operations:sp_mult_flops` | | ✓ |
90
+ | Div DP Flops | `retired_sse_avx_operations:dp_div_flops` | ✓ | ✓ |
91
+ | Div SP Flops | `retired_sse_avx_operations:sp_div_flops` | | ✓ |
92
+ | Loads | `ls_dispatch:ld_dispatch` | ✓ | ✓ |
93
+ | Stores | `ls_dispatch:store_dispatch` | ✓ | ✓ |
94
+
95
+ #### Additional recommendations
96
+ For best results, when labeling your code with [Extrae events](https://tools.bsc.es/doc/html/extrae/api.html), e.g. with `Extrae_eventandcounters` calls, **avoid labeling regions that include MPI calls**. Focus on labeling regions of pure computation, as MPI calls will cause the region and hardware counter timestamps to not match, preventing them from being shown on the CARM GUI.
97
+
98
+ ## CARM Benchmarking
99
+
100
+ To benchmark your architecture and display its roofline in the CARM GUI, use the [CARM Tool](https://github.com/champ-hub/carm-roofline). **Note: for compatibility, use the [latest version of the CARM Tool](https://pypi.org/project/carm-roofline/)**
101
+
102
+ This tool ships a series of sample rooflines from a MareNostrum 5 GPP node.
103
+
104
+ ## CARM GUI Features
105
+
106
+ ### Launch Configuration
107
+ **Use window colors:**
108
+ Controls which coloring scheme is used in the CARM GUI: the same colors as the Paraver timeline (if enabled) or the selected CARM GUI coloring scheme (see right sidebar options).
109
+
110
+ **Use Semantic Window:**
111
+ Controls whether the Paraver semantic window is used: if enabled, the GUI displays only the timestamps that are within the semantic window of the Paraver timeline. If disabled, all timestamps in the trace are displayed.
112
+
113
+ **Accumulate values:**
114
+ Controls whether timestamps (with the same underlying Paraver value) are averaged. Allows for similar timestamps to be grouped into a single, per-thread point, or to plot all timestamps individually.
115
+
116
+ ### Left Sidebar
117
+
118
+ **Use Paraver/CARM Colors:**
119
+ Same as above's "Use window colors"
120
+
121
+ **Use Semantic Window / All Timestamps:**
122
+ Same as above's "Use Semantic Window"
123
+
124
+ **Plot Raw/Accumulated Values:**
125
+ Same as above's "Accumulate values"
126
+
127
+ **Re-Sync Timeline With Paraver:**
128
+ Re-syncs the plotted timestamps in the CARM GUI with the timestamps being viewed in the Paraver timeline from which the CARM GUI was launched. This first requires the **Time Sync** button to be clicked on the Paraver side, the CARM GUI will usually keep itself synced to the Paraver timeline whenever the **Time Sync** button is clicked in the Paraver interface. In case the user changes the displayed timestamps in the CARM GUI and wishes to return to the same interval that they have in the Paraver timeline, they can use the **Re-Sync Timeline With Paraver** button.
129
+
130
+ **Send Timestamps Roof Labels:**
131
+ Labels the timestamps based on which roof they are under, for viewing in Paraver. The path of the generated trace will be printed in the Paraver console, and can be clicked to open the trace in Paraver. You can then select the trace and click *New single timeline window* to view the timestamps with the new labels.
132
+
133
+ **Send Timestamps LD/ST Percentage Colors:**
134
+ Same as above, but labels the timestamps based on the percentage of loads to stores.
135
+
136
+ **Send Timestamps SP/DP Percentage Colors:**
137
+ Same as above, but labels the timestamps based on the percentage of single to double precision operations.
138
+
139
+ ### Right Sidebar
140
+ The right sidebar controls the CARM GUI specific features, which include various filtering and coloring options as well as graphical annotations.
141
+
142
+ Useful options include:
143
+ - **Filter points** by vector ISA or precision
144
+ - **Color points** based on thread ID, precision, vector ISA or load/store ratio
145
+ - Note that this requires the left sidebar option to be set to "Use CARM GUI Colors".
146
+
147
+ The plot can be configured to normalize the performance roof to the number of threads. The normalized roofs represent the performance per thread, which matches the Paraver timestamps (also per thread). This mode is recommended when relating application performance to the underlying hardware. The non-normalized roofs represent the overall performance of the architecture, and is best for understanding the hardware capabilities.
148
+
149
+ ## GUI Performance
150
+ The GUI may become slow when plotting a very large number of events. To improve performance, you can:
151
+ - Enable the "Accumulate values" option to group similar events into a single point.
152
+ - Enable the "Use Semantic Window" option to only plot events visible in Paraver.
153
+ - Focus your analysis on a smaller time window in the Paraver timeline.
@@ -362,6 +362,18 @@ def calculate_roofline(values, min_ai):
362
362
  FPaidots = [0] * 2
363
363
  FPgflopdots = [0] * 2
364
364
 
365
+ try:
366
+ fp_fma = float(values[5])
367
+ except (TypeError, ValueError):
368
+ fp_fma = 0.0
369
+ try:
370
+ fp_base = float(values[4])
371
+ except (TypeError, ValueError):
372
+ fp_base = 0.0
373
+
374
+ # Fall back to non-FMA peak when FP_FMA is missing/zero.
375
+ fp_peak = fp_fma if fp_fma > 0 else fp_base
376
+
365
377
  ai = np.linspace(min(0.00390625, min_ai), 256, num=200000)
366
378
  cache_levels = ["L1", "L2", "L3", "DRAM"]
367
379
 
@@ -371,7 +383,7 @@ def calculate_roofline(values, min_ai):
371
383
  if values[cache_levels.index(cache_level)] > 0:
372
384
  aidots = [0, 0, 0]
373
385
  # Compute the first point
374
- y_values = carm_eq(ai, values[cache_levels.index(cache_level)], values[5])
386
+ y_values = carm_eq(ai, values[cache_levels.index(cache_level)], fp_peak)
375
387
 
376
388
  # Find the point where y_values stops increasing or reaches a plateau
377
389
  for i in range(1, len(y_values)):
@@ -531,7 +543,17 @@ def draw_annotation(
531
543
 
532
544
  if cache_level in cache_levels and values[cache_levels.index(cache_level)] > 0:
533
545
  aidots[0] = 0.00390625
534
- y_values = carm_eq(ai, values[cache_levels.index(cache_level)], values[5])
546
+ try:
547
+ fp_fma = float(values[5])
548
+ except (TypeError, ValueError):
549
+ fp_fma = 0.0
550
+ try:
551
+ fp_base = float(values[4])
552
+ except (TypeError, ValueError):
553
+ fp_base = 0.0
554
+ fp_peak = fp_fma if fp_fma > 0 else fp_base
555
+
556
+ y_values = carm_eq(ai, values[cache_levels.index(cache_level)], fp_peak)
535
557
  gflopdots[0] = y_values[0]
536
558
  for i in range(1, len(y_values)):
537
559
  if y_values[i - 1] == y_values[i]: