Skip to content

[rocprof-compute] Generalize Roofline - #325

Merged
jamessiddeley-amd merged 26 commits into
developfrom
users/jamessiddeley-amd/generalize-roofline
Aug 20, 2025
Merged

jamessiddeley-amd merged 26 commits into
developfrom
users/jamessiddeley-amd/generalize-roofline

Conversation

@jamessiddeley-amd

@jamessiddeley-amd jamessiddeley-amd commented Aug 12, 2025 •

Copy link
Copy Markdown
Contributor

Motivation

This PR extracts the roofline equation out of python code in roofline_calc.py to one section in YAML config, in which can be easily configured for each arch.

These YAMLS are per-kernel roofline analysis, allowing users to analyze individual kernel performance characteristics for roofline methodology using equations from a single-source of truth YAML (0400_roofline.yaml).

Technical Details

  • Added roofline YAML configuration (0400_roofline.yaml) defining metrics based directly off of AI_Data object python equations in calc_ai() to unified_configs.yaml for gfx90a, gfx908, gfx940, gfx941, gfx942, and gfx950.

  • Refactored calc_ai() to calc_ai_profile() which carries over the same legacy hardcoded calculations for profiling use (before analysis configs are available)

  • Modified calc_ai() in roofline_calc.py to calc_ai_analyze() to process individual kernels rather by calling eval_metric() on each kernel.

  • Added roofline.csv as an analysis runtime dependancy to read and display respective empirical peaks for roofline metrics

  • Updated analysis_cli.py to generate per-kernel roofline plots and display kernel-specific metrics in the CLI output

  • Modified cli_generate_plot to display plot points calculated from calc_ai_analyze()

  • Enhanced tty.py show_all() function to display per-kernel roofline metrics with cli_style = "Roofline" in organized sections (4.1 Roofline Rate Metrics, 4.2 AI Plot Points) (screenshots in ticket)

  • Added web Gui integration (screenshots in ticket)

  • Updated docs

  • Complete TUI integration will be moved to a later implementation.## Test Plan

Pass 100% on local testing suite

Test Result

Local ctest pass 16/16

Submission Checklist

@xuchen-amd xuchen-amd left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for getting this in, the individual kernel metrics and plot output looks great!
Left some comments for potential improvements.
Please update roofline docs and consider to have the docs in a separate PR for Pratik to review.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 14, 2025

@feizheng10 feizheng10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
BTW, we never really support/verify roofline on MI100...@carrie please help to check

@vedithal-amd vedithal-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left minor comments

SwRaw pushed a commit that referenced this pull request Aug 19, 2025
…how counters being profiled in metadata. (#325)

* expose dimensional info in rocprofiler_counter_info_v1_t.

* add counter_id in dim info.

* address review comments

* format.

* address comments.

* use array of pointers for dimensions_instaces.

* format and comments.

* address comments.

* new line.

* Update counter_defs.yaml

* Update counter_defs.yaml

* Update counter_defs.yaml

* counter_defs.

* format counter defs.

* format counter defs.

* format counter defs.

* show only counters being profiled in metadata.

* Format.

* use config for counters and fix warnings.

* add version for rocprofiler_counter_dimension_info_v1_t struct.

* rename rocprofiler_counter_record_dimension_instance_v1_info_t.

* account device id from pmc for counters metadata.

* move dim structs to counters.h.

* address comments to compare value.

* fix tests.

* Address comments. use pointer of arrays for ABI.

* rebase.

* fix build error.

* use separate metadata::init() for rocprofv3.

* also print not found counters.

* precompute all the perf counters needed to be in metadata.

* Misc.

* format

* Format.

* rocprofiler::sdk::container::c_array

* Address comments.

* source/lib/output/metadata.cpp

* lint.

* add unit test for c_array.

* add unit test and serialization support for c_array container.

* Misc.

* Clean files.

* Format.

* clang-tidy.

* add more checks to c_array.

* misc. typo

* Addr comments.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>

[ROCm/rocprofiler-sdk commit: bf0fad1]
@rahulc-gh

Copy link
Copy Markdown
Collaborator

/AzurePipelines run rocm-ci-caller

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jamessiddeley-amd
jamessiddeley-amd merged commit 5840940 into develop Aug 20, 2025
@jamessiddeley-amd
jamessiddeley-amd deleted the users/jamessiddeley-amd/generalize-roofline branch August 20, 2025 13:58
systems-assistant Bot pushed a commit to ROCm/rocprofiler-compute that referenced this pull request Aug 20, 2025
* per kernel analysis Roofline

* added per-kernel eval_metric calculation with display

* fixed typo

* updated tty.py show_all()

* formatting

* fixed ctest failures and updated equations

* formatting

* updated metric descriptoins

* review tweaks

* update docs

* added roofline gui analysis

* updated GUI docs

* updated print statement

* comment tweaks and ran ruff formatting
[rocm-systems] ROCm/rocm-systems#325 (commit 5840940)
sluzynsk-amd pushed a commit that referenced this pull request Aug 21, 2025
* per kernel analysis Roofline

* added per-kernel eval_metric calculation with display

* fixed typo

* updated tty.py show_all()

* formatting

* fixed ctest failures and updated equations

* formatting

* updated metric descriptoins

* review tweaks

* update docs

* added roofline gui analysis

* updated GUI docs

* updated print statement

* comment tweaks and ran ruff formatting
t_df = OrderedDict()
t_df["pmc_perf"] = pd.read_csv(pmc_perf_csv)

self.__ai_data = calc_ai_profile(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we missed handling rocpd processing dataframe here

xuchen-amd added a commit that referenced this pull request Aug 21, 2025
ammallya pushed a commit that referenced this pull request Nov 17, 2025
Change-Id: Ide3563a876cb530d0e80676e78f36f18a233a3ba

Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
ammallya pushed a commit that referenced this pull request Nov 18, 2025
Change-Id: Ide3563a876cb530d0e80676e78f36f18a233a3ba

Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>

[ROCm/amdsmi commit: bd82e88]
ammallya pushed a commit that referenced this pull request Nov 21, 2025
Change-Id: Ide3563a876cb530d0e80676e78f36f18a233a3ba

Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>

[ROCm/amdsmi commit: bd82e88]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants