tweak version (#2954)

[ROCm/composable_kernel commit: a76c7b1028]
This commit is contained in:
Max Podkorytov
2025-10-01 15:00:41 -07:00
committed by GitHub
parent fecad5a998
commit d6dc70c711
2 changed files with 21 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
@@ -36,4 +36,4 @@ ck4inductor = "python/ck4inductor"
"ck4inductor.library" = ["src/tensor_operation_instance/gpu/gemm_universal/**/*.hpp", "src/tensor_operation_instance/gpu/gemm_universal_batched/**/*.hpp", "include/ck/library/tensor_operation_instance/gpu/grouped_conv_fwd/**/*.hpp"]
[tool.setuptools.dynamic]
version = { attr = "setuptools_scm.get_version" }
version = { attr = "ck4inductor.__version__" }

View File

@@ -0,0 +1,19 @@
def __version__():
import subprocess
# needs to be manually updated
rocm_version = "7.0.1"
hash_width = 6
try:
hash = subprocess.check_output("git rev-parse HEAD", shell=True, text=True)[
:hash_width
]
except:
hash = "0" * hash_width
try:
change_count = subprocess.check_output(
f"git rev-list rocm-{rocm_version}..HEAD --count", shell=True, text=True
).strip()
except:
change_count = "0"
return f"{rocm_version}.dev{change_count}+g{hash}"