Repository navigation
feat(rocprofiler-compute): store the memory chart layout file in the analysis db - #12582
Merged
xuchen-amd merged 4 commits intoOct 17, 2026
Conversation
1 task done
xuchen-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
2 times, most recently
from
October 7, 2026 22:59
d3067ad to
006f865
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The generated database schema diagram must be regenerated to include the new workload column.
1 open finding
What changed in this PR
Stores architecture-specific memory-chart layouts in analysis databases so ROCm Optiq can render charts using stable workload metric IDs.
Changes:
- Adds layout serialization and database persistence.
- Centralizes metric-ID and memory-chart panel helpers.
- Adds documentation and comprehensive unit-test coverage.
| File | Description |
|---|---|
CMakeLists.txt |
Registers the extdata tests. |
docs/design/hld-memory-chart-db-structure.md |
Documents the database-layout design. |
docs/how-to/analyze/cli.rst |
Documents the new JSON column. |
docs/how-to/analyze/optiq.rst |
Links Optiq users to the layout documentation. |
src/memory_chart/extdata.py |
Converts resolved layouts into stored form. |
src/rocprof_compute_analyze/analysis_db.py |
Persists layouts with workloads. |
src/utils/analysis_orm.py |
Adds the column and updates schema version. |
src/utils/parser.py |
Uses centralized metric-ID formatting. |
src/utils/tty.py |
Shares panel detection and table-ID formatting. |
src/utils/utils_common.py |
Adds metric-ID and panel helpers. |
tests/test_categories.yaml |
Categorizes the new tests. |
tests/unit/memory_chart/test_extdata.py |
Tests layout serialization. |
tests/unit/rocprof_compute_analyze/test_analysis_db.py |
Tests database persistence and fallback cases. |
tests/unit/utils/test_utils_common.py |
Tests metric-name-to-ID mapping. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xuchen-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
from
October 7, 2026 23:07
006f865 to
9060d10
Compare
xuchen-amd
marked this pull request as ready for review
October 7, 2026 23:08
xuchen-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
from
October 8, 2026 16:29
9060d10 to
1071b88
Compare
xuchen-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
from
October 8, 2026 16:35
1071b88 to
6d9f980
Compare
abchoudh-amd
approved these changes
Oct 9, 2026
vedithal-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
from
October 13, 2026 17:55
818904f to
8b875cc
Compare
vedithal-amd
requested changes
Oct 14, 2026
vedithal-amd
left a comment
Contributor
There was a problem hiding this comment.
Design
- The layout file should be the only memory chart format and the contract with Optiq.
- Store it in the column as-is, with no conversion.
- Optiq should draw the chart from the file and the database alone. Anything it needs must be in the file or in the memory chart README.
PR description
- Please sync it with the branch. It names a commit and a helper that aren't here.
- Please replace the per-commit list with a short summary of the final change.
xuchen-amd
marked this pull request as draft
October 14, 2026 21:23
- The HLD describes the design: the layout file stored as-is, names looked up within panel 3, explicit arrow direction and drawing hints, and no format version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Store each workload's layout file unchanged in the new memory_chart_layout_extdata column, or null when its GPU has no layout, so the layout file is the only memory chart format readers need. - Bugfix: a GPU whose layout file was skipped as broken no longer stops the database output. - Readers find layout metrics by name within panel 3; no metric ids or format version are stored. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ayout - The memory chart README names the analysis database column that holds each workload's layout file, and says it is null without a layout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd
force-pushed
the
users/xuchen-amd/memory_chart_db_structure
branch
from
October 16, 2026 22:30
00fbfc1 to
16d1bc3
Compare
- Drop the drawing steps, which repeat the field tables. - Drop notes that only matter to the terminal renderer or the tests. - Shorten the contract intro to one sentence. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vedithal-amd
approved these changes
Oct 16, 2026
vedithal-amd
left a comment
Contributor
There was a problem hiding this comment.
Rebase
- I rebased this branch onto #12548 without the merge commits, so the stack lands cleanly. The code is unchanged.
README
- I trimmed the memory chart README to a layout guide: dropped the drawing steps, which repeat the field tables, and the terminal-only notes.
Review
- The stored layout file is now the single memory chart format, and every earlier comment is addressed.
xuchen-amd
added a commit
that referenced
this pull request
Oct 17, 2026
## Motivation The memory chart for every architecture is now drawn by one renderer from a JSON layout file, one per architecture family. Adding an architecture means adding a layout file; no Python changes. The layout file is also the memory chart contract with ROCm Optiq. It states everything needed to draw the chart, so Optiq reads it directly. #12582 stores it in the analysis database. Bugfix: the Memory Chart tables keep their titles when the chart is not drawn (baseline comparison with several workloads). ## Technical Details - **Layouts** (`src/memory_chart/layouts/*.json`): every block states where it goes (`column`, `order`, `position`, `parent` or `host`), every arrow states its `direction`, and each part states how it is drawn (block `style`, metric `bar`, arrow `style`). - **Loader** (`loader.py`) checks a layout against the format rules. A broken file is skipped with a warning, so only its architectures lose the chart. - **Renderer** (`render.py`) replaces the per-architecture `mem_chart_*.py` files and reads the layout fields instead of deriving them. - **README** (`src/memory_chart/README.md`) is the contract: every field, how to draw a layout, the rules a reader can rely on, and where to find each metric's value in the analysis database. - **Tools:** `tools/memory_chart_layout_format.py` (pre-commit formatter) and `tools/memory_chart_preview.py <arch>` (draws a layout without a GPU). Chart changes users will see: - The boxes in the columns share one width, sized to the widest box; arrows are sized to fit their labels and values. - gfx1250 adds instruction cache, scalar data cache, and GL1 latency metrics; gfx115x shows instruction and data cache bandwidth separately. - Percent values get a progress bar on every architecture. - Labels such as the memory type are part of the block title, for example `DRAM (DDR5/LPDDR5)`. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - `tools/memory_chart_preview.py <arch>` for every architecture, with full values, no values, and memory bandwidth stalls. - `rocprof-compute analyze -p <gfx950 workload> -b 3`, with one workload and with two. ## Test Result - 1604 tests pass at the tip; pre-commit passes. - The chart draws for every architecture, and each layout shows every metric of its memory chart panel and no other. - With two workloads, the Memory Chart tables keep their titles. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
vedithal-amd
added a commit
that referenced
this pull request
Oct 25, 2026
## Motivation The memory chart for every architecture is now drawn by one renderer from a JSON layout file, one per architecture family. Adding an architecture means adding a layout file; no Python changes. The layout file is also the memory chart contract with ROCm Optiq. It states everything needed to draw the chart, so Optiq reads it directly. #12582 stores it in the analysis database. Bugfix: the Memory Chart tables keep their titles when the chart is not drawn (baseline comparison with several workloads). ## Technical Details - **Layouts** (`src/memory_chart/layouts/*.json`): every block states where it goes (`column`, `order`, `position`, `parent` or `host`), every arrow states its `direction`, and each part states how it is drawn (block `style`, metric `bar`, arrow `style`). - **Loader** (`loader.py`) checks a layout against the format rules. A broken file is skipped with a warning, so only its architectures lose the chart. - **Renderer** (`render.py`) replaces the per-architecture `mem_chart_*.py` files and reads the layout fields instead of deriving them. - **README** (`src/memory_chart/README.md`) is the contract: every field, how to draw a layout, the rules a reader can rely on, and where to find each metric's value in the analysis database. - **Tools:** `tools/memory_chart_layout_format.py` (pre-commit formatter) and `tools/memory_chart_preview.py <arch>` (draws a layout without a GPU). Chart changes users will see: - The boxes in the columns share one width, sized to the widest box; arrows are sized to fit their labels and values. - gfx1250 adds instruction cache, scalar data cache, and GL1 latency metrics; gfx115x shows instruction and data cache bandwidth separately. - Percent values get a progress bar on every architecture. - Labels such as the memory type are part of the block title, for example `DRAM (DDR5/LPDDR5)`. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - `tools/memory_chart_preview.py <arch>` for every architecture, with full values, no values, and memory bandwidth stalls. - `rocprof-compute analyze -p <gfx950 workload> -b 3`, with one workload and with two. ## Test Result - 1604 tests pass at the tip; pre-commit passes. - The chart draws for every architecture, and each layout shows every metric of its memory chart panel and no other. - With two workloads, the Memory Chart tables keep their titles. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
vedithal-amd
added a commit
that referenced
this pull request
Oct 25, 2026
…analysis db (#12582) ## Motivation ROCm Optiq can draw the memory chart from the analysis database alone. Each workload stores its memory chart layout file unchanged, so the layout file (#12548) is the only memory chart format. Bugfix: a GPU whose layout file was skipped as broken no longer stops the database output. ## Technical Details - New JSON column `compute_workload.memory_chart_layout_extdata`: the workload's layout file, or null when its GPU has no layout. Schema version 2.4.0. - Layout metrics are panel 3 metric names, unique within panel 3. Readers find each value and unit in the existing metric tables; `src/memory_chart/README.md` says how. - No conversion, metric ids, or format version are stored. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - On real gfx950 workloads (one and two in a database, and with `-b 2`): `analyze --output-format db`, then draw the chart from the database with a reader written only from the README. ## Test Result - 1606 tests pass at the tip; pre-commit passes. - The stored column equals the layout file, and every layout metric finds its value. - The chart drawn from the database matches the terminal `analyze -b 3` chart byte for byte. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
vedithal-amd
added a commit
that referenced
this pull request
Oct 26, 2026
## Motivation The memory chart for every architecture is now drawn by one renderer from a JSON layout file, one per architecture family. Adding an architecture means adding a layout file; no Python changes. The layout file is also the memory chart contract with ROCm Optiq. It states everything needed to draw the chart, so Optiq reads it directly. #12582 stores it in the analysis database. Bugfix: the Memory Chart tables keep their titles when the chart is not drawn (baseline comparison with several workloads). ## Technical Details - **Layouts** (`src/memory_chart/layouts/*.json`): every block states where it goes (`column`, `order`, `position`, `parent` or `host`), every arrow states its `direction`, and each part states how it is drawn (block `style`, metric `bar`, arrow `style`). - **Loader** (`loader.py`) checks a layout against the format rules. A broken file is skipped with a warning, so only its architectures lose the chart. - **Renderer** (`render.py`) replaces the per-architecture `mem_chart_*.py` files and reads the layout fields instead of deriving them. - **README** (`src/memory_chart/README.md`) is the contract: every field, how to draw a layout, the rules a reader can rely on, and where to find each metric's value in the analysis database. - **Tools:** `tools/memory_chart_layout_format.py` (pre-commit formatter) and `tools/memory_chart_preview.py <arch>` (draws a layout without a GPU). Chart changes users will see: - The boxes in the columns share one width, sized to the widest box; arrows are sized to fit their labels and values. - gfx1250 adds instruction cache, scalar data cache, and GL1 latency metrics; gfx115x shows instruction and data cache bandwidth separately. - Percent values get a progress bar on every architecture. - Labels such as the memory type are part of the block title, for example `DRAM (DDR5/LPDDR5)`. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - `tools/memory_chart_preview.py <arch>` for every architecture, with full values, no values, and memory bandwidth stalls. - `rocprof-compute analyze -p <gfx950 workload> -b 3`, with one workload and with two. ## Test Result - 1604 tests pass at the tip; pre-commit passes. - The chart draws for every architecture, and each layout shows every metric of its memory chart panel and no other. - With two workloads, the Memory Chart tables keep their titles. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
vedithal-amd
added a commit
that referenced
this pull request
Oct 26, 2026
…analysis db (#12582) ## Motivation ROCm Optiq can draw the memory chart from the analysis database alone. Each workload stores its memory chart layout file unchanged, so the layout file (#12548) is the only memory chart format. Bugfix: a GPU whose layout file was skipped as broken no longer stops the database output. ## Technical Details - New JSON column `compute_workload.memory_chart_layout_extdata`: the workload's layout file, or null when its GPU has no layout. Schema version 2.4.0. - Layout metrics are panel 3 metric names, unique within panel 3. Readers find each value and unit in the existing metric tables; `src/memory_chart/README.md` says how. - No conversion, metric ids, or format version are stored. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - On real gfx950 workloads (one and two in a database, and with `-b 2`): `analyze --output-format db`, then draw the chart from the database with a reader written only from the README. ## Test Result - 1606 tests pass at the tip; pre-commit passes. - The stored column equals the layout file, and every layout metric finds its value. - The chart drawn from the database matches the terminal `analyze -b 3` chart byte for byte. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
lamikr
pushed a commit
that referenced
this pull request
Oct 27, 2026
## Motivation The memory chart for every architecture is now drawn by one renderer from a JSON layout file, one per architecture family. Adding an architecture means adding a layout file; no Python changes. The layout file is also the memory chart contract with ROCm Optiq. It states everything needed to draw the chart, so Optiq reads it directly. #12582 stores it in the analysis database. Bugfix: the Memory Chart tables keep their titles when the chart is not drawn (baseline comparison with several workloads). ## Technical Details - **Layouts** (`src/memory_chart/layouts/*.json`): every block states where it goes (`column`, `order`, `position`, `parent` or `host`), every arrow states its `direction`, and each part states how it is drawn (block `style`, metric `bar`, arrow `style`). - **Loader** (`loader.py`) checks a layout against the format rules. A broken file is skipped with a warning, so only its architectures lose the chart. - **Renderer** (`render.py`) replaces the per-architecture `mem_chart_*.py` files and reads the layout fields instead of deriving them. - **README** (`src/memory_chart/README.md`) is the contract: every field, how to draw a layout, the rules a reader can rely on, and where to find each metric's value in the analysis database. - **Tools:** `tools/memory_chart_layout_format.py` (pre-commit formatter) and `tools/memory_chart_preview.py <arch>` (draws a layout without a GPU). Chart changes users will see: - The boxes in the columns share one width, sized to the widest box; arrows are sized to fit their labels and values. - gfx1250 adds instruction cache, scalar data cache, and GL1 latency metrics; gfx115x shows instruction and data cache bandwidth separately. - Percent values get a progress bar on every architecture. - Labels such as the memory type are part of the block title, for example `DRAM (DDR5/LPDDR5)`. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - `tools/memory_chart_preview.py <arch>` for every architecture, with full values, no values, and memory bandwidth stalls. - `rocprof-compute analyze -p <gfx950 workload> -b 3`, with one workload and with two. ## Test Result - 1604 tests pass at the tip; pre-commit passes. - The chart draws for every architecture, and each layout shows every metric of its memory chart panel and no other. - With two workloads, the Memory Chart tables keep their titles. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
lamikr
pushed a commit
that referenced
this pull request
Oct 27, 2026
…analysis db (#12582) ## Motivation ROCm Optiq can draw the memory chart from the analysis database alone. Each workload stores its memory chart layout file unchanged, so the layout file (#12548) is the only memory chart format. Bugfix: a GPU whose layout file was skipped as broken no longer stops the database output. ## Technical Details - New JSON column `compute_workload.memory_chart_layout_extdata`: the workload's layout file, or null when its GPU has no layout. Schema version 2.4.0. - Layout metrics are panel 3 metric names, unique within panel 3. Readers find each value and unit in the existing metric tables; `src/memory_chart/README.md` says how. - No conversion, metric ids, or format version are stored. ## Issue Tracking JIRA ID: AIPROFCOMP-683 ## Test Plan - `python -m pytest tests/unit tools/test_memory_chart_*.py` and project pre-commit. - On real gfx950 workloads (one and two in a database, and with `-b 2`): `analyze --output-format db`, then draw the chart from the database with a reader written only from the README. ## Test Result - 1606 tests pass at the tip; pre-commit passes. - The stored column equals the layout file, and every layout metric finds its value. - The chart drawn from the database matches the terminal `analyze -b 3` chart byte for byte. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
ROCm Optiq can draw the memory chart from the analysis database alone. Each workload stores its memory chart layout file unchanged, so the layout file (#12548) is the only memory chart format.
Bugfix: a GPU whose layout file was skipped as broken no longer stops the database output.
Technical Details
compute_workload.memory_chart_layout_extdata: the workload's layout file, or null when its GPU has no layout. Schema version 2.4.0.src/memory_chart/README.mdsays how.Issue Tracking
JIRA ID: AIPROFCOMP-683
Test Plan
python -m pytest tests/unit tools/test_memory_chart_*.pyand project pre-commit.-b 2):analyze --output-format db, then draw the chart from the database with a reader written only from the README.Test Result
analyze -b 3chart byte for byte.Submission Checklist
🤖 Generated with Claude Code