@@ -395,7 +395,6 @@ At this point, the working directory should contain the following files:
395
395
396
396
If all of these are present, you can now build and run:
397
397
``` bash
398
- ./install_executorch.sh --clean
399
398
(mkdir cmake-out && cd cmake-out && cmake ..)
400
399
cmake --build cmake-out -j10
401
400
./cmake-out/nanogpt_runner
@@ -661,19 +660,15 @@ edge_config = get_xnnpack_edge_compile_config()
661
660
# Convert to edge dialect and lower to XNNPack.
662
661
edge_manager = to_edge_transform_and_lower(traced_model, partitioner = [XnnpackPartitioner()], compile_config = edge_config)
663
662
et_program = edge_manager.to_executorch()
664
- ```
665
-
666
- Finally, ensure that the runner links against the ` xnnpack_backend ` target in CMakeLists.txt.
667
663
664
+ with open (" nanogpt.pte" , " wb" ) as file :
665
+ file .write(et_program.buffer)
668
666
```
669
- add_executable(nanogpt_runner main.cpp)
670
- target_link_libraries(
671
- nanogpt_runner
672
- PRIVATE
673
- executorch
674
- extension_module_static # Provides the Module class
675
- optimized_native_cpu_ops_lib # Provides baseline cross-platform kernels
676
- xnnpack_backend) # Provides the XNNPACK CPU acceleration backend
667
+
668
+ Then run:
669
+ ``` bash
670
+ python export_nanogpt.py
671
+ ./cmake-out/nanogpt_runner
677
672
```
678
673
679
674
For more information, see [ Quantization in ExecuTorch] ( ../quantization-overview.md ) .
@@ -782,11 +777,14 @@ Run the export script and the ETRecord will be generated as `etrecord.bin`.
782
777
783
778
An ETDump is an artifact generated at runtime containing a trace of the model execution. For more information, see [ the ETDump docs] ( ../etdump.md ) .
784
779
785
- Include the ETDump header in your code.
780
+ Include the ETDump header and namespace in your code.
786
781
``` cpp
787
782
// main.cpp
788
783
789
784
#include < executorch/devtools/etdump/etdump_flatcc.h>
785
+
786
+ using executorch::etdump::ETDumpGen;
787
+ using torch::executor::etdump_result;
790
788
```
791
789
792
790
Create an Instance of the ETDumpGen class and pass it to the Module constructor.
0 commit comments