[rocprofiler-compute] Fix inconsistent claimed Python version support#7777
Open
vedithal-amd wants to merge 3 commits into
Open
[rocprofiler-compute] Fix inconsistent claimed Python version support#7777vedithal-amd wants to merge 3 commits into
vedithal-amd wants to merge 3 commits into
Conversation
- 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>
- 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>
Contributor
There was a problem hiding this comment.
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.tomlrequires-pythonto>=3.8to 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( |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tomldeclared 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
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.requires-pythonto>=3.8so the declared floor matches profile mode and ruff's UP target aligns with it (pyproject.toml).requirements.txtas analyze-only and note the>=3.9requirement.JIRA ID
AIPROFCOMP-498
Test Plan
ruff checkandruff format --checkon changedsrc/files.python3 -m py_compile src/rocprof-compute.Test Result
Submission Checklist