From bd8081cce9bbe955cfdf38c5695a9a2f94ff6e41 Mon Sep 17 00:00:00 2001 From: Vignesh Edithal Date: Wed, 24 Jun 2026 20:01:29 +0000 Subject: [PATCH 1/5] [rocprofiler-compute] Clarify Python version support per mode - Enforce analyze mode's Python 3.9 floor at runtime; profile mode stays 3.8+ (standard library only), so 3.8 users get a clear error instead of a downstream dependency import failure. - Lower pyproject requires-python to >=3.8 to match the real project floor and align ruff's UP target with profile mode. - Document the per-mode Python support matrix in the quickstart and add an analyze-mode note; annotate requirements.txt as analyze-only (>=3.9). Co-Authored-By: Claude Opus 4 (1M context) --- .../docs/how-to/analyze/mode.rst | 6 +++++ .../docs/install/quickstart.rst | 23 +++++++++++++++- projects/rocprofiler-compute/pyproject.toml | 4 ++- projects/rocprofiler-compute/requirements.txt | 1 + .../rocprofiler-compute/src/rocprof-compute | 27 ++++++++++++++++--- 5 files changed, 55 insertions(+), 6 deletions(-) diff --git a/projects/rocprofiler-compute/docs/how-to/analyze/mode.rst b/projects/rocprofiler-compute/docs/how-to/analyze/mode.rst index 70ba4f4190c..3577528697c 100644 --- a/projects/rocprofiler-compute/docs/how-to/analyze/mode.rst +++ b/projects/rocprofiler-compute/docs/how-to/analyze/mode.rst @@ -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. diff --git a/projects/rocprofiler-compute/docs/install/quickstart.rst b/projects/rocprofiler-compute/docs/install/quickstart.rst index c8cb23cd276..79476c220ee 100644 --- a/projects/rocprofiler-compute/docs/install/quickstart.rst +++ b/projects/rocprofiler-compute/docs/install/quickstart.rst @@ -63,7 +63,28 @@ 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 + * - Torch-trace profiling + - Profile mode floor, plus ROCm roctx bindings built for the + active interpreter + * - Standalone binary build + - exactly 3.11.x (build time only) + + Analyze mode aborts with a clear message if launched on Python older + than 3.9. 3. Check the installation dependencies. diff --git a/projects/rocprofiler-compute/pyproject.toml b/projects/rocprofiler-compute/pyproject.toml index 27180f7e390..4fe1069ad40 100644 --- a/projects/rocprofiler-compute/pyproject.toml +++ b/projects/rocprofiler-compute/pyproject.toml @@ -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 diff --git a/projects/rocprofiler-compute/requirements.txt b/projects/rocprofiler-compute/requirements.txt index e3c5e5bd28d..6485a0e75c8 100644 --- a/projects/rocprofiler-compute/requirements.txt +++ b/projects/rocprofiler-compute/requirements.txt @@ -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 diff --git a/projects/rocprofiler-compute/src/rocprof-compute b/projects/rocprofiler-compute/src/rocprof-compute index 0a57ae63213..11b4a3756a4 100755 --- a/projects/rocprofiler-compute/src/rocprof-compute +++ b/projects/rocprofiler-compute/src/rocprof-compute @@ -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 @@ -75,6 +76,23 @@ def check_python_version() -> None: sys.exit(1) +def check_analyze_python_version() -> None: + """Enforce the analyze-mode Python floor. + + Analyze mode depends on numpy, pandas, dash, and textual, whose current + pinned versions require Python 3.9+. Profile mode is unaffected. + """ + min_python = (3, 9) + if sys.version_info < min_python: + print( + 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. @@ -135,7 +153,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() @@ -145,7 +163,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: From 6eae86aab06b28cf0a3187d99b48f60011c02105 Mon Sep 17 00:00:00 2001 From: Vignesh Edithal Date: Wed, 24 Jun 2026 20:11:16 +0000 Subject: [PATCH 2/5] [rocprofiler-compute] Drop non-advertised rows from version matrix - Keep the end-user Python support matrix limited to profile and analyze modes; remove torch-trace and standalone-binary entries. Co-Authored-By: Claude Opus 4 (1M context) --- projects/rocprofiler-compute/docs/install/quickstart.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/projects/rocprofiler-compute/docs/install/quickstart.rst b/projects/rocprofiler-compute/docs/install/quickstart.rst index 79476c220ee..b6f89e877f8 100644 --- a/projects/rocprofiler-compute/docs/install/quickstart.rst +++ b/projects/rocprofiler-compute/docs/install/quickstart.rst @@ -77,11 +77,6 @@ Ensure ROCm is installed and follow the steps: - 3.8 or newer * - Analyze mode (numpy, pandas, dash, textual) - 3.9 or newer - * - Torch-trace profiling - - Profile mode floor, plus ROCm roctx bindings built for the - active interpreter - * - Standalone binary build - - exactly 3.11.x (build time only) Analyze mode aborts with a clear message if launched on Python older than 3.9. From b4d1f6fbb6e6097e8e828f2b785a284239dafd27 Mon Sep 17 00:00:00 2001 From: Vignesh Edithal Date: Wed, 24 Jun 2026 20:11:59 +0000 Subject: [PATCH 3/5] [rocprofiler-compute] Trim analyze version-check docstring Co-Authored-By: Claude Opus 4 (1M context) --- projects/rocprofiler-compute/src/rocprof-compute | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof-compute b/projects/rocprofiler-compute/src/rocprof-compute index 11b4a3756a4..e09359c63d6 100755 --- a/projects/rocprofiler-compute/src/rocprof-compute +++ b/projects/rocprofiler-compute/src/rocprof-compute @@ -77,11 +77,7 @@ def check_python_version() -> None: def check_analyze_python_version() -> None: - """Enforce the analyze-mode Python floor. - - Analyze mode depends on numpy, pandas, dash, and textual, whose current - pinned versions require Python 3.9+. Profile mode is unaffected. - """ + """Enforce the analyze-mode Python floor (its dependencies require 3.9+).""" min_python = (3, 9) if sys.version_info < min_python: print( From 94db4e5a48ec540e45b78a59b8600b87d28cafb1 Mon Sep 17 00:00:00 2001 From: Xuan Chen Date: Thu, 25 Jun 2026 14:53:05 -0400 Subject: [PATCH 4/5] [rocprofiler-compute] Use console_error and skip comments in verify_deps --- .../rocprofiler-compute/src/rocprof-compute | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/projects/rocprofiler-compute/src/rocprof-compute b/projects/rocprofiler-compute/src/rocprof-compute index e09359c63d6..5d9e0a35ccb 100755 --- a/projects/rocprofiler-compute/src/rocprof-compute +++ b/projects/rocprofiler-compute/src/rocprof-compute @@ -67,26 +67,24 @@ def check_python_version() -> None: min_python = (3, 8) # Check which version of python is being used if sys.version_info < min_python: # noqa: UP036 - print( - f"[ERROR] Python {min_python[0]}.{min_python[1]} or higher " - f"is required for rocprofiler-compute. " - f"The current version is " + console_error( + f"Python {min_python[0]}.{min_python[1]} or higher " + "is required for rocprofiler-compute. " + "The current version is " f"{sys.version_info[0]}.{sys.version_info[1]}." ) - 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( - f"[ERROR] analyze mode requires Python {min_python[0]}.{min_python[1]} " - f"or higher. The current version is " + console_error( + f"analyze mode requires Python {min_python[0]}.{min_python[1]} " + "or higher. The current version is " f"{sys.version_info[0]}.{sys.version_info[1]}. " - f"Profile mode supports Python 3.8+." + "Profile mode supports Python 3.8+." ) - sys.exit(1) def verify_deps() -> None: @@ -108,6 +106,9 @@ def verify_deps() -> None: version_pattern = re.compile(r"^([^=<>]+)([=<>]+)(.*)$") for dependency in dependencies: + dependency = dependency.strip() + if not dependency or dependency.startswith("#"): + continue match = version_pattern.match(dependency) if match: package, operator, desired_version = match.groups() @@ -118,9 +119,10 @@ def verify_deps() -> None: local_version = metadata.distribution(package).version except metadata.PackageNotFoundError: error = True - print( - f"[ERROR] The '{dependency}' package was not found " - "in the current execution environment." + console_error( + f"The '{dependency}' package was not found " + "in the current execution environment.", + exit=False, ) continue @@ -128,21 +130,22 @@ def verify_deps() -> None: if desired_version and not check_version( local_version, desired_version, operator ): - print( - f"[ERROR] the '{dependency}' distribution does not meet " + console_error( + f"the '{dependency}' distribution does not meet " "version requirements to use rocprofiler-compute." + f"\n --> version installed : {local_version}", + exit=False, ) - print(f" --> version installed : {local_version}") error = True if error: - print( + console_error( "\nPlease verify all of the python dependencies called out " "in the requirements file" + "\nare installed locally prior to running " + "rocprofiler-compute." + f"\n\nSee: {check_file}" ) - print("are installed locally prior to running rocprofiler-compute.") - print(f"\nSee: {check_file}") - sys.exit(1) return From d3ae6f90bf15ee504c51eae752f337f0f653f843 Mon Sep 17 00:00:00 2001 From: Xuan Chen Date: Thu, 25 Jun 2026 14:57:07 -0400 Subject: [PATCH 5/5] [rocprofiler-compute] Add changelog entry for per-mode Python version split --- projects/rocprofiler-compute/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/rocprofiler-compute/CHANGELOG.md b/projects/rocprofiler-compute/CHANGELOG.md index 88dc4220349..dd5ee13ea0f 100644 --- a/projects/rocprofiler-compute/CHANGELOG.md +++ b/projects/rocprofiler-compute/CHANGELOG.md @@ -22,6 +22,8 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs. ### Changed +* Split Python version requirements by mode. Profile mode now runs on Python 3.8+ (standard library only). Analyze mode requires Python 3.9+ and exits with a clear message on older interpreters instead of failing with an import error. + * Renamed the `Pct of Peak` / `PoP` analysis column to `Percent of Peak` in analysis output. * Moved `--gui` and `--tui` analyze options to experimental status. These features now require the `--experimental` flag to be enabled (e.g., `rocprof-compute analyze --experimental --gui`).