From bb2eaaff6d1f5e82bef0290b5e8809a85610b8dd Mon Sep 17 00:00:00 2001
From: Yifan Zhao <yifanz16@illinois.edu>
Date: Tue, 6 Apr 2021 04:23:49 -0500
Subject: [PATCH] Updated requirements and some more

---
 hpvm/docs/install.rst | 63 +++++++++++++++++++++++++++++--------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/hpvm/docs/install.rst b/hpvm/docs/install.rst
index e13b30450b..192b392765 100644
--- a/hpvm/docs/install.rst
+++ b/hpvm/docs/install.rst
@@ -4,26 +4,30 @@ Install
 Dependencies
 ------------
 
-The following components are required to be installed on your machine to build HPVM.
+* The following components are mandatory for building HPVM:
 
-* GCC (>=5.1)
+   * GCC (>=5.1)
 
-  * In addition, each version of CUDA-nvcc requires GCC to be not newer than a certain version.
-    See `here <https://gist.github.com/ax3l/9489132>`_ for the support matrix.
+   * CMake (>=3.17)
 
-* CMake (>=3.17)
+   * GNU Make (>=3.79) or Ninja (>=1.10)
 
-* GNU Make (>=3.79)
+   * Python (>=3.6) with pip (>=20)
 
-* OpenCL (>=1.0.0)
+      * Python must be strictly 3.6 (any subversion from 3.6.0 to 3.6.13).
 
-* CUDA (>=9.0, <=10.2) with CUDNN 7
+* OpenCL (>=1.0.0) is required for compiling HPVM-C code on GPU; otherwise, only CPU is available.
 
-  * CUDNN 7 is unsupported beyond CUDA 10.2 (starting from CUDA 11)
+* The following components are required to build support for Tensor-domain applications
+  introduced in `ApproxHPVM <https://dl.acm.org/doi/10.1145/3360612>`_:
 
-* Python (==3.6) with pip (>=20)
+   * CUDA (>=9.0, <=10.2) with CUDNN 7
+
+      * CUDNN 7 is unsupported beyond CUDA 10.2 (starting from CUDA 11)
+   
+   * In addition, each version of CUDA-nvcc requires GCC to be not newer than a certain version.
+     See `here <https://gist.github.com/ax3l/9489132>`_ for the support matrix.
 
-  * Python must be strictly 3.6 (any subversion from 3.6.0 to 3.6.13).
 
 Python Environment
 ^^^^^^^^^^^^^^^^^^
@@ -34,7 +38,7 @@ as HPVM will install a few Python packages during this installation process.
 * Some HPVM Python packages contains executables. If you don't use a virtual environment,
   these executables are installed to your local ``bin`` directory, usually ``$HOME/.local/bin``.
   Please ensure this directory is in your `$PATH` variable.
-  Below it is assumed that these executables are visible throught `$PATH`.
+  Below it is assumed that these executables are visible through `$PATH`.
 
 If you use Anaconda for package management,
 we provide a conda environment file that covers all Python and package requirements
@@ -91,10 +95,10 @@ the directory ``hpvm/projects/predtuner`` should be empty,
 which can be fixed with ``git submodule update --recursive --init``.
 
 HPVM needs to be able to find CUDA.
-If CUDA is installed in your system's $PATH (e.g. if it was installed at the default location),
+If CUDA is installed in your system's `$PATH` (e.g. if it was installed at the default location),
 HPVM can find CUDA automatically.
 
-Use HPVM installer script to download, configure and build HPVM along with LLVM and Clang:
+Use HPVM installer script to download extra components, configure and build HPVM:
 
 .. code-block:: shell
 
@@ -104,8 +108,8 @@ Use HPVM installer script to download, configure and build HPVM along with LLVM
   Alternatively, use ``./install.sh -h`` for a list of available arguments
   and pass arguments as required.
 
-* ``./install.sh`` supports Ninja, a substitute of Make that is considered to build faster
-  on many IO-bottlenecked devices.
+* ``./install.sh`` supports `Ninja <https://ninja-build.org/>`_,
+  a substitute of Make that is considered to build faster on many IO-bottlenecked devices.
   Passing ``--ninja`` to the installer tells it to use Ninja instead of Make.
 
 * ``./install.sh`` can relay additional arguments to CMake, but the dash must be dropped
@@ -122,14 +126,33 @@ Use HPVM installer script to download, configure and build HPVM along with LLVM
 
 After configuring HPVM,
 the installer will also compile HPVM by default, which you can opt out of.
+(You can see this option in both the prompt and the ``-h`` help menu.)
 If you do so, follow the next section "Manually Build HPVM" to manually compile HPVM,
 and "Benchmarks and Tests" to manually run test cases if you wish so.
 Otherwise, you can skip the next 2 sections.
 
-* Specifically, the HPVM installer downloads LLVM, and Clang, copies HPVM source into
-  llvm/tools and builds the entire tree. It also builds a modified LLVM C-Backend,
-  based on the one maintained by `Julia Computing <https://github.com/JuliaComputing/llvm-cbe>`_,
-  as a part of HPVM and is currently used to generate OpenCL kernels for GPUs.
+How Does the Installer Work
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The HPVM installer performs the following tasks:
+
+* downloads and decompresses LLVM and Clang into `hpvm/llvm`,
+
+* links HPVM source code into ``hpvm/llvm/tools/hpvm``,
+
+* downloads DNN model parameters to ``test/dnn_benchmarks/model_params`` (this step is optional -- you can opt out of it),
+
+* installs a few Python packages: the PyTorch frontend, the Keras frontend, the predictive tuner,
+  and the HPVM profiler, (this step is optional),
+
+* builds the entire HPVM which provides `hpvm-clang`, HPVM's main compilation interface,
+
+  * The build system builds HPVM, creates a Python package `hpvmpy` (which provides the binary `hpvm-clang`)
+    *on the fly*, and installs it to your current Python environment.
+
+* and finally, builds and runs some tests if you explicitly require so.
+
+  * While running tests is recommended, it is not turned on by default as it is very time-consuming.
 
 TroubleShooting
 ^^^^^^^^^^^^^^^
-- 
GitLab