From 08887a69ccf78b9ca3da6c9dca4a26d205a8ac68 Mon Sep 17 00:00:00 2001 From: Hansong <107070759+kirklandsign@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:19:40 -0700 Subject: [PATCH 1/3] Fix LLM getting-started.md Remove unnecessary line --- docs/source/llm/getting-started.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/llm/getting-started.md b/docs/source/llm/getting-started.md index 035da31f119..c07f4dfcba4 100644 --- a/docs/source/llm/getting-started.md +++ b/docs/source/llm/getting-started.md @@ -395,7 +395,6 @@ At this point, the working directory should contain the following files: If all of these are present, you can now build and run: ```bash -./install_executorch.sh --clean (mkdir cmake-out && cd cmake-out && cmake ..) cmake --build cmake-out -j10 ./cmake-out/nanogpt_runner From c6292007c76aa2888f8365e5c07c9824ec24463f Mon Sep 17 00:00:00 2001 From: Hansong <107070759+kirklandsign@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:31:26 -0700 Subject: [PATCH 2/3] Update getting-started.md --- docs/source/llm/getting-started.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/source/llm/getting-started.md b/docs/source/llm/getting-started.md index c07f4dfcba4..42181051c80 100644 --- a/docs/source/llm/getting-started.md +++ b/docs/source/llm/getting-started.md @@ -660,19 +660,15 @@ edge_config = get_xnnpack_edge_compile_config() # Convert to edge dialect and lower to XNNPack. edge_manager = to_edge_transform_and_lower(traced_model, partitioner = [XnnpackPartitioner()], compile_config = edge_config) et_program = edge_manager.to_executorch() -``` - -Finally, ensure that the runner links against the `xnnpack_backend` target in CMakeLists.txt. +with open("nanogpt.pte", "wb") as file: + file.write(et_program.buffer) ``` -add_executable(nanogpt_runner main.cpp) -target_link_libraries( - nanogpt_runner - PRIVATE - executorch - extension_module_static # Provides the Module class - optimized_native_cpu_ops_lib # Provides baseline cross-platform kernels - xnnpack_backend) # Provides the XNNPACK CPU acceleration backend + +Then run: +```bash +python export_nanogpt.py +./cmake-out/nanogpt_runner ``` For more information, see [Quantization in ExecuTorch](../quantization-overview.md). From fad7a17ab481fcd9b3274298d3d5ad561e9e5298 Mon Sep 17 00:00:00 2001 From: Hansong <107070759+kirklandsign@users.noreply.github.com> Date: Wed, 9 Apr 2025 15:50:57 -0700 Subject: [PATCH 3/3] Update getting-started.md --- docs/source/llm/getting-started.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/llm/getting-started.md b/docs/source/llm/getting-started.md index 42181051c80..f19982660ae 100644 --- a/docs/source/llm/getting-started.md +++ b/docs/source/llm/getting-started.md @@ -777,11 +777,14 @@ Run the export script and the ETRecord will be generated as `etrecord.bin`. An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [the ETDump docs](../etdump.md). -Include the ETDump header in your code. +Include the ETDump header and namespace in your code. ```cpp // main.cpp #include + +using executorch::etdump::ETDumpGen; +using torch::executor::etdump_result; ``` Create an Instance of the ETDumpGen class and pass it to the Module constructor.