Skip to content

Commit 85ab5ba

Browse files
authored
Fix the get_target_compute_version for sm >= 100 (#17716)
1 parent e7c04f5 commit 85ab5ba

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

python/tvm/contrib/nvcc.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,15 @@ def get_target_compute_version(target=None):
292292
target = target or Target.current()
293293
if target and target.arch:
294294
arch = target.arch.split("_")[1]
295-
if len(arch) == 2:
296-
major, minor = arch
297-
return major + "." + minor
298-
elif len(arch) == 3:
295+
if len(arch) < 2:
296+
raise ValueError(f"The arch is not expected {target.arch}")
297+
if arch[-1].isalpha():
299298
# This is for arch like "sm_90a"
300-
major, minor, suffix = arch
299+
suffix = arch[-1]
300+
major = arch[:-2]
301+
minor = arch[-2]
301302
return major + "." + minor + "." + suffix
303+
return arch[:-1] + "." + arch[-1]
302304

303305
# 3. GPU compute version
304306
if tvm.cuda(0).exist:

python/tvm/relax/vm_build.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ def build(
197197
params: Optional[Dict[str, list]]
198198
Parameters for the input IRModule that will be bound.
199199
200-
pipeline : str = "default_build"
201-
The compilation pipeline to use.
200+
relax_pipeline : str = "default"
201+
The Relax compilation pipeline to use.
202+
203+
tir_pipelinie : str = "default"
204+
The TIR compilation pipeline to use.
202205
203206
exec_mode: {"bytecode", "compiled"}
204207
The execution mode.

0 commit comments

Comments
 (0)