Skip to content

Commit 861abb1

Browse files
pytorchbotdbort
andauthored
Use relative links in llm/getting-started.md (#3244) (#3310)
Summary: Use relative markdown links instead of full URLs. This way, the docs will always point to a consistent branch. Pull Request resolved: #3244 Test Plan: Clicked on all modified links in the rendered docs preview: https://docs-preview.pytorch.org/pytorch/executorch/3244/llm/getting-started.html Reviewed By: Gasoonjia Differential Revision: D56479234 Pulled By: dbort fbshipit-source-id: 45fb25f017c73df8606c3fb861acafbdd82fec8c (cherry picked from commit b560864) Co-authored-by: Dave Bort <[email protected]>
1 parent 2a1ae4f commit 861abb1

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

docs/source/llm/getting-started.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ cd ../..
9090
:::
9191
::::
9292

93-
For more information, see [Setting Up ExecuTorch](https://pytorch.org/executorch/stable/getting-started-setup.html).
93+
For more information, see [Setting Up ExecuTorch](../getting-started-setup.md).
9494

9595

9696
## Running a Large Language Model Locally
@@ -185,7 +185,7 @@ with open("nanogpt.pte", "wb") as file:
185185

186186
To export, run the script with `python export_nanogpt.py` (or python3, as appropriate for your environment). It will generate a `nanogpt.pte` file in the current directory.
187187

188-
For more information, see [Exporting to ExecuTorch](https://pytorch.org/executorch/main/tutorials/export-to-executorch-tutorial.html) and
188+
For more information, see [Exporting to ExecuTorch](../tutorials/export-to-executorch-tutorial) and
189189
[torch.export](https://pytorch.org/docs/stable/export.html).
190190

191191
### Step 2. Invoking the Runtime
@@ -344,8 +344,8 @@ curl -O https://raw.githubusercontent.com/pytorch/executorch/main/examples/llm_m
344344
curl -O https://raw.githubusercontent.com/pytorch/executorch/main/examples/llm_manual/managed_tensor.h
345345
```
346346

347-
To learn more, see [Running an ExecuTorch Model in C++](https://pytorch.org/executorch/main/running-a-model-cpp-tutorial.html)
348-
and the [ExecuTorch Runtime API Reference](https://pytorch.org/executorch/main/executorch-runtime-api-reference.html).
347+
To learn more, see [Running an ExecuTorch Model in C++](../running-a-model-cpp-tutorial.md)
348+
and the [ExecuTorch Runtime API Reference](../executorch-runtime-api-reference.md).
349349

350350
### Building and Running
351351

@@ -541,11 +541,9 @@ target_link_libraries(
541541
xnnpack_backend) # Provides the XNNPACK CPU acceleration backend
542542
```
543543

544-
Keep the rest of the code the same. For more details refer to
545-
[Exporting to ExecuTorch](https://pytorch.org/executorch/main/llm/getting-started.html#step-1-exporting-to-executorch)
546-
and
547-
[Invoking the Runtime](https://pytorch.org/executorch/main/llm/getting-started.html#step-2-invoking-the-runtime)
548-
for more details
544+
Keep the rest of the code the same. For more details refer to [Exporting
545+
to ExecuTorch](#step-1-exporting-to-executorch) and [Invoking the
546+
Runtime](#step-2-invoking-the-runtime) for more details
549547

550548
At this point, the working directory should contain the following files:
551549

@@ -592,10 +590,8 @@ I'm not sure if you've heard of the "Curse of the Dragon" or not, but it's a ver
592590
The delegated model should be noticeably faster compared to the non-delegated model.
593591

594592
For more information regarding backend delegateion, see the ExecuTorch guides
595-
for the
596-
[XNNPACK Backend](https://pytorch.org/executorch/stable/tutorial-xnnpack-delegate-lowering.html)
597-
and
598-
[CoreML Backend](https://pytorch.org/executorch/stable/build-run-coreml.html).
593+
for the [XNNPACK Backend](../tutorial-xnnpack-delegate-lowering.md) and [CoreML
594+
Backend](../build-run-coreml.md).
599595

600596
## Quantization
601597

@@ -681,7 +677,7 @@ target_link_libraries(
681677
xnnpack_backend) # Provides the XNNPACK CPU acceleration backend
682678
```
683679

684-
For more information, see [Quantization in ExecuTorch](https://pytorch.org/executorch/stable/quantization-overview.html).
680+
For more information, see [Quantization in ExecuTorch](../quantization-overview.md).
685681

686682
## Profiling and Debugging
687683
After lowering a model by calling `to_backend()`, you may want to see what got delegated and what didn’t. ExecuTorch
@@ -759,7 +755,7 @@ Through the ExecuTorch SDK, users are able to profile model execution, giving ti
759755
760756
##### ETRecord generation (Optional)
761757
762-
An ETRecord is an artifact generated at the time of export that contains model graphs and source-level metadata linking the ExecuTorch program to the original PyTorch model. You can view all profiling events without an ETRecord, though with an ETRecord, you will also be able to link each event to the types of operators being executed, module hierarchy, and stack traces of the original PyTorch source code. For more information, see [https://pytorch.org/executorch/main/sdk-etrecord.html](https://pytorch.org/executorch/main/sdk-etrecord.html)
758+
An ETRecord is an artifact generated at the time of export that contains model graphs and source-level metadata linking the ExecuTorch program to the original PyTorch model. You can view all profiling events without an ETRecord, though with an ETRecord, you will also be able to link each event to the types of operators being executed, module hierarchy, and stack traces of the original PyTorch source code. For more information, see [the ETRecord docs](../sdk-etrecord.md).
763759
764760
765761
In your export script, after calling `to_edge()` and `to_executorch()`, call `generate_etrecord()` with the `EdgeProgramManager` from `to_edge()` and the `ExecuTorchProgramManager` from `to_executorch()`. Make sure to copy the `EdgeProgramManager`, as the call to `to_backend()` mutates the graph in-place.
@@ -781,7 +777,7 @@ Run the export script and the ETRecord will be generated as `etrecord.bin`.
781777
782778
##### ETDump generation
783779
784-
An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [https://pytorch.org/executorch/main/sdk-etdump.html](https://pytorch.org/executorch/main/sdk-etdump.html)
780+
An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [the ETDump docs](../sdk-etdump.md).
785781
786782
Include the ETDump header in your code.
787783
```cpp
@@ -851,7 +847,7 @@ This prints the performance data in a tabular format in “inspector_out.txt”,
851847
![](../_static/img/llm_manual_print_data_tabular.png)
852848
<a href="../_static/img/llm_manual_print_data_tabular.png" target="_blank">View in full size</a>
853849

854-
To learn more about the Inspector and the rich functionality it provides, see the [Inspector API Reference](https://pytorch.org/executorch/main/sdk-inspector.html).
850+
To learn more about the Inspector and the rich functionality it provides, see the [Inspector API Reference](../sdk-inspector.md).
855851

856852
## Custom Kernels
857853
With the ExecuTorch custom operator APIs, custom operator and kernel authors can easily bring in their kernel into PyTorch/ExecuTorch.
@@ -929,7 +925,7 @@ torch.ops.load_library("libcustom_linear.so")
929925
Once loaded, you can use the custom operator in PyTorch code.
930926

931927
For more information, see [PyTorch Custom Operators](https://pytorch.org/tutorials/advanced/torch_script_custom_ops.html) and
932-
and [ExecuTorch Kernel Registration](https://pytorch.org/executorch/stable/kernel-library-custom-aten-kernel.html).
928+
and [ExecuTorch Kernel Registration](../kernel-library-custom-aten-kernel.md).
933929

934930
### Using a Custom Operator in a Model
935931

@@ -951,9 +947,8 @@ def replace_linear_with_custom_linear(module):
951947

952948
The remaining steps are the same as the normal flow. Now you can run this module in eager mode as well as export to ExecuTorch.
953949

954-
## How to build Mobile Apps
955-
You can execute an LLM using ExecuTorch on iOS and Android.
950+
## How to Build Mobile Apps
951+
See the instructions for building and running LLMs using ExecuTorch on iOS and Android.
956952

957-
**For iOS see the [iLLaMA App](https://pytorch.org/executorch/main/llm/llama-demo-ios.html).**
958-
959-
**For Android, see the [Android Sample App](https://pytorch.org/executorch/main/llm/llama-demo-android.html).**
953+
* **[iOS ExecuTorch LLaMA Demo App](llama-demo-ios.md)**
954+
* **[Android ExecuTorch LLaMA Demo App](llama-demo-android.md)**

0 commit comments

Comments
 (0)