Export, lower, and benchmark GPT-2 with ExecuTorch (Portable and XNNPACK)

GPT-2

GPT-2 is a 124-million-parameter decoder-only language model released by OpenAI in 2019. Given a prompt, it predicts the next token. The application can append that token and run the model again to continue the text.

GPT-2 is an older base model. It is used here because it is small enough to expose the export, lowering, and runtime calls without first introducing quantization, a KV cache, or model-specific deployment tooling. It still contains the main parts of a text-generation model - token embeddings, attention blocks, feed-forward layers, normalization, causal masking, and a repeated decode loop - making it suitable for examining ExecuTorch export, lowering, and XNNPACK delegation on an Arm CPU.

Previous page Complete and continue