liveBook · Manning

Chapter 10: Profiling insights

What you will learn in chapter 10 of Domain-Specific Small Language Models

This introduction previews profiling ONNX-ported LLMs, turning profiling data into insights, and optimizing ONNX graphs.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction previews profiling ONNX-ported LLMs, turning profiling data into insights, and optimizing ONNX graphs.

10.1 Profiling ONNX-ported LLMs

This section shows how to capture ONNX Runtime inference profiling data and use Ort_perf_view to inspect it, while noting the limits of its visualizations for large models.

Key terms: ONNX Runtime (ORT), enable_profiling, end_profiling, JSON file, Ort_perf_view, treemaps, ONNX operator, execution provider, per-operator latency

10.2 Transforming raw ONNX profiling data into insights

The section shows how to turn raw ONNX profiling data into charts that reveal where an ONNX model spends inference time.

Key terms: raw profiling data, JSON file, OnnxWholeSession, tabular format, ONNX operator type, total duration, count of occurrences, percentage of total inference time, graph optimization, ONNX-converted model

10.3 Optimization of ONNX graphs for LLMs

The section shows how to inspect and test ONNX graph changes, then uses offline optimization of GPT-2 to illustrate their effects on graph structure and performance.

Key terms: ReferenceEvaluator, individual nodes, verbose, intermediate outputs, fusion, EyeLike, Add, AddEyeLike, OpRun, _run

10.4 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 9: Advanced quantization techniques Chapter 11: Deployment and serving →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.