Skip to content

[hipBLASLt] Check rocisa version before running the generator#617

Closed
KKyang wants to merge 1 commit into
developfrom
users/kkyang/ver_check
Closed

[hipBLASLt] Check rocisa version before running the generator#617
KKyang wants to merge 1 commit into
developfrom
users/kkyang/ver_check

Conversation

@KKyang
Copy link
Copy Markdown
Contributor

@KKyang KKyang commented Jul 14, 2025

If someone choose to use pip install rocisa instead of using the auto-generated shell script, to prevent the user using an outdated rocisa, thus we add a commit hash check.

raise RuntimeError(f"rocisa version mismatch: C++ version {cppVersion} != Python version {pyVersion}. Please rebuild rocisa.")
print(f"rocisa version {cppVersion} (git commit hash) is same as Python version {pyVersion}")

verifyRocisaVersion()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellosel Is there a place that is good for running this code and make sure all entrance (Tensile, TensileCreateLibrary, etc.) will trigger the check?

Copy link
Copy Markdown
Contributor

@davidd-amd davidd-amd Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it belongs in an init. I think that would prevent it from running multiple times.

Copy link
Copy Markdown
Contributor Author

@KKyang KKyang Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find a proper function to run this. Any recommendations?

jichangjichang pushed a commit to jichangjichang/rocm-libraries that referenced this pull request Jul 14, 2025
@bstefanuk
Copy link
Copy Markdown
Contributor

I don't love the unconditional subprocess spawn, but I understand it's guarding against an error state.

I'm curious, how would one end up in this error state? If you build through the typical documented measures would this problem arise?

@davidd-amd
Copy link
Copy Markdown
Contributor

I don't love the unconditional subprocess spawn, but I understand it's guarding against an error state.

I'm curious, how would one end up in this error state? If you build through the typical documented measures would this problem arise?

Can you add this comment to a diff?

Comment on lines +29 to +36
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE ROCISA_GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_compile_definitions(ROCISA_GIT_COMMIT_HASH="${ROCISA_GIT_COMMIT_HASH}")

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.

Why do we need to do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the commit hash when compiling, so we can compare with the generator to make sure they are using the same commit.

@davidd-amd
Copy link
Copy Markdown
Contributor

@KKyang please add a description so we understand why these changes are necessary. What problem are you solving?

Comment on lines +33 to +45
def verifyRocisaVersion():
import subprocess
def getGitVersionPython():
return subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD']
).decode('ascii').strip()
cppVersion = getGitVersion()
pyVersion = getGitVersionPython()
if cppVersion != pyVersion:
raise RuntimeError(f"rocisa version mismatch: C++ version {cppVersion} != Python version {pyVersion}. Please rebuild rocisa.")
print(f"rocisa version {cppVersion} (git commit hash) is same as Python version {pyVersion}")

verifyRocisaVersion()
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.

Should this function be in rocisa?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we need both. The hash from rocisa and the hash from the generator. Then we compare.

ammallya pushed a commit that referenced this pull request Jul 22, 2025
Bumps [rocm-docs-core](https://github.com/ROCm/rocm-docs-core) from 1.18.4 to 1.19.0.
- [Release notes](https://github.com/ROCm/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v1.18.4...v1.19.0)

---
updated-dependencies:
- dependency-name: rocm-docs-core
  dependency-version: 1.19.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

[ROCm/hipSPARSE commit: 6df87c3]
ammallya pushed a commit that referenced this pull request Jul 31, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity (30 days with no updates).

If you'd like to continue working on this, feel free to reopen the PR or create a new one.

@github-actions github-actions Bot closed this Apr 29, 2026
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