2024-11-01 12:20:21 -04:00
# ROCm Compute Profiler
2022-11-04 14:49:36 -05:00
## General
2024-07-31 10:42:27 -04:00
2024-11-01 12:20:21 -04:00
ROCm Compute Profiler is a system performance profiling tool for machine
2022-11-04 14:49:36 -05:00
learning/HPC workloads running on AMD MI GPUs. The tool presently
2024-05-09 14:36:45 +00:00
targets usage on MI100, MI200, and MI300 accelerators.
2022-11-04 14:49:36 -05:00
* For more information on available features, installation steps, and
workload profiling and analysis, please refer to the online
2024-11-01 12:20:21 -04:00
[documentation ](https://rocm.docs.amd.com/projects/rocprofiler-compute/en/latest/ ).
2022-11-04 14:49:36 -05:00
2024-11-01 12:20:21 -04:00
* ROCm Compute Profiler is an AMD open source research project and is not supported
2022-11-04 14:49:36 -05:00
as part of the ROCm software stack. We welcome contributions and
feedback from the community. Please see the
[CONTRIBUTING.md ](CONTRIBUTING.md ) file for additional details on our
contribution process.
2025-09-10 14:46:39 -05:00
* Licensing information can be found in the [LICENSE ](LICENSE.md ) file.
2022-11-04 14:49:36 -05:00
2024-03-21 13:11:43 -04:00
## Development
2022-11-04 14:49:36 -05:00
2025-10-15 15:32:54 -04:00
ROCm Compute Profiler is now included in the rocm-systems super-repo. The latest sources are in the `develop` branch. You can find particular releases in the `release/rocm-rel-X.Y` branch for the paricular release you're looking for.
2022-11-04 14:49:36 -05:00
2025-10-15 15:32:54 -04:00
### Pulling the source using sparse-checkout
Being in the super-repo, if you only want to pull the source for a particular project, do a sparse checkout:
```bash
git clone --no-checkout --filter= blob:none https://github.com/ROCm/rocm-systems.git
cd rocm-systems
git sparse-checkout init --cone
git sparse-checkout set projects/rocprofiler-compute
git checkout develop
cd rocprofiler-compute
python3 -m pip install -r requirements.txt
```
2022-11-04 14:49:36 -05:00
2025-01-04 21:52:06 -05:00
## Testing
2025-10-01 01:18:41 +05:30
Populate the <usename> variable in `docker/docker-compose.customrocmtest.yml` .
Populate the <rocm_build_image> variable in `docker/Dockerfile.customrocmtest` based on latest ROCm CI build information.
2025-07-15 17:06:22 -04:00
2025-01-04 21:52:06 -05:00
To quickly get the environment (bash shell) for building and testing, run the following commands:
2025-02-20 17:51:57 -05:00
* `cd docker`
2025-10-01 01:18:41 +05:30
* If the docker image is not available on the machine, then build the image, otherwise skip this step: `docker compose -f docker-compose.customrocmtest.yml build`
* Launch the container, and check the name of the container: `docker compose -f docker-compose.customrocmtest.yml up --force-recreate -d `
* Run bash shell on the launched container: `docker exec -it <container_name> bash`
* If testing is done, kill the container: `docker container kill <container_name>`
2025-01-04 21:52:06 -05:00
2025-10-01 01:18:41 +05:30
Inside the docker container, clean, build, then install the project with tests enabled:
2025-01-04 21:52:06 -05:00
```
rm -rf build install && cmake -B build -D CMAKE_INSTALL_PREFIX=install -D ENABLE_TESTS=ON -D INSTALL_TESTS=ON -DENABLE_COVERAGE=ON -S . && cmake --build build --target install --parallel 8
```
Note that per the above command, build assets will be stored under `build` directory and installed assets will be stored under `install` directory.
2025-10-01 01:18:41 +05:30
Then, to run the automated test suite, run the following commands:
2025-01-04 21:52:06 -05:00
```
2025-10-01 01:18:41 +05:30
mkdir build
2025-01-04 21:52:06 -05:00
ctest
```
For manual testing, you can find the executable at `install/bin/rocprof-compute`
2025-02-20 17:51:57 -05:00
## Standalone binary
To create a standalone binary, run the following commands:
* `cd docker`
2025-08-25 07:57:08 -04:00
* `docker compose -f docker-compose.standalone.yml build`
2025-03-03 16:57:39 -05:00
* `docker compose -f docker-compose.standalone.yml up --force-recreate -d && docker attach docker-standalone-1`
2025-02-20 17:51:57 -05:00
You should find the rocprof-compute.bin standalone binary inside the `build` folder in the root directory of the project.
To build the binary we follow these steps:
2025-08-25 07:57:08 -04:00
* Use RHEL 8.10 docker image as the base image
* Install python3.9
* Install runtime dependencies
* Install dependencies for building standalone binary
2025-02-20 17:51:57 -05:00
* Call the make target which uses Nuitka to build the standalone binary
NOTE: Since RHEL 8 ships with glibc version 2.28, this standalone binary can only be run on environment with glibc version greater than 2.28.
glibc version can be checked using `ldd --version` command.
2025-08-14 14:12:24 -04:00
NOTE: libnss3.so shared library is required when using --roof-only option which generates roofline data in PDF format
2025-02-20 17:51:57 -05:00
To test the standalone binary provide the `--call-binary` option to pytest.
2022-11-11 16:53:03 -06:00
## How to Cite
2022-12-12 14:33:25 -05:00
This software can be cited using a Zenodo
[DOI ](https://doi.org/10.5281/zenodo.7314631 ) reference. A BibTex
2022-12-12 15:55:49 -06:00
style reference is provided below for convenience:
```
2023-05-31 10:31:39 -05:00
@software{xiaomin_lu_2022_7314631
2022-12-12 15:55:49 -06:00
author = {Xiaomin Lu and
Cole Ramos and
Fei Zheng and
Karl W. Schulz and
2023-02-22 11:10:55 -06:00
Jose Santos and
2023-05-31 10:31:39 -05:00
Keith Lowery and
2023-08-17 10:39:05 -05:00
Nicholas Curtis and
2023-05-31 10:31:39 -05:00
Cristian Di Pietrantonio},
2025-02-11 12:46:33 -05:00
title = {ROCm/rocprofiler-compute: v3.1.0 (12 February 2025)},
month = February,
year = 2025,
2022-12-12 15:55:49 -06:00
publisher = {Zenodo},
2025-02-11 12:46:33 -05:00
version = {v3.1.0},
2022-12-13 16:01:59 -06:00
doi = {10.5281/zenodo.7314631},
url = {https://doi.org/10.5281/zenodo.7314631}
2022-12-12 15:55:49 -06:00
}
```