cortex-m

Quantize and export PyTorch models for Cortex-M CMSIS-NN targets using PT2E flow and CortexMPassManager.

4.9k|1.1k|Updated Feb 25, 2022
One-click install
npx skills add https://github.com/pytorch/executorch --skill cortex-m
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cortex-m
Source: https://github.com/pytorch/executorch/tree/main/.claude/skills/cortex-m
Command: npx skills add https://github.com/pytorch/executorch --skill cortex-m

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build, test, or develop the Cortex-M (CMSIS-NN) backend for PyTorch executions on embedded devices. This enables assembling CMSIS-NN compatible quantized graphs, validating performance, and exporting models targeted at Cortex-M runtimes.

Core Features & Use Cases

  • Provides a complete pipeline for quantization, graph rewriting, and export to Cortex-M targets using PT2E flow.
  • Supports running tests (dialect and implementation tests) for CMSIS-NN integration and CMSIS hardware backends.
  • Use Case: Develop and optimize a CMSIS-NN backend for a Cortex-M device by exporting a quantized model and validating it on hardware.

Quick Start

Quantize a sample model for Cortex-M CMSIS-NN and run the prepared graph through the Cortex-M backend.

Frequently Asked Questions about cortex-m

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I quantize and export PyTorch models for Cortex-M embedded devices?

To quantize and export models for Cortex-M embedded devices, you apply the PT2E quantization flow to assemble CMSIS-NN compatible graphs. This pipeline uses the CortexMPassManager for graph rewriting and export tooling to target Cortex-M runtimes.

What is the PT2E quantization flow used for in CMSIS-NN backend development?

The PT2E quantization flow is used to calibrate and assemble CMSIS-NN compatible quantized graphs. It prepares your model by rewriting the graph to target Cortex-M hardware runtimes effectively.

Can I run dialect and implementation tests for CMSIS-NN integration on Cortex-M hardware?

Yes, you can run dialect and implementation tests for CMSIS-NN integration and CMSIS hardware backends. This skill supports validating performance and testing the CMSIS-NN integration directly on Cortex-M devices.

Do I need the CortexMPassManager to build a CMSIS-NN backend?

Yes, building and developing the Cortex-M CMSIS-NN backend requires the CortexMPassManager. It is an essential component for applying the PT2E quantization flow and exporting tooling to target Cortex-M devices.

Why does my CMSIS-NN quantized graph fail to validate on Cortex-M hardware?

Validation failures for a CMSIS-NN quantized graph on Cortex-M hardware often stem from incomplete calibration in the PT2E flow or missing graph rewriting steps. You must ensure the export tooling properly assembles the CMSIS-NN compatible graph.