Skip to content

Improve roofline documentation - #180

Closed
cfallows-amd wants to merge 4 commits into
developfrom
users/cfallows-amd/roofline_docs
Closed

cfallows-amd wants to merge 4 commits into
developfrom
users/cfallows-amd/roofline_docs

Conversation

@cfallows-amd

Copy link
Copy Markdown
Contributor

Add standalone roofline documentation page

  • conceptual, benchmarking, profiling, and analysis sections to go over theory, usage, and examples
  • landing page for all roofline information that is now pointed to by other pages
  • requested by customer for feature clarity
  • can be improved in future with new roofline enhancement details and additional examples for users to understand usage of options in each mode

No code changes.

Add photos, remove dupes, add references to other pages referencing roofline.

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
ywang103-amd pushed a commit to ywang103-amd/rocm-systems that referenced this pull request Aug 7, 2025
…OCm#180)

* Update to KOKKOS_TOOLS_LIBS env var (ROCm#69)

* Broken link fixed

---------

Co-authored-by: Maarten Arnst <maarten.arnst@ulg.ac.be>

[ROCm/rocprofiler-systems commit: 1674594]
@@ -0,0 +1,197 @@
.. meta::

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.

Please update sphinx/_toc* files for this new .rst file


* :doc:`LDS </conceptual/local-data-share.html>`: local data share, or shared memory, is fast on-CU scratchpad that can be managed by SW to effectively share data and coordinate between wavefronts in a workgroup.

* :doc:`L1 cache </conceptual/vector-l1-cache.html>`: the vL1d, or vector L1 data cache, is local to each CU on an accelerator and handles vector memory operations issued by a wavefront.

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.

Is vL1D cache shared among CUs in a shader engine?

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.

L1 data cache is private to CU

@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.

LGTM, thank you so much for working on this!

@prbasyal-amd @peterjunpark seems like documentation is not building using sphinx command mentioned in https://rocm.docs.amd.com/en/latest/contribute/contributing.html#editing-and-adding-to-the-documentation, could you please help?


* :ref:`Peak MFMA <desc-mfma>`: matrix fused multiply add instructions where entries of the input and output matrices are distributed over the lanes of the wavefront’s vector registers.

Let’s start with the red kernel point- it is a memory-intensive workload, and because it sits just under peak memory bandwidth line, we are restricted in performance by how fast we can move data. Seeing a kernel point here would first suggest to us that we are bottlenecked by a specific memory stage and might want to reevaluate memory access implementation. Another obervation would be that we should optimize our code to do more operations on loaded data before needing more- this is the arithmetic intensity measurement- how much work we can do on the same data. Some examples of this would be to change precision (for example single precision over double precision for space and speed), use the vector units more efficiently, multithreading, use optimized kernels or other rocm software. Applications that are throughput bound by GEMM computation can achieve additional speedups by utilizing Matrix Cores. Generalized Matrix Multiplication (GEMM) computations are hardware-accelerated through Matrix Core Processing Units to achieve speedup, compared to SIMD vector units.

@vedithal-amd vedithal-amd Aug 9, 2025 •

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.

We should also ask @feizheng10 , @benrichard-amd and @skyreflectedinmirrors for fact checking technical points, just to be safe :)

* Visualized memory chart requires the width of the terminal output to be greater than or equal to 234 to display the whole chart properly.
* Visualized Roofline chart is adapted to the initial terminal size only. If it is not clear, you may need to adjust the terminal size and regenerate it to check the display effect.

All CLI, TUI, and GUI modes in analysis stage can use the same roofline analyze options. CLI and TUI display roofline plot using plotext, and GUI uses plotly (same method as our roofline PDF plot outputs).

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.

Does TUI display roofline?

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.

Actually, roofline is currently disabled for TUI

systems-assistant Bot pushed a commit that referenced this pull request Aug 10, 2025
* SWDEV-527299 - Support HIP_POINTER_ATTRIBUTE_CONTEXT

As HIP enables UVA by default, it seems we can simply expose the context to support this feature.

* The performance counter collection which profiles the user’s workload itself. For roof-only case, we limit the counters to only those necessary for roofline analysis purposes. This data is used to plot the kernel points on the roofline graph.

