From 938ce795bafadf93df6245095aeb64dffcbad4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 13 Oct 2021 14:27:38 +0000 Subject: [PATCH 1/4] tutorial: preprocess.py: Fix leading whitespace This fixes the indentation of metadata in `preprocess.py` in the TVMC tutorial, removing the leading whitespaces in the HTML rendering[^1]. [^1] https://tvm.apache.org/docs/tutorial/tvmc_command_line_driver.html#preprocess-py --- gallery/tutorial/tvmc_command_line_driver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gallery/tutorial/tvmc_command_line_driver.py b/gallery/tutorial/tvmc_command_line_driver.py index 7a0b97895e4f..55a64daa2547 100644 --- a/gallery/tutorial/tvmc_command_line_driver.py +++ b/gallery/tutorial/tvmc_command_line_driver.py @@ -197,8 +197,8 @@ # requirement for the script. # # .. code-block:: python -# :caption: preprocess.py -# :name: preprocess.py +# :caption: preprocess.py +# :name: preprocess.py # # #!python ./preprocess.py # from tvm.contrib.download import download_testdata From c1d60058aab83f4cf096869e2719ed7e9e3c7b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 14 Oct 2021 07:43:36 +0000 Subject: [PATCH 2/4] tutorial: Add missing code block escapes --- gallery/tutorial/autotvm_relay_x86.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gallery/tutorial/autotvm_relay_x86.py b/gallery/tutorial/autotvm_relay_x86.py index 8b9c45c2a859..7597c43e15a9 100644 --- a/gallery/tutorial/autotvm_relay_x86.py +++ b/gallery/tutorial/autotvm_relay_x86.py @@ -278,6 +278,7 @@ from tvm.autotvm.tuner import XGBTuner from tvm import autotvm +################################################################################ # Set up some basic parameters for the runner. The runner takes compiled code # that is generated with a specific set of parameters and measures the # performance of it. ``number`` specifies the number of different @@ -303,6 +304,7 @@ enable_cpu_cache_flush=True, ) +################################################################################ # Create a simple structure for holding tuning options. We use an XGBoost # algorithim for guiding the search. For a production job, you will want to set # the number of trials to be larger than the value of 10 used here. For CPU we @@ -426,6 +428,7 @@ for rank in ranks[0:5]: print("class='%s' with probability=%f" % (labels[rank], scores[rank])) +################################################################################ # Verifying that the predictions are the same: # # .. code-block:: bash From feeab0d13a259c947d9465c586e74c66c45c5971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 14 Oct 2021 08:01:45 +0000 Subject: [PATCH 3/4] tutorial: Grammar fixup --- gallery/tutorial/autotvm_relay_x86.py | 2 +- gallery/tutorial/tensor_expr_get_started.py | 8 ++++---- gallery/tutorial/tvmc_command_line_driver.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gallery/tutorial/autotvm_relay_x86.py b/gallery/tutorial/autotvm_relay_x86.py index 7597c43e15a9..67b832cc226d 100644 --- a/gallery/tutorial/autotvm_relay_x86.py +++ b/gallery/tutorial/autotvm_relay_x86.py @@ -106,7 +106,7 @@ # TVMC has adopted NumPy's ``.npz`` format for both input and output data. # # As input for this tutorial, we will use the image of a cat, but you can feel -# free to substitute image for any of your choosing. +# free to substitute this image for any of your choosing. # # .. image:: https://s3.amazonaws.com/model-server/inputs/kitten.jpg # :height: 224px diff --git a/gallery/tutorial/tensor_expr_get_started.py b/gallery/tutorial/tensor_expr_get_started.py index fda332cb63ba..e4d947d1c488 100644 --- a/gallery/tutorial/tensor_expr_get_started.py +++ b/gallery/tutorial/tensor_expr_get_started.py @@ -133,7 +133,7 @@ ################################################################################ # Let's run the function, and compare the output to the same computation in -# numpy. The compiled TVM function is exposes a concise C API that can be invoked +# numpy. The compiled TVM function exposes a concise C API that can be invoked # from any language. We begin by creating a device, which is a device (CPU in this # example) that TVM can compile the schedule to. In this case the device is an # LLVM CPU target. We can then initialize the tensors in our device and @@ -258,8 +258,8 @@ def evaluate_addition(func, target, optimization, log): print(tvm.lower(s, [A, B, C], simple_mode=True)) ################################################################################ -# Comparing the Diferent Schedules -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Comparing the Different Schedules +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # We can now compare the different schedules baseline = log[0][1] @@ -347,7 +347,7 @@ def evaluate_addition(func, target, optimization, log): fadd = tvm.build(s, [A, B, C], target=tgt_gpu, name="myadd") ################################################################################ - # The compiled TVM function is exposes a concise C API that can be invoked from + # The compiled TVM function exposes a concise C API that can be invoked from # any language. # # We provide a minimal array API in python to aid quick testing and prototyping. diff --git a/gallery/tutorial/tvmc_command_line_driver.py b/gallery/tutorial/tvmc_command_line_driver.py index 55a64daa2547..facb978cea67 100644 --- a/gallery/tutorial/tvmc_command_line_driver.py +++ b/gallery/tutorial/tvmc_command_line_driver.py @@ -174,10 +174,10 @@ # data types. For this reason, most models require some pre and # post-processing, to ensure the input is valid and to interpret the output. # TVMC has adopted NumPy's ``.npz`` format for both input and output data. This -# is a well-supported NumPy format to serialize multiple arrays into a file +# is a well-supported NumPy format to serialize multiple arrays into a file. # # As input for this tutorial, we will use the image of a cat, but you can feel -# free to substitute image for any of your choosing. +# free to substitute this image for any of your choosing. # # .. image:: https://s3.amazonaws.com/model-server/inputs/kitten.jpg # :height: 224px From a4a164342c8a4aab31653f352327648da814b18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Mon, 18 Oct 2021 12:48:25 +0000 Subject: [PATCH 4/4] README.md: Fix link to introduction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09ceb7ab1d07..d96038d17804 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ TVM is licensed under the [Apache-2.0](LICENSE) license. Getting Started --------------- Check out the [TVM Documentation](https://tvm.apache.org/docs/) site for installation instructions, tutorials, examples, and more. -The [Getting Started with TVM](https://tvm.apache.org/docs/tutorials/get_started/introduction.html) tutorial is a great +The [Getting Started with TVM](https://tvm.apache.org/docs/tutorial/introduction.html) tutorial is a great place to start. Contribute to TVM