Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions projects/rocprofiler-compute/docs/how-to/analyze/mode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ profiling. Your level of familiarity with the profiled application, computing
environment, and experience with ROCm Compute Profiler should inform the analysis method you
choose.

.. note::

Analyze mode requires Python 3.9 or newer; its dependencies (numpy, pandas,
dash, textual) drop support for older versions. Profile mode runs on Python
3.8+. See the Python version support table in :doc:`/install/quickstart`.

.. note::

Analyze mode merges separate counter collection files (pmc_perf_*.csv or results_*.csv) into a unified pmc_perf.csv for analysis.
Expand Down
18 changes: 17 additions & 1 deletion projects/rocprofiler-compute/docs/install/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,23 @@ Ensure ROCm is installed and follow the steps:

.. code-block:: shell-session
python3 --version # Requires Python 3.8+
python3 --version
The required Python version depends on which mode you use:

.. list-table:: Python version support
:header-rows: 1
:widths: 40 60

* - Component
- Python requirement
* - Profile mode (standard library only)
- 3.8 or newer
* - Analyze mode (numpy, pandas, dash, textual)
- 3.9 or newer

Analyze mode aborts with a clear message if launched on Python older
than 3.9.
Comment on lines +81 to +82

3. Check the installation dependencies.

Expand Down
4 changes: 3 additions & 1 deletion projects/rocprofiler-compute/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[project]
name = "rocprof_compute"
requires-python = ">=3.9"
# Baseline floor for the project (profile mode). Analyze mode requires >=3.9,
# enforced at runtime in src/rocprof-compute.
requires-python = ">=3.8"

[tool.ruff]
line-length = 88
Expand Down
1 change: 1 addition & 0 deletions projects/rocprofiler-compute/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Analyze mode only. These dependencies require Python >=3.9.
astunparse==1.6.2
dash-bootstrap-components==2.0.4
dash-svg==0.0.12
Expand Down
23 changes: 19 additions & 4 deletions projects/rocprofiler-compute/src/rocprof-compute
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ def check_version(local_ver: str, desired_ver: str, operator: str) -> bool:


def check_python_version() -> None:
"""Check that Python version meets minimum requirement for rocprofiler-compute.
"""Check the baseline Python version required to launch rocprofiler-compute.

Both profile and analyze modes require Python 3.8+.
Profile mode runs on Python 3.8+ (standard library only). Analyze mode has a
higher floor enforced separately in check_analyze_python_version().
"""
min_python = (3, 8)
# Check which version of python is being used
Expand All @@ -75,6 +76,19 @@ def check_python_version() -> None:
sys.exit(1)


def check_analyze_python_version() -> None:
"""Enforce the analyze-mode Python floor (its dependencies require 3.9+)."""
min_python = (3, 9)
if sys.version_info < min_python:
print(

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.

Suggested change
print(
console_error(

and remove the sys.exit(1) on line 89 because it is included in the utils.logger console_error usage.

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.

fixed in: 94db4e5

f"[ERROR] analyze mode requires Python {min_python[0]}.{min_python[1]} "
f"or higher. The current version is "
f"{sys.version_info[0]}.{sys.version_info[1]}. "
f"Profile mode supports Python 3.8+."
)
sys.exit(1)


def verify_deps() -> None:
"""Verify that all required packages from requirements.txt are installed
with correct versions for analyze mode execution.
Expand Down Expand Up @@ -135,7 +149,7 @@ def verify_deps() -> None:
def main() -> None:
"""Main function for rocprofiler-compute"""

# Check Python version requirement applies to both profile and analyze modes
# Baseline Python floor for any mode (profile is 3.8+); analyze adds its own
check_python_version()

rocprof_compute = RocProfCompute()
Expand All @@ -145,7 +159,8 @@ def main() -> None:
if mode == "profile":
rocprof_compute.run_profiler()
elif mode == "analyze":
# Analyze mode requires external dependencies - verify them
# Analyze mode needs a higher Python floor and external dependencies
check_analyze_python_version()
verify_deps()
rocprof_compute.run_analysis()
else:
Expand Down
Loading