Skip to content

[rocpd] Refactor to use python to convert rocpd to CSV + add CSV tests + remove old cpp implementation#159

Merged
yhuiYH merged 44 commits into
developfrom
import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer
Sep 19, 2025
Merged

[rocpd] Refactor to use python to convert rocpd to CSV + add CSV tests + remove old cpp implementation#159
yhuiYH merged 44 commits into
developfrom
import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer

Conversation

@systems-assistant

Copy link
Copy Markdown
Contributor

PR Details

Associated Jira Ticket Number/Link

https://ontrack-internal.amd.com/browse/SWDEV-543953

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Continuous Integration

Technical details

Added/updated tests?

  • Yes
  • No, Does not apply to this PR.

Updated CHANGELOG?

  • Yes
  • No, Does not apply to this PR.

Added/Updated documentation?

  • Yes
  • No, Does not apply to this PR.

🔁 Imported from ROCm/rocprofiler-sdk#102
🧑‍💻 Originally authored by @rocm-devops

ammallya pushed a commit that referenced this pull request Aug 7, 2025
* Adding Roctx usage doc

* updated CHANGELOG

* dpc update

* Fixing Related Pages issue

* updating doc

* updating docs

* Adding Resource naming section

* Fixed Formatting

* format fix

* format fix

* Fixing build due to incorrect indentation

