Tensor by Tensor

MODULE 03 · LESSON 05

Profiling and debugging

Profiling records where runtime time went. Debugging links a symptom to that evidence.

PLAIN-LANGUAGE INTRODUCTION

What is this?

Profiling records where runtime time went. Debugging links a symptom to that evidence.

One simple example

An illustrative trace shows MatMul=12 ms, Add=1 ms, Custom=80 ms, and Copy=7 ms.

What goes in?

A representative model run with profiling and useful logging enabled.

What comes out?

Timed events, provider placement, shapes, and warnings.

Why does it matter?

Recorded evidence points toward the operation worth investigating first.

What is it not?

One illustrative trace is not a production benchmark.

WORK THROUGH THE IDEA

See the idea in more detail

  1. First define the symptom. Here, one illustrative run totals 100 ms.
  2. The trace assigns 12 ms to MatMul, 1 ms to Add, 80 ms to Custom, and 7 ms to Copy.
  3. The custom operation uses 80% of this made-up total. Inspect its provider and input shape first.
  4. Repeat warm runs under controlled conditions before making a performance claim.
  5. Common mistake: optimizing the largest-looking graph node without checking its recorded duration.
Open the detailed notes ↗