comaniac commented on a change in pull request #7063:
URL: https://github.com/apache/tvm/pull/7063#discussion_r539685119



##########
File path: python/tvm/contrib/nvcc.py
##########
@@ -269,15 +269,34 @@ def have_int8(compute_version):
     return False
 
 
-def have_tensorcore(compute_version):
+def have_tensorcore(compute_version=None, target=None):
     """Either TensorCore support is provided in the compute capability or not
 
     Parameters
     ----------
-    compute_version : str
-        compute capability of a GPU (e.g. "7.0")
+    compute_version : str, optional
+        compute capability of a GPU (e.g. "7.0").
+
+    target : tvm.target.Target, optional
+        The compilation target, will be used to determine arch if 
compute_version
+        isn't specified.
     """
+    if compute_version is None:
+        if tvm.gpu(0).exist:
+            compute_version = tvm.gpu(0).compute_version
+        else:
+            if target is None or "arch" not in target.attrs:
+                warnings.warn(
+                    "Cannot find cuda architecture, try specifying it by 
adding '-arch=sm_xx'"
+                    "to your target. Tensorcore schedules will be disabled."

Review comment:
       ```suggestion
                       "Tensorcore will be disabled due to no CUDA architecture 
specified.
                       Try specifying it by adding '-arch=sm_xx' to your 
target."
   ```




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to