[ROCm/rocprofiler-sdk commit: 12508b9]
ywang103-amd pushed a commit to ywang103-amd/rocm-systems that referenced this pull request Aug 7, 2025
…inx (ROCm#159)

Bumps [rocm-docs-core[api_reference]](https://github.com/ROCm/rocm-docs-core) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.18.1...v1.18.2)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-version: 1.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[ROCm/rocprofiler-systems commit: 7f2b198]
systems-assistant Bot pushed a commit that referenced this pull request Aug 10, 2025
systems-assistant Bot pushed a commit that referenced this pull request Aug 10, 2025
@amd-atumakae amd-atumakae force-pushed the import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer branch from 547b8cf to 14fd46e Compare August 12, 2025 10:50
@ammarwa

ammarwa commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

Code Coverage Report

Code Coverage Report

Tests Only

code coverage tests.png

Samples Only

code coverage samples.png

Tests + Samples

code coverage all.png

@amd-atumakae amd-atumakae requested a review from yhuiYH August 12, 2025 14:05
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/source/types.hpp Outdated
Comment thread projects/rocprofiler-sdk/source/share/rocprofiler-sdk-rocpd/data_views.sql Outdated
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
@yhuiYH yhuiYH changed the title [rocpd] CSV python writer [rocpd] Refactor to use python to convert rocpd to CSV + add CSV tests + remove old cpp implementation Aug 13, 2025
yhuiYH
yhuiYH previously approved these changes Aug 13, 2025

Copilot AI 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.

Pull Request Overview

This pull request refactors the rocpd CSV generation functionality from C++ to Python, adding comprehensive CSV testing and removing the old C++ implementation. The refactor aims to simplify the codebase by leveraging Python for CSV generation while maintaining the same output format.

Key Changes:

  • Replaced C++ CSV generation with Python implementation using SQL queries
  • Added comprehensive CSV validation tests that compare CSV output with JSON data
  • Removed old C++ CSV-related files and CMake configurations

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
projects/rocprofiler-sdk/tests/rocprofv3/rocpd/validate.py Added test_csv_data function for validating CSV output against JSON data
projects/rocprofiler-sdk/tests/rocprofv3/rocpd/conftest.py Added csv_data fixture to handle CSV input files for testing
projects/rocprofiler-sdk/tests/rocprofv3/rocpd/CMakeLists.txt Updated test command to include CSV files in validation
projects/rocprofiler-sdk/tests/pytest-packages/tests/rocprofv3.py Added comprehensive CSV validation logic with time sanity checks and data matching
projects/rocprofiler-sdk/source/lib/python/rocpd/source/csv.hpp Removed C++ CSV header file
projects/rocprofiler-sdk/source/lib/python/rocpd/source/csv.cpp Removed C++ CSV implementation file
projects/rocprofiler-sdk/source/lib/python/rocpd/source/CMakeLists.txt Updated source lists to exclude CSV C++ files
projects/rocprofiler-sdk/source/lib/python/rocpd/libpyrocpd.cpp Removed C++ write_csv function binding
projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Added complete Python CSV generation implementation with SQL-based queries

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread projects/rocprofiler-sdk/tests/pytest-packages/tests/rocprofv3.py
Comment thread projects/rocprofiler-sdk/tests/pytest-packages/tests/rocprofv3.py
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
Comment thread projects/rocprofiler-sdk/tests/rocprofv3/rocpd/CMakeLists.txt Outdated
@amd-atumakae amd-atumakae force-pushed the import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer branch from 36bfe80 to ae50865 Compare August 14, 2025 18:45
Comment thread projects/rocprofiler-sdk/source/lib/python/rocpd/csv.py Outdated
@amd-atumakae amd-atumakae requested a review from jrmadsen August 15, 2025 12:20
jayhawk-commits pushed a commit that referenced this pull request Aug 18, 2025
jayhawk-commits pushed a commit that referenced this pull request Aug 18, 2025
@jrmadsen jrmadsen force-pushed the import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer branch from 73dba93 to c324883 Compare September 16, 2025 16:41
@yhuiYH yhuiYH merged commit 3f001b0 into develop Sep 19, 2025
28 of 39 checks passed
@yhuiYH yhuiYH deleted the import/develop/ROCm_rocprofiler-sdk/atumakae_csv_python_writer branch September 19, 2025 14:15
systems-assistant Bot pushed a commit to ROCm/rocprofiler-sdk that referenced this pull request Sep 19, 2025
 CSV tests + remove old cpp implementation (#159)

* Write agent info to CSV

* Write kernel to CSV

* Write memory copy to CSV

* Write memory allocation to CSV

* Write hip api to CSV

* Write hsa api to CSV

* Write marker api to CSV

* Write counters to CSV

* Write scratch memory to CSV

* Write rccl api to CSV

* Write rocdecode api to CSV

* Write rocjpeg api to CSV

* Remove info_process joins

* Format agent id

* Compose full file name is sql writer function

* Add missing fields to kernel traces csv

* Rename vgpr_count to arch_vgpr_count

* Fix kernel name

* Skip empty query results

* Format csv.py

* Delete c++ CSV writer

* Add CSV header comparison test

* Fix comment spacing in csv.py

* Change ALLOC to ALLOCATE in memory allocation writer

* Do not append trace to agent info file name

* Revert changes for VGPR_Count

* Fix csv validation test

* Add sorting by guid

* Use EXISTS to check query results are not empty

* Merge API-specific queries

* Optimize regions query

* Column name mapping for agent info

* Pass config to sql writer

* Move agent id string building to a separate function

* add titled_headers argument

* Remove titled-columns argument

* Improvements for regions csv

* fix CSV validation test

* improve CSV validation test

* remove roctxMarkA from csv validation test

* fix capability field titles in agent info

* remove filter.py from query as that is still experimental

* Remove some aliases, now that query will auto-title the column headers
[rocm-systems] ROCm/rocm-systems#159 (commit 3f001b0)
sauverma93 pushed a commit that referenced this pull request Sep 26, 2025
…s + remove old cpp implementation (#159)

* Write agent info to CSV

* Write kernel to CSV

* Write memory copy to CSV

* Write memory allocation to CSV

* Write hip api to CSV

* Write hsa api to CSV

* Write marker api to CSV

* Write counters to CSV

* Write scratch memory to CSV

* Write rccl api to CSV

* Write rocdecode api to CSV

* Write rocjpeg api to CSV

* Remove info_process joins

* Format agent id

* Compose full file name is sql writer function

* Add missing fields to kernel traces csv

* Rename vgpr_count to arch_vgpr_count

* Fix kernel name

* Skip empty query results

* Format csv.py

* Delete c++ CSV writer

* Add CSV header comparison test

* Fix comment spacing in csv.py

* Change ALLOC to ALLOCATE in memory allocation writer

* Do not append trace to agent info file name

* Revert changes for VGPR_Count

* Fix csv validation test

* Add sorting by guid

* Use EXISTS to check query results are not empty

* Merge API-specific queries

* Optimize regions query

* Column name mapping for agent info

* Pass config to sql writer

* Move agent id string building to a separate function

* add titled_headers argument

* Remove titled-columns argument

* Improvements for regions csv

* fix CSV validation test

* improve CSV validation test

* remove roctxMarkA from csv validation test

* fix capability field titles in agent info

* remove filter.py from query as that is still experimental

* Remove some aliases, now that query will auto-title the column headers

---------

Co-authored-by: Aleksei Tumakaev <atumakae@amd.com>
Co-authored-by: Young Hui <young.hui@amd.com>
Co-authored-by: Young Hui - AMD <145490163+yhuiYH@users.noreply.github.com>
ryang-amd pushed a commit that referenced this pull request Nov 7, 2025
…s + remove old cpp implementation (#159)

* Write agent info to CSV

* Write kernel to CSV

* Write memory copy to CSV

* Write memory allocation to CSV

* Write hip api to CSV

* Write hsa api to CSV

* Write marker api to CSV

* Write counters to CSV

* Write scratch memory to CSV

* Write rccl api to CSV

* Write rocdecode api to CSV

* Write rocjpeg api to CSV

* Remove info_process joins

* Format agent id

* Compose full file name is sql writer function

* Add missing fields to kernel traces csv

* Rename vgpr_count to arch_vgpr_count

* Fix kernel name

* Skip empty query results

* Format csv.py

* Delete c++ CSV writer

* Add CSV header comparison test

* Fix comment spacing in csv.py

* Change ALLOC to ALLOCATE in memory allocation writer

* Do not append trace to agent info file name

* Revert changes for VGPR_Count

* Fix csv validation test

* Add sorting by guid

* Use EXISTS to check query results are not empty

* Merge API-specific queries

* Optimize regions query

* Column name mapping for agent info

* Pass config to sql writer

* Move agent id string building to a separate function

* add titled_headers argument

* Remove titled-columns argument

* Improvements for regions csv

* fix CSV validation test

* improve CSV validation test

* remove roctxMarkA from csv validation test

* fix capability field titles in agent info

* remove filter.py from query as that is still experimental

* Remove some aliases, now that query will auto-title the column headers

---------

Co-authored-by: Aleksei Tumakaev <atumakae@amd.com>
Co-authored-by: Young Hui <young.hui@amd.com>
Co-authored-by: Young Hui - AMD <145490163+yhuiYH@users.noreply.github.com>
ammallya pushed a commit that referenced this pull request Nov 21, 2025
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
ammallya pushed a commit that referenced this pull request Nov 21, 2025
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>

[ROCm/amdsmi commit: de6f49b]
ammallya pushed a commit that referenced this pull request Jan 21, 2026
* Refactor `Barrier_all` and `Sync_all` to use default context

- Removed context-specific implementations of barrier_all and sync_all
- Added barrier_all and sync_all to the default context implementation
- Updated functional tests to use the default context for barrier_all and sync_all

* Update `Barrier_all` and `Sync_all` API usage in documentation

* Update `CHANGELOG`

---------

Co-authored-by: Yiltan <ytemucin@amd.com>
ammallya pushed a commit that referenced this pull request Jan 21, 2026
* Refactor `Barrier_all` and `Sync_all` to use default context

- Removed context-specific implementations of barrier_all and sync_all
- Added barrier_all and sync_all to the default context implementation
- Updated functional tests to use the default context for barrier_all and sync_all

* Update `Barrier_all` and `Sync_all` API usage in documentation

* Update `CHANGELOG`

---------

Co-authored-by: Yiltan <ytemucin@amd.com>

[ROCm/rocshmem commit: bf48bca]
ammallya pushed a commit that referenced this pull request Jan 30, 2026
…159)

* Improve the memory pool logic to enable the reuse of VA-API surfaces.

* Update the version
ammallya pushed a commit that referenced this pull request Jan 30, 2026
…159)

* Improve the memory pool logic to enable the reuse of VA-API surfaces.

* Update the version

[ROCm/rocjpeg commit: 6046873]
ammallya pushed a commit that referenced this pull request Apr 9, 2026
ammallya pushed a commit that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants