Evaluation portion for metrics (#123)

* EvaluateAST and validation of RawAST

* Adding MetricDimension class and concepts

* set_dimensions() and improved ValidateRawAST()

* source formatting (clang-format v11) (#124)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Addressing 1st round of review comments

* Modified the parser production rules to support the right syntax for REDUCE and SELECT derived metric expressions

* changes to raw_ast.hpp and fmt::format()

* Parser tests updated to support corrected REDUCE and SELECT syntax

* changes to EvaluateAST::set_dimensions() and other dimension related code changes

* Added a test for EvaluateAST::evaluate() to test basic arithmetic on EvaluateAST

* Format source code (via clang-format v11) on sauverma/evaluate-ast (#146)

* source formatting (clang-format v11)

* Add dimension information to counter record

Restructures counter records to have the following design:

rocprofiler_record_id_t which is an int64_t that encodes
both the counter id and dimension information for the
record. The first 16 bits are reserved for the counter id while
the last 48 are split among the dimensions specified in
rocprofiler_dimension_t (currently 8 bits per dimension).
Each of the 8 bits for the dimension stores the dimension
value for that dimension for this record (i.e. a value of 8
on dimension XCC would denote XCC[8] for the counter). The
split among the dimensions will automatically adjust as
dimensions are added or removed.

The record also contains a union of {int64_t hw_counter, double
derived_counter} to specify the value of the record at
rocprofiler_record_id_t. int64_t denotes a physical hardware
counter that has integer types while the double is used for derived
counters (which type this counters values are needs to be queried
separately).

* Integration of new id type + other fixes

---------

Co-authored-by: sauverma93 <sauverma93@users.noreply.github.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>

* Fixed sissues with reduce() implementation and added a test for reduce()

* Updated parser syntax for reduce() and updated the parser test. Disabled the test for select()

* Build warning fixes

* Modifications to support fetching xcc/etc info from agent

* Initial plumbing working for single counters, cleanup+tests still needed

* Remove string comparison from reduce ops

* source formatting (clang-format v11) (#163)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* cmake formatting (cmake-format) (#164)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* source formatting (clang-format v11) (#171)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Merged with master

* source formatting (clang-format v11) (#172)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* source formatting (clang-format v11) (#173)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Test fix

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <bwelton@users.noreply.github.com>
Co-authored-by: sauverma93 <sauverma93@users.noreply.github.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>

[ROCm/rocprofiler-sdk commit: 63775f241a]
Tento commit je obsažen v:
authored and GitHub committed 2023-11-03 21:10:40 -07:00
1 rodič 370a86830b
revize e8fa4d3873
30 files changed
+1960 -973

No files matched your search

@@ -1,9 +1,9 @@
<gfx8 base="gfx8">
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
@@ -40,9 +40,9 @@
<gfx9>
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
@@ -82,9 +82,9 @@
# EA1
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="TCC_EA1_WRREQ" block=TCC event=256 descr="Number of transactions (either 32-byte or 64-byte) going over the TC_EA_wrreq interface. Atomics may travel over the same interface and are generally classified as write requests. This does not include probe commands."></metric>
<metric name="TCC_EA1_WRREQ_64B" block=TCC event=257 descr="Number of 64-byte transactions going (64-byte write or CMPSWAP) over the TC_EA_wrreq interface."></metric>
<metric name="TCC_EA1_WRREQ_STALL" block=TCC event=260 descr="Number of cycles a write request was stalled."></metric>
@@ -120,9 +120,9 @@
<gfx90a>
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="SQ_WAIT_INST_LDS" block=SQ event=91 descr="Number of wave-cycles spent waiting for LDS instruction issue. In units of 4 cycles. (per-simd, nondeterministic)"></metric>
<metric name="TCP_TCP_TA_DATA_STALL_CYCLES" block=TCP event=6 descr="TCP stalls TA data interface. Now Windowed."></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
@@ -388,9 +388,9 @@
<gfx940>
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="SQ_WAIT_INST_LDS" block=SQ event=96 descr="Number of wave-cycles spent waiting for LDS instruction issue. In units of 4 cycles. (per-simd, nondeterministic)"></metric>
<metric name="TCP_TCP_TA_DATA_STALL_CYCLES" block=TCP event=6 descr="TCP stalls TA data interface. Now Windowed."></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
@@ -661,9 +661,9 @@
<gfx10>
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
<metric name="GRBM_CP_BUSY" block=GRBM event=3 descr="Any of the Command Processor (CPG/CPC/CPF) blocks are busy."></metric>
@@ -726,9 +726,9 @@
<gfx11>
<metric name="MAX_WAVE_SIZE" descr="Max wave size constant" special="yes"></metric>
<metric name="KERNEL_DURATION" descr="The duration of the kernel dispatch" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM" special="yes"></metric>
<metric name="SIMD_NUM" descr="SIMD Number" special="yes"></metric>
<metric name="CU_NUM" descr="CU_NUM" special="yes"></metric>
<metric name="SE_NUM" descr="SE_NUM"></metric>
<metric name="SIMD_NUM" descr="SIMD Number"></metric>
<metric name="CU_NUM" descr="CU_NUM"></metric>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
<metric name="GL2C_HIT" block=GL2C event=42 descr="Number of cache hits"></metric>