Skip to content

Commit 218f643

Browse files
GregoryComerfacebook-github-bot
authored andcommitted
Make minor updates to LLM guide setup instructions (#2940)
Summary: Minor updates to the prerequisite section of the LLM getting started guide. Passing -s to pyenv install prevents a prompt if python 3.10 is already installed (it will just silently continue in this case when the flag is passed). Additionally, under pyenv, we should be using python, not python3. I also added a little bit of wording on env management. Pull Request resolved: #2940 Test Plan: Ran LLM guide prerequisite section on an m1 mac with pyenv-virtualenv. Reviewed By: byjlw Differential Revision: D55913382 Pulled By: GregoryComer fbshipit-source-id: 7f04262b025db83b8621c972c90d3cdc3f029377
1 parent 99c4f4e commit 218f643

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

docs/source/llm/getting-started.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
## Prerequisites
1616

1717
To follow this guide, you'll need to clone the ExecuTorch repository and install dependencies.
18-
ExecuTorch requires Python 3.10, as well as This example uses
19-
conda to manage the Python environment.
18+
ExecuTorch recommends Python 3.10 and the use of Conda to manage your environment. Conda is not
19+
required, though be aware that you may need to replace the use of python/pip with python3/pip3
20+
depending on your environment.
2021

2122
::::{tab-set}
2223
:::{tab-item} conda
@@ -57,7 +58,7 @@ eval "$(pyenv virtualenv-init -)"
5758
mkdir et-nanogpt
5859
cd et-nanogpt
5960
60-
pyenv install 3.10
61+
pyenv install -s 3.10
6162
pyenv virtualenv 3.10 executorch
6263
pyenv activate executorch
6364
@@ -68,8 +69,8 @@ cd third-party/executorch
6869
git submodule update --init
6970
7071
# Install requirements.
71-
pip3 install cmake zstd
72-
./install_requirements.sh
72+
pip install cmake zstd
73+
PYTHON_EXECUTABLE=python ./install_requirements.sh
7374
7475
cd ../..
7576
```
@@ -328,7 +329,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
328329
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "" ON)
329330
option(EXECUTORCH_BUILD_EXTENSION_MODULE "" ON)
330331
option(EXECUTORCH_BUILD_OPTIMIZED "" ON)
331-
option(EXECUTORCH_BUILD_XNNPACK "" ON)
332332
333333
# Include the executorch subdirectory.
334334
add_subdirectory(
@@ -409,6 +409,24 @@ et_program = edge_manager.to_executorch()
409409

410410
```
411411

412+
Additionally, update CMakeLists.txt to build and link the XNNPACK backend.
413+
414+
```
415+
option(EXECUTORCH_BUILD_XNNPACK "" ON)
416+
417+
# ...
418+
419+
add_executable(nanogpt_runner main.cpp)
420+
target_link_libraries(
421+
nanogpt_runner
422+
PRIVATE
423+
executorch
424+
extension_module_static # Provides the Module class
425+
optimized_native_cpu_ops_lib # Provides baseline cross-platform kernels
426+
xnnpack_backend) # Provides the XNNPACK CPU acceleration backend
427+
428+
```
429+
412430
For more information, see the ExecuTorch guides for the [XNNPACK Backend](https://pytorch.org/executorch/stable/tutorial-xnnpack-delegate-lowering.html)
413431
and [CoreML Backend](https://pytorch.org/executorch/stable/build-run-coreml.html).
414432

0 commit comments

Comments
 (0)