areusch commented on a change in pull request #9971:
URL: https://github.com/apache/tvm/pull/9971#discussion_r793165293



##########
File path: docs/README.md
##########
@@ -16,52 +16,61 @@
 <!--- under the License. -->
 
 # TVM Documentation
+
 This folder contains the source of TVM's documentation, hosted at 
https://tvm.apache.org/docs
 
 ## Build Locally
 
-See also the instructions below to run a specific tutorial. Note that some of 
the tutorials need GPU support. Once build, either of these can be served using 
Python's build in HTTP server:
+### With Docker (recommended)
 
-```bash
-# Run this and then visit http://localhost:8000 in your browser
-cd docs/_build/html && python3 -m http.server
-```
+1. Build TVM and the docs inside the [tlcpack/ci-gpu 
image](https://hub.docker.com/r/tlcpack/ci-gpu) using the 
[`ci.py`](../tests/scripts/ci.py) script.
 
-### With Docker (recommended)
+   ```bash
+   # If this runs into errors, try cleaning your 'build' directory
+   python tests/scripts/ci.py docs
 
-1. Build TVM and the docs inside the [tlcpack/ci-gpu 
image](https://hub.docker.com/r/tlcpack/ci-gpu)
+   # See other doc building options
+   python tests/scripts/ci.py docs --help
+   ```
 
-    ```bash
-    # If this runs into errors, try cleaning your 'build' directory
-    make docs
-    ```
+2. Serve the docs and visit http://localhost:8000 in your browser
 
+   ```bash
+   # Run an HTTP server you can visit to view the docs in your browser
+   python tests/scripts/ci.py serve-docs
+   ```
 
 ### Native
 
 1. [Build TVM](https://tvm.apache.org/docs/install/from_source.html) first in 
the repo root folder
 2. Install dependencies
 
-    ```bash
-    # Pillow on Ubuntu may require libjpeg-dev from apt
-    docker run tlcpack/ci-gpu:v0.78 bash -c \
-        'python3 -m pip install --quiet tlcpack-sphinx-addon==0.2.1 
synr==0.5.0 && python3 -m pip freeze' > frozen-requirements.txt
+   ```bash
+   # Pillow on Ubuntu may require libjpeg-dev from apt
+   docker run tlcpack/ci-gpu:v0.78 bash -c \

Review comment:
       should this be docker/bash.sh ci_gpu to avoid the version?

##########
File path: tests/scripts/task_python_docs.sh
##########
@@ -34,14 +32,78 @@ cleanup()
 }
 trap cleanup 0
 
-# cleanup old states
-rm -rf docs/_build
-rm -rf docs/_staging
-mkdir -p docs/_build/html
-mkdir -p docs/_staging/html
-rm -rf docs/gen_modules
-rm -rf docs/doxygen
+clean_files() {
+    # cleanup old states
+    rm -rf docs/_build
+    rm -rf docs/_staging
+    mkdir -p docs/_build/html
+    mkdir -p docs/_staging/html
+    rm -rf docs/gen_modules
+    rm -rf docs/doxygen
+    find . -type f -path "*.pyc" | xargs rm -f
+}
+
+sphinx_precheck() {
+    clean_files
+    echo "PreCheck sphinx doc generation WARNINGS.."
+    make cython3
+
+    pushd docs
+    make clean
+    TVM_TUTORIAL_EXEC_PATTERN=none make html 2>&1 | tee /tmp/$$.log.txt
+    check_sphinx_warnings "docs"
+    popd
+}
+
+
+function join_by { local IFS="$1"; shift; echo "$*"; }
+
+IGNORED_WARNINGS=(
+    '__mro__'

Review comment:
       could you add a comment explaining why these are ignored, and which 
piece of the warning string these match? i.e if I want to add one here, what do 
i do?

##########
File path: tests/scripts/task_python_docs.sh
##########
@@ -34,14 +32,78 @@ cleanup()
 }
 trap cleanup 0
 
-# cleanup old states
-rm -rf docs/_build
-rm -rf docs/_staging
-mkdir -p docs/_build/html
-mkdir -p docs/_staging/html
-rm -rf docs/gen_modules
-rm -rf docs/doxygen
+clean_files() {
+    # cleanup old states
+    rm -rf docs/_build
+    rm -rf docs/_staging
+    mkdir -p docs/_build/html
+    mkdir -p docs/_staging/html
+    rm -rf docs/gen_modules
+    rm -rf docs/doxygen
+    find . -type f -path "*.pyc" | xargs rm -f
+}
+
+sphinx_precheck() {
+    clean_files
+    echo "PreCheck sphinx doc generation WARNINGS.."
+    make cython3
+
+    pushd docs
+    make clean
+    TVM_TUTORIAL_EXEC_PATTERN=none make html 2>&1 | tee /tmp/$$.log.txt
+    check_sphinx_warnings "docs"
+    popd
+}
+
+
+function join_by { local IFS="$1"; shift; echo "$*"; }
+
+IGNORED_WARNINGS=(
+    '__mro__'
+    'UserWarning'
+    'FutureWarning'
+    'tensorflow'
+    'Keras'
+    'pytorch'
+    'TensorFlow'
+    'coremltools'
+    '403'
+    'git describe'
+    'scikit-learn version'
+    'doing serial write'
+    'gen_gallery extension is not safe for parallel'
+    'strategy:conv2d NHWC layout is not optimized for x86 with autotvm.'
+    'strategy:depthwise_conv2d NHWC layout is not optimized for x86 with 
autotvm.'
+    'autotvm:Cannot find config for target=llvm -keys=cpu -link-params=0'
+    'autotvm:One or more operators have not been tuned. Please tune your model 
for better performance. Use DEBUG logging level to see more details.'
+    'autotvm:Cannot find config for target=cuda -keys=cuda,gpu'
+)
+
+JOINED_WARNINGS=$(join_by '|' "${IGNORED_WARNINGS[@]}")

Review comment:
       this is a little perilous as they aren't escaped. wdyt about doing this 
in python and then we could add tests?




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to