diff --git a/LICENSE b/LICENSE index f6126d011a9a..b23afba158af 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -192,7 +192,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/README.md b/README.md index fb9e9bc4a0d1..387c16cb97d8 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - + diff --git a/docs/how_to/tutorials/customize_opt.py b/docs/how_to/tutorials/customize_opt.py index 2e2747d61fc5..9c87e18ac61c 100644 --- a/docs/how_to/tutorials/customize_opt.py +++ b/docs/how_to/tutorials/customize_opt.py @@ -1,4 +1,4 @@ -# Licensed to the Apache Software Foundation (ASF) under one +# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file @@ -55,6 +55,12 @@ from tvm import IRModule, relax from tvm.relax.frontend import nn +# Note: This tutorial requires TVM to be built with CUDA support. +# If you encounter 'No module named ''tvm_ffi''' error, +# you need to build TVM from source with CUDA enabled. +# Build instructions: https://tvm.apache.org/docs/install/from_source.html + + ###################################################################### # Composable IRModule Optimization # -------------------------------- @@ -103,9 +109,17 @@ def forward(self, x): # Import cublas pattern -import tvm.relax.backend.cuda.cublas as _cublas - - +try: + import tvm.relax.backend.cuda.cublas as _cublas +except ImportError as e: + if "tvm_ffi" in str(e): + import sys + print("Error: TVM needs to be built with CUDA support.", file=sys.stderr) + print("Please build TVM from source with CUDA enabled.", file=sys.stderr) + print("See: https://tvm.apache.org/docs/install/from_source.html", file=sys.stderr) + sys.exit(1) + else: + raise # Define a new pass for CUBLAS dispatch @tvm.transform.module_pass(opt_level=0, name="CublasDispatch") class CublasDispatch: @@ -223,3 +237,6 @@ def transform_module(self, mod: IRModule, _ctx: tvm.transform.PassContext) -> IR # of the computation graph. The flexibility of the optimization pipeline enables us to quickly # iterate the optimization and improve the performance of the model. # + + +