* The roofline micro-benchmarking which profiles the hardware capabilities of the system. This part executes the roofline binary, comprised of benchmarks that compute the theoretical peak of the hardware per data type. This phase is dependent on both the hardware architecture and the customer’s hardware settings, such as clock speed for example. This data is used to plot the ‘peaks’, or lines on the graph.

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.

"theoretical peak", I'd suggest to say " attainable peak "

---------------------
Profiling Options
---------------------
In profiling mode, we collect the roofline-related performance counters for a user's workload and roofline benchmarks for the system's theoretical throughput. Roofline analysis occurs on any profile mode run, provided ``--no-roof`` option is not included. You don't need to include any additional roofline-specific options for roofline analysis. If you want to focus only on roofline-specific performance data and reduce the time it takes to profile, you can use the ``--roof-only`` option. This option limits the profiling to just the roofline performance counters.

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.

The same here. I'd suggest to say "empirical attainable peak" but not theoretical.
Generally, when people mention theoretical peak, they are talking about the one against the peak spec.
Maybe there will be a day we actually add the theoretical one, or whenever the unified roofline yaml done, we could mention in the doc: users could customize by themselves.

@jamessiddeley-amd
jamessiddeley-amd requested a review from a team as a code owner August 14, 2025 15:40
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 14, 2025
@jamessiddeley-amd

Copy link
Copy Markdown
Contributor

Additions from #325 have been updated in roofline docs. Namely per-kernel roofline analysis being displayed alongside detailed, structured table outputs (with example command and example new output for block section 4) along with measured empirical peak values for comparison.

@vedithal-amd

Copy link
Copy Markdown
Contributor

@cfallows-amd can we hold off on merging this until roofline metrics PR is merged https://github.com/ROCm/rocm-systems/pull/325/files, and then we can make any roofline documentation changes here while keeping roofline metrics into consideration.

@cfallows-amd

Copy link
Copy Markdown
Contributor Author

@vedithal-amd yes forgot to note here, James and I are working on other roofline-related PRs that have higher priority and would clash with these changes. This doc PR is on hold until those changes have made it into develop. Thanks

jayhawk-commits pushed a commit that referenced this pull request Aug 18, 2025
* SWDEV-527299 - Support HIP_POINTER_ATTRIBUTE_CONTEXT

As HIP enables UVA by default, it seems we can simply expose the context to support this feature.


[ROCm/clr commit: b434fbe]
@vedithal-amd

Copy link
Copy Markdown
Contributor

@cfallows-amd I think the documentation might need a lot of updating due to multiple roofline changes merged since this PR was created. Feel free to either update this PR or close this one and create a new PR, thanks!

@cfallows-amd

Copy link
Copy Markdown
Contributor Author

Closing old documentation PR as there were significant merging conflicts to resolve unrelated to docs- this is due to time between PR open and now. New PR will be started.

ammallya pushed a commit that referenced this pull request Jan 21, 2026
- Initialize the entire pSync buffer with the default synchronization value
ammallya pushed a commit that referenced this pull request Jan 21, 2026
- Initialize the entire pSync buffer with the default synchronization value

[ROCm/rocshmem commit: 6dba253]
ammallya pushed a commit that referenced this pull request Jan 30, 2026
ammallya pushed a commit that referenced this pull request Jan 30, 2026
ammallya pushed a commit that referenced this pull request Apr 9, 2026
The examples can now be installed to `share/doc/examples/*` by setting
`AIS_INSTALL_EXAMPLES` (formerly `AIS_BUILD_EXAMPLES`) to ON

Part of AIHIPFILE-120
ammallya pushed a commit that referenced this pull request Apr 9, 2026
The examples can now be installed to `share/doc/examples/*` by setting
`AIS_INSTALL_EXAMPLES` (formerly `AIS_BUILD_EXAMPLES`) to ON

Part of AIHIPFILE-120

[ROCm/hipFile commit: 84375b7]
@cfallows-amd
cfallows-amd deleted the users/cfallows-amd/roofline_docs branch October 19, 2026 20:44
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