Howto: Bringing up ExecuTorch on a Bare Metal Microcontroller Logo
  • 1. Introduction
    • 1.1. Target audience
    • 1.2. Further information
    • 1.3. Structure of the document
    • 1.4. Acknowledgements
    • 1.5. Licensing and legal notices
      • 1.5.1. Document license
      • 1.5.2. Software license
      • 1.5.3. Trademarks
  • 2. ExecuTorch Overview
    • 2.1. About PyTorch and ExecuTorch
    • 2.2. The ExecuTorch architecture
    • 2.3. Structure of the ExecuTorch repository
      • 2.3.1. ExecuTorch directory hierarchy
      • 2.3.2. Key third party packages
    • 2.4. The target: CV32E40Pv2
  • 3. Setting up to run the examples
    • 3.1. Prerequisites
    • 3.2. File hierarchy
    • 3.3. The Python virtual environment
      • 3.3.1. Python package prerequisites
    • 3.4. Getting the source code
    • 3.5. Building and running the target model
  • 4. Bringing up ExecuTorch AoT for the CV32E40Pv2
    • 4.1. Files to be changed
    • 4.2. Modifying the build system for CORE-V
    • 4.3. The CORE-V AoT backend implementation
      • 4.3.1. The CORE-V AoT quantizer
      • 4.3.2. The CORE-V AoT delegate partitioner
      • 4.3.3. The main CORE-V AoT backend class
    • 4.4. The CORE-V AoT backend driver
    • 4.5. An example AI model
    • 4.6. Building and running ExecuTorch AoT for CORE-V
      • 4.6.1. Building the ExecuTorch AoT
      • 4.6.2. Running the ExecuTorch AoT
      • 4.6.3. A convenience script to build ExecuTorch AoT
  • 5. Implementing an ExecuTorch runtime for the CV32E40Pv2
    • 5.1. Files to be changed
    • 5.2. Modifying the build system for CORE-V
      • 5.2.1. The general ExecuTorch runtime CMake configuration for CORE-V
      • 5.2.2. The CORE-V target specific configuration
    • 5.3. The CORE-V runtime backend implementation
      • 5.3.1. The CORE-V runtime backend declaration
      • 5.3.2. The CORE-V runtime backend definition
      • 5.3.3. The Platform Abstraction Layer
    • 5.4. The CORE-V runtime backend driver
      • 5.4.1. Including the AoT generated model in the runtime
      • 5.4.2. The main driver program
    • 5.5. Building and running ExecuTorch runtime for CORE-V
      • 5.5.1. The ExecuTorch runtime build script
      • 5.5.2. Running the ExecuTorch runtime on the Verilator model
  • 6. Optimizing ExecuTorch by using delegation
    • 6.1. Overview of how delegation works
    • 6.2. Files to be changed
    • 6.3. Adding a new test model
    • 6.4. Modifying the ExecuTorch AoT for delegation
      • 6.4.1. The AoT delegation code
      • 6.4.2. AoT preprocessing of delegated operators
      • 6.4.3. Rebuilding and running the ExecuTorch AoT for CORE-V
    • 6.5. Modifying the ExecuTorch runtime for delegation
      • 6.5.1. Extending the CoreVBackend declaration
      • 6.5.2. Extending the CoreVBackend definition
      • 6.5.3. Rebuilding and running the ExecuTorch runtime for CORE-V
  • 7. Benchmarking ExecuTorch
    • 7.1. Overview of how to benchmark ExecuTorch
    • 7.2. Files to be changed
    • 7.3. Modifying the ExecuTorch runtime for benchmarking
      • 7.3.1. Updating the runtime driver
      • 7.3.2. Building and running to verify results
    • 7.4. Benchmarking ExecuTorch
      • 7.4.1. Fixed and dynamic costs of the add model
        • 7.4.1.1. Measuring dynamic cost by running the model multiple times
        • 7.4.1.2. Measuring dynamic cost by varying the model size
        • 7.4.1.3. Breaking down the fixed cost of a model
      • 7.4.2. Fixed and dynamic costs of the add8 model
      • 7.4.3. The impact of delegation
  • 8. Further optimization of ExecuTorch
    • 8.1. Overview of optimization
    • 8.2. Optimizing for a memory hierarchy
      • 8.2.1. Example sizing of double buffer tiling
      • 8.2.2. Performance balancing with double buffer tiling
    • 8.3. Optimizing for multi-core operation
      • 8.3.1. Integration of multicore with memory tiling
    • 8.4. Optimization for custom accelerators
    • 8.5. Optimization by quantization
      • 8.5.1. Ahead-of-time quantization
      • 8.5.2. Run-time quantization
    • 8.6. Operator fusion
    • 8.7. Customized runtime for deeply embedded edge inference
  • 9. Appendix: An introduction to neural networks with PyTorch
    • 9.1. Key features of neural networks
    • 9.2. Installing PyTorch and associated tools
      • 9.2.1. Which version of PyTorch to install
      • 9.2.2. Other software
        • 9.2.2.1. Matplotlib
    • 9.3. An example model: a 7 segment display recognizer
      • 9.3.1. PyTorch implementation of the 7 segment display recognizer
        • 9.3.1.1. Package dependencies
        • 9.3.1.2. Defining the data
        • 9.3.1.3. The neural network model
        • 9.3.1.4. Training the model
        • 9.3.1.5. Putting it all together
    • 9.4. Inspecting models
      • 9.4.1. Dumping data: the brute force approach
        • 9.4.1.1. Textual dumping
        • 9.4.1.2. Plotting with matplotlib
  • 10. Glossary
  • 11. References
  • Index
Index
Howto: Bringing up ExecuTorch on a Bare Metal Microcontroller
  • Search


© Copyright 2026, Embecosm.

Built with Sphinx using a theme provided by Read the Docs.