-
Notifications
You must be signed in to change notification settings - Fork 297
[hipBLASLt] Check rocisa version before running the generator #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,23 @@ | |
|
|
||
| from .Architectures import SUPPORTED_ISA | ||
|
|
||
| from rocisa import getGitVersion | ||
|
|
||
| # Force version check here | ||
| 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() | ||
|
Comment on lines
+33
to
+45
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this function be in rocisa?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| ################################################################################ | ||
| # Enumerate Valid Solution Parameters | ||
| ################################################################################ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,14 @@ set(CMAKE_CXX_STANDARD 20) | |
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
|
||
| 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}") | ||
|
|
||
|
Comment on lines
+29
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to do this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| if(DEFINED Python_EXECUTABLE AND Python_EXECUTABLE) | ||
| message(STATUS "Manually set Python_EXECUTABLE to ${Python_EXECUTABLE}") | ||
| endif() | ||
|
|
||
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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?