You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "FrozenGene (via GitHub)" <gi...@apache.org> on 2023/03/22 05:13:18 UTC
[GitHub] [tvm] FrozenGene commented on a diff in pull request #14274: [Unity][Transform] SplitCallTIRByPattern and CUTLASS backend
FrozenGene commented on code in PR #14274:
URL: https://github.com/apache/tvm/pull/14274#discussion_r1144234538
##########
python/tvm/contrib/cc.py:
##########
@@ -231,6 +233,20 @@ def _linux_compile(output, objects, options, compile_cmd, compile_shared=False):
else:
if compile_shared or output.endswith(".so") or output.endswith(".dylib"):
cmd += ["--shared"]
+
+ compute_version = "".join(
+ get_target_compute_version(Target.current(allow_none=True)).split(".")
+ )
+ cmd += ["-gencode", f"arch=compute_{compute_version},code=sm_{compute_version}"]
+ cmd += ["-O3"]
+ cmd += ["-std=c++17"]
+ cmd += ["-Xcompiler=-fPIC"]
+ cmd += ["-Xcompiler=-fno-strict-aliasing"]
+ cmd += ["-t 24"]
+ cmd += ["-DCUTLASS_ENABLE_TENSOR_CORE_MMA=1"]
+ cmd += ["-Xcompiler=-Wconversion"]
+ cmd += ["--use_fast_math"]
Review Comment:
doesn't make sense we enable fast math by default. We should control it using one option and should set it false by default.
##########
python/tvm/contrib/cc.py:
##########
@@ -231,6 +233,20 @@ def _linux_compile(output, objects, options, compile_cmd, compile_shared=False):
else:
if compile_shared or output.endswith(".so") or output.endswith(".dylib"):
cmd += ["--shared"]
+
+ compute_version = "".join(
+ get_target_compute_version(Target.current(allow_none=True)).split(".")
+ )
+ cmd += ["-gencode", f"arch=compute_{compute_version},code=sm_{compute_version}"]
+ cmd += ["-O3"]
+ cmd += ["-std=c++17"]
+ cmd += ["-Xcompiler=-fPIC"]
+ cmd += ["-Xcompiler=-fno-strict-aliasing"]
+ cmd += ["-t 24"]
Review Comment:
Should add the guard of CUDA version check >= 11.2 and to get the real cpu cores: refer this:https://github.com/apache/tvm/blob/main/python/tvm/contrib/cutlass/build.py#L72
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org