-
Notifications
You must be signed in to change notification settings - Fork 2
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
Draft:Adding new filter rule(Ubuntu 20.04 does not support CUDA <10.2) #50
base: main
Are you sure you want to change the base?
Draft:Adding new filter rule(Ubuntu 20.04 does not support CUDA <10.2) #50
Conversation
I did a mistake in the issue description. CUDA 10.2 and older is not available in Ubuntu 20.04. You can check for |
src/bashi/filter_backend.py
Outdated
@@ -143,6 +143,12 @@ def backend_filter( | |||
return False | |||
break | |||
|
|||
# Rule: b18 | |||
# related to rule | |||
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < pkv.parse("10.2"): |
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.
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < pkv.parse("10.2"): | |
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < pkv.parse("11.0"): |
return False | ||
for compiler in (HOST_COMPILER, DEVICE_COMPILER): | ||
if compiler in row and row[compiler].name == CLANG_CUDA: | ||
if row[compiler].version < CLANG_CUDA_MAX_CUDA_VERSION[3].clang_cuda: |
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.
Good point, that you check also for Clang-CUDA
:-) Thanks correct and didn't thought about it.
Unfortunately, there is no guaranty that CLANG_CUDA_MAX_CUDA_VERSION
keeps his ordering. Therefore you need to replace the direct access with a search function. Otherwise your code could silently break, if somebody modifies the CLANG_CUDA_MAX_CUDA_VERSION
list. You need to implement the following function:
def get_max_supported_clang_cuda_ver(cuda_ver : str) -> str:
""" returns the latest supported clang-cuda version for a given cuda version"
# implement search algorithm
# don't expect specific ordering of the list CLANG_CUDA_MAX_CUDA_VERSION
# implement also tests
Implement the function in the version.py
.
By the way, an entry of CLANG_CUDA_MAX_CUDA_VERSION
stores only string. Therefore you need to parse the version. At the moment, you compare version objects with strings, which is always wrong.
The versions in ClangCudaSDKSupport
are already parsed and stored as packaging.version.Version
.
Lines 51 to 64 in cc789bd
class ClangCudaSDKSupport(VersionSupportBase): | |
"""Contains a nvcc version and host compiler version. Does automatically parse the input strings | |
to package.version.Version. | |
Provides comparision operators for sorting. | |
""" | |
def __init__(self, clang_cuda_version: str, cuda_version: str): | |
VersionSupportBase.__init__(self, clang_cuda_version, cuda_version) | |
self.clang_cuda = self.version1 | |
self.cuda = self.version2 | |
def __str__(self) -> str: | |
return f"Clang-CUDA {str(self.clang_cuda)} + CUDA SDK {self.cuda}" |
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 suggest that the interface takes a string and the first step is parsing it to a version object. Makes the function call easier:
# expected string as argument (preferred version)
get_max_supported_clang_cuda_ver("11.2")
# expected version object as argument
get_max_supported_clang_cuda_ver(pkv.parse("11.2")
# implementation for the preferred version
def get_max_supported_clang_cuda_ver(cuda_ver : str) -> str:
""" returns the latest supported clang-cuda version for a given cuda version"
parsed_cuda_ver: pkv.Version = pkv.parse(cuda_ver)
# implement search algorithm
# don't expect specific ordering of the list CLANG_CUDA_MAX_CUDA_VERSION
# implement also tests
src/bashi/results.py
Outdated
@@ -792,3 +793,31 @@ def _remove_unsupported_cmake_versions_for_clangcuda( | |||
value_name2=CMAKE, | |||
value_version2=">3.18", | |||
) | |||
|
|||
|
|||
def _remove_unsupported_cuda_versions_for_ubuntu( |
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.
This function needs also to remove unsupported device compiler nvcc + ubuntu 18.04
combinations and clang-cuda + ubuntu 18.04
. I saw that the example.py misses the following combinations:
ParameterValuePair(first=ParameterValueSingle(parameter='device_compiler', parameterValue=ParameterValue(name='nvcc', version=<Version('10.0')>)), second=ParameterValueSingle(parameter='ubuntu', parameterValue=ParameterValue(name='ubuntu', version=<Version('20.4')>))) is missing in combination list
ParameterValuePair(first=ParameterValueSingle(parameter='device_compiler', parameterValue=ParameterValue(name='nvcc', version=<Version('10.1')>)), second=ParameterValueSingle(parameter='ubuntu', parameterValue=ParameterValue(name='ubuntu', version=<Version('20.4')>))) is missing in combination list
But we cannot install CUDA 10.0 and 10.1 on Ubuntu 20.04
I strongly recommend to fix the function For example the |
3327500
to
164477f
Compare
src/bashi/results.py
Outdated
parameter_value_pairs_ranges: List[ParameterValuePair], | ||
removed_parameter_value_pairs: List[ParameterValuePair], | ||
): | ||
removed_parameter_value_pairs( | ||
parameter_value_pairs_ranges, | ||
removed_parameter_value_pairs, |
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.
Instead calling the new function, you simply renamed the variable.
parameter_value_pairs_ranges: List[ParameterValuePair], | |
removed_parameter_value_pairs: List[ParameterValuePair], | |
): | |
removed_parameter_value_pairs( | |
parameter_value_pairs_ranges, | |
removed_parameter_value_pairs, | |
parameter_value_pairs: List[ParameterValuePair], | |
removed_parameter_value_pairs: List[ParameterValuePair], | |
): | |
remove_parameter_value_pairs_ranges( | |
parameter_value_pairs, | |
removed_parameter_value_pairs, |
fix: #32