Skip to content

Commit a76c7b1

Browse files
authored
tweak version (#2954)
1 parent 190ad2c commit a76c7b1

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools", "setuptools-scm"]
2+
requires = ["setuptools"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -36,4 +36,4 @@ ck4inductor = "python/ck4inductor"
3636
"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"]
3737

3838
[tool.setuptools.dynamic]
39-
version = { attr = "setuptools_scm.get_version" }
39+
version = { attr = "ck4inductor.__version__" }

python/ck4inductor/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def __version__():
2+
import subprocess
3+
4+
# needs to be manually updated
5+
rocm_version = "7.0.1"
6+
hash_width = 6
7+
try:
8+
hash = subprocess.check_output("git rev-parse HEAD", shell=True, text=True)[
9+
:hash_width
10+
]
11+
except:
12+
hash = "0" * hash_width
13+
try:
14+
change_count = subprocess.check_output(
15+
f"git rev-list rocm-{rocm_version}..HEAD --count", shell=True, text=True
16+
).strip()
17+
except:
18+
change_count = "0"
19+
return f"{rocm_version}.dev{change_count}+g{hash}"

0 commit comments

Comments
 (0)