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



##########
File path: python/tvm/contrib/nvcc.py
##########
@@ -269,15 +270,24 @@ def have_int8(compute_version):
     return False
 
 
-def have_tensorcore(compute_version):
+def have_tensorcore(compute_version=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")
     """
+    if compute_version is None:
+        if tvm.gpu(0).exist:
+            compute_version = tvm.gpu(0).compute_version
+        else:
+            compute_version = AutotvmGlobalScope.current.cuda_target_arch

Review comment:
       I was expecting something like:
   
   ```python
   with tvm.transform.PassContext(opt_level=3, 
config={"relay.backend.cuda_target_arch": "sm_75"}):
       lib = relay.build(mod, target=target, params=params)
   ```
   
   And in `ncvv.py`:
   
   ```python
   cuda_target_arch = 
PassContext.current().config.get("relay.backend.cuda_target_arch", "sm_75")
   major, minor = cuda_target_arch.split("_")[1]
   compute_version = major + "." + minor
   ```
   
   Does that make sense to you?
   If so, you may refer to a recent PR I sent, which adds 
"relay.backend.use_auto_scheduler" to PassContext: 
https://github.com/apache/tvm/pull/6903




----------------------------------------------------------------
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:
[email protected]


Reply via email to