Skip to content

[rocprofiler-compute] Fix inconsistent claimed Python version support#7777

Open
vedithal-amd wants to merge 3 commits into
rocprofiler-compute-developfrom
users/vedithal-amd/python-version-support-split
Open

[rocprofiler-compute] Fix inconsistent claimed Python version support#7777
vedithal-amd wants to merge 3 commits into
rocprofiler-compute-developfrom
users/vedithal-amd/python-version-support-split

Conversation

@vedithal-amd

@vedithal-amd vedithal-amd commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

The project stated conflicting Python version requirements across components, so a single Python environment could appear valid yet fail at runtime. Most notably, the launcher claimed both modes ran on 3.8 while analyze mode's dependencies (numpy, pandas, dash, textual) require 3.9+, and pyproject.toml declared 3.9 even though profile mode runs fine on 3.8. This PR makes the real contract explicit and consistent: profile mode is 3.8+, analyze mode is 3.9+.

Technical Details

  • Enforce the analyze floor at runtime: check_analyze_python_version() aborts with a clear message when analyze is launched on Python older than 3.9, instead of failing later on a dependency import (src/rocprof-compute). Profile mode keeps the 3.8 baseline.
  • Lower requires-python to >=3.8 so the declared floor matches profile mode and ruff's UP target aligns with it (pyproject.toml).
  • Mark requirements.txt as analyze-only and note the >=3.9 requirement.
  • Document a single Python version support matrix for profile and analyze modes in the quickstart, and add an analyze-mode note pointing to it.

JIRA ID

AIPROFCOMP-498

Test Plan

  • ruff check and ruff format --check on changed src/ files.
  • python3 -m py_compile src/rocprof-compute.
  • Manual: launch analyze on Python 3.8 and confirm the new error; confirm profile mode still runs on 3.8.

Test Result

  • ruff check / format: passed.
  • py_compile: passed.

Submission Checklist

- 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) <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: rocprofiler-compute labels Jun 24, 2026
vedithal-amd and others added 2 commits June 24, 2026 20:11
- 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) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@vedithal-amd vedithal-amd marked this pull request as ready for review June 24, 2026 20:12
@vedithal-amd vedithal-amd requested review from a team and prbasyal-amd as code owners June 24, 2026 20:12
Copilot AI review requested due to automatic review settings June 24, 2026 20:12

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

Aligns and clarifies Python version support for rocprofiler-compute by separating the baseline requirement for profile mode (3.8+) from analyze mode’s higher dependency-driven floor (3.9+), and documenting this contract consistently.

Changes:

  • Adds a runtime check that aborts analyze mode early when run on Python < 3.9.
  • Lowers pyproject.toml requires-python to >=3.8 to match profile mode’s baseline.
  • Updates docs to present a single, explicit Python version support matrix for profile vs analyze modes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/rocprofiler-compute/src/rocprof-compute Adds analyze-mode runtime Python version enforcement (3.9+) while keeping baseline (3.8+).
projects/rocprofiler-compute/requirements.txt Adds an analyze-only/Python>=3.9 note (but currently breaks dependency verification).
projects/rocprofiler-compute/pyproject.toml Lowers declared requires-python to >=3.8 and documents the split contract.
projects/rocprofiler-compute/docs/install/quickstart.rst Adds a Python version support table and notes analyze-mode behavior.
projects/rocprofiler-compute/docs/how-to/analyze/mode.rst Adds an analyze-mode note pointing to the support matrix and clarifying Python 3.9+.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to +82
Analyze mode aborts with a clear message if launched on Python older
than 3.9.
"""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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants