Skip to content

Commit 317b994

Browse files
authored
[Doc] Update build-from-source instructions (#3345)
This PR updates the build-from-source instructions of MLC and TVM.
1 parent 558b764 commit 317b994

File tree

13 files changed

+66
-58
lines changed

13 files changed

+66
-58
lines changed

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ Steps to reproduce the behavior:
3131
- Operating system (e.g. Ubuntu/Windows/MacOS/...):
3232
- Device (e.g. iPhone 12 Pro, PC+RTX 3090, ...)
3333
- How you installed MLC-LLM (`conda`, source):
34-
- How you installed TVM-Unity (`pip`, source):
34+
- How you installed TVM (`pip`, source):
3535
- Python version (e.g. 3.10):
3636
- GPU driver version (if applicable):
3737
- CUDA/cuDNN version (if applicable):
38-
- TVM Unity Hash Tag (`python -c "import tvm; print('\n'.join(f'{k}: {v}' for k, v in tvm.support.libinfo().items()))"`, applicable if you compile models):
38+
- TVM Hash Tag (`python -c "import tvm; print('\n'.join(f'{k}: {v}' for k, v in tvm.support.libinfo().items()))"`, applicable if you compile models):
3939
- Any other relevant information:
4040

4141
## Additional context

docs/community/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ This is a list of Frequently Asked Questions (FAQ) about the MLC-LLM. Feel free
1212
Please check our :doc:`/compilation/configure_quantization` tutorial.
1313

1414
... Why do I encounter an error ``free(): invalid pointer, Aborted (core dumped)`` at the end of model compilation?
15-
This happens if you compiled TVM-Unity from source and didn't hide LLVM symbols in cmake configurations.
16-
Please follow our instructions in :ref:`Building TVM Unity from Source <tvm-unity-build-from-source>` tutorial to compile TVM-Unity which hides LLVM symbols, or use our pre-built MLC-LLM :doc:`pip wheels <../install/mlc_llm>`.
15+
This happens if you compiled TVM from source and didn't hide LLVM symbols in cmake configurations.
16+
Please follow our instructions in :ref:`Building TVM from Source <tvm-build-from-source>` tutorial to compile TVM which hides LLVM symbols, or use our pre-built MLC-LLM :doc:`pip wheels <../install/mlc_llm>`.

docs/compilation/compile_models.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ or be used to explicit create model libraries.
2929
We compile ``RedPajama-INCITE-Chat-3B-v1`` with ``q4f16_1`` as an example for all platforms.
3030

3131
.. note::
32-
Before you proceed, make sure you followed :ref:`install-tvm-unity`, a required
32+
Before you proceed, make sure you followed :ref:`install-tvm`, a required
3333
backend to compile models with MLC LLM.
3434

3535
Please also follow the instructions in :ref:`deploy-cli` / :ref:`deploy-python-engine` to obtain
@@ -40,7 +40,7 @@ We compile ``RedPajama-INCITE-Chat-3B-v1`` with ``q4f16_1`` as an example for al
4040
:depth: 1
4141
:local:
4242

43-
0. Verify Installation
43+
1. Verify Installation
4444
----------------------
4545

4646
**Step 1. Verify mlc_llm**
@@ -60,13 +60,13 @@ installing the prebuilt package. Verify ``mlc_llm`` installation in command line
6060

6161
**Step 2. Verify TVM**
6262

63-
To compile models, you also need to follow :ref:`install-tvm-unity`.
64-
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-unity-validate`):
63+
To compile models, you also need to follow :ref:`install-tvm`.
64+
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-validate`):
6565

6666
.. code:: bash
6767
6868
$ python -c "import tvm; print(tvm.__file__)"
69-
/some-path/lib/python3.11/site-packages/tvm/__init__.py
69+
/some-path/lib/python3.13/site-packages/tvm/__init__.py
7070
7171
1. Clone from HF and convert_weight
7272
-----------------------------------

docs/compilation/convert_weights.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This can be extended to, e.g.:
1717
- Add ``Llama-2-uncensored`` when MLC already supports Llama-2
1818

1919
.. note::
20-
Before you proceed, make sure you followed :ref:`install-tvm-unity`, a required
20+
Before you proceed, make sure you followed :ref:`install-tvm`, a required
2121
backend to compile models with MLC LLM.
2222

2323
Please also follow the instructions in :ref:`deploy-cli` / :ref:`deploy-python-engine` to obtain
@@ -30,7 +30,7 @@ This can be extended to, e.g.:
3030

3131
.. _verify_installation_for_compile:
3232

33-
0. Verify installation
33+
1. Verify installation
3434
----------------------
3535

3636
**Step 1. Verify mlc_llm**
@@ -50,13 +50,13 @@ installing the prebuilt package. Verify ``mlc_llm`` installation in command line
5050

5151
**Step 2. Verify TVM**
5252

53-
To compile models, you also need to follow :ref:`install-tvm-unity`.
54-
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-unity-validate`):
53+
To compile models, you also need to follow :ref:`install-tvm`.
54+
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-validate`):
5555

5656
.. code:: bash
5757
5858
$ python -c "import tvm; print(tvm.__file__)"
59-
/some-path/lib/python3.11/site-packages/tvm/__init__.py
59+
/some-path/lib/python3.13/site-packages/tvm/__init__.py
6060
6161
6262
1. Clone from HF and convert_weight

docs/compilation/package_libraries_and_weights.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Introduction
1818
------------
1919

2020
To use ``mlc_llm package``, we must clone the source code of `MLC LLM <https://github.com/mlc-ai/mlc-llm>`_
21-
and `install the MLC LLM and TVM Unity package <https://llm.mlc.ai/docs/install/mlc_llm.html#option-1-prebuilt-package>`_.
21+
and `install the MLC LLM and TVM package <https://llm.mlc.ai/docs/install/mlc_llm.html#option-1-prebuilt-package>`_.
2222
Depending on the app we build, there might be some other dependencies, which are described in
2323
corresponding :ref:`iOS <deploy-ios>` and :ref:`Android <deploy-android>` tutorials.
2424

docs/deploy/android.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Prerequisite
3939
ANDROID_NDK: %HOME%/AppData/Local/Android/Sdk/ndk/27.0.11718014
4040
TVM_NDK_CC: %ANDROID_NDK%/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android24-clang
4141
42-
**JDK**, such as OpenJDK >= 17, to compile Java bindings of TVM Unity runtime.
42+
**JDK**, such as OpenJDK >= 17, to compile Java bindings of TVM runtime.
4343
We strongly recommend setting the ``JAVA_HOME`` to the JDK bundled with Android Studio.
4444
e.g.
4545
``export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home`` for macOS.
@@ -52,7 +52,7 @@ Set up the following environment variable:
5252

5353
Please ensure that the JDK versions for Android Studio and JAVA_HOME are the same.
5454

55-
**TVM Unity runtime** is placed under `3rdparty/tvm <https://github.com/mlc-ai/mlc-llm/tree/main/3rdparty>`__ in MLC LLM, so there is no need to install anything extra. Set up the following environment variable:
55+
**TVM runtime** is placed under `3rdparty/tvm <https://github.com/mlc-ai/mlc-llm/tree/main/3rdparty>`__ in MLC LLM, so there is no need to install anything extra. Set up the following environment variable:
5656

5757
- ``export TVM_SOURCE_DIR=/path/to/mlc-llm/3rdparty/tvm``.
5858

@@ -71,7 +71,7 @@ Check if **environment variable** are properly set as the last check. One way to
7171
export ANDROID_NDK=... # Android NDK toolchain
7272
export TVM_NDK_CC=... # Android NDK clang
7373
export JAVA_HOME=... # Java
74-
export TVM_SOURCE_DIR=... # TVM Unity runtime
74+
export TVM_SOURCE_DIR=... # TVM runtime
7575
7676
Additional Guides for Windows Users
7777
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

docs/deploy/ios.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ Please make sure ``dist/`` follows the structure below, except the optional mode
8888
│ ├── mlc-app-config.json # The app config JSON file.
8989
│ └── [optional model weights]
9090
└── lib
91-
├── libmlc_llm.a # A lightweight interface to interact with LLM, tokenizer, and TVM Unity runtime.
91+
├── libmlc_llm.a # A lightweight interface to interact with LLM, tokenizer, and TVM runtime.
9292
├── libmodel_iphone.a # The compiled model lib.
9393
├── libsentencepiece.a # SentencePiece tokenizer
9494
├── libtokenizers_cpp.a # Huggingface tokenizer.
95-
└── libtvm_runtime.a # TVM Unity runtime.
95+
└── libtvm_runtime.a # TVM runtime.
9696
9797
9898
.. note::

docs/deploy/webllm.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ installing the prebuilt package. Verify ``mlc_llm`` installation in command line
106106

107107
**Step 2. Verify TVM**
108108

109-
To compile models, you also need to follow :ref:`install-tvm-unity`.
110-
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-unity-validate`):
109+
To compile models, you also need to follow :ref:`install-tvm`.
110+
Here we verify ``tvm`` quickly with command line (for full verification, see :ref:`tvm-validate`):
111111

112112
.. code:: bash
113113
114114
$ python -c "import tvm; print(tvm.__file__)"
115-
/some-path/lib/python3.11/site-packages/tvm/__init__.py
115+
/some-path/lib/python3.13/site-packages/tvm/__init__.py
116116
117117
118118
.. _webllm-add-model-variant:

docs/install/emcc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Step 2: Set TVM_SOURCE_DIR and MLC_LLM_SOURCE_DIR
3737
-------------------------------------------------
3838

3939
We need to set a path to a tvm source in order to build tvm runtime.
40-
Note that you do not need to build tvm unity from the source. The source here is only used to build the web runtime component.
40+
Note that you do not need to build TVM from the source. The source here is only used to build the web runtime component.
4141
Set environment variable in your shell startup profile in to point to ``3rdparty/tvm`` (if preferred, you could also
4242
point to your own TVM address if you installed TVM from source).
4343

docs/install/gpu.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ After installation, you can run ``vulkaninfo`` in command line and see if you ca
105105
Vulkan SDK
106106
----------
107107

108-
Vulkan SDK is required for compiling models to Vulkan backend. To build TVM Unity compiler from source, you will need to install Vulkan SDK as a dependency, but our :doc:`pre-built wheels <../install/mlc_llm>` already ships with Vulkan SDK.
108+
Vulkan SDK is required for compiling models to Vulkan backend. To build TVM compiler from source, you will need to install Vulkan SDK as a dependency, but our :doc:`pre-built wheels <../install/mlc_llm>` already ships with Vulkan SDK.
109109

110110
Check Vulkan SDK installation guide according to your platform:
111111

@@ -127,7 +127,7 @@ Check Vulkan SDK installation guide according to your platform:
127127
128128
`Getting Started with the macOS Vulkan SDK <https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html>`__
129129
130-
Please refer to installation and setup page for next steps to build TVM-Unity from source.
130+
Please refer to installation and setup page for next steps to build TVM from source.
131131

132132
OpenCL SDK
133133
----------

0 commit comments

Comments
 (0)