Make docs build again when not everything is enabled (#6386)
authorAndrew Reusch <areusch@octoml.ai>
Thu, 3 Sep 2020 01:43:49 +0000 (18:43 -0700)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 01:43:49 +0000 (18:43 -0700)
tutorials/language/extern_op.py
tutorials/optimize/opt_matmul_auto_tensorcore.py

index 64e9880..c20339d 100644 (file)
@@ -36,6 +36,9 @@ from tvm import te
 import numpy as np
 from tvm.contrib import cblas
 
+if not tvm.get_global_func("tvm.contrib.cblas.matmul", allow_missing=True):
+    raise Exception("Not compiled with cblas support; can't build this tutorial")
+
 ######################################################################
 # Use Extern Tensor Function
 # --------------------------
index 7dbd475..30be723 100644 (file)
@@ -237,13 +237,11 @@ def test_gemm(N, L, M, dtype, layout):
 
 # check whether the gpu has tensorcore
 if not tvm.gpu(0).exist or not tvm.runtime.enabled("cuda"):
-  print("skip because cuda is not enabled..")
-  sys.exit(0)
+  raise Exception("skip building this tutorial because cuda is not enabled..")
 
 ctx = tvm.gpu()
 if not nvcc.have_tensorcore(ctx.compute_version):
-  print('the gpu has no tensorcore, skipping...')
-  sys.exit(0)
+  raise Exception("the gpu has no tensorcore, skipping...")
 
 M, N, L = 512, 32, 512
 dtype = 'float16'