IBM

Debugging Across the Dataflow Stack

Extended! : Two more days to get Coursera Plus for $239/year and build in-demand skills.

IBM

Debugging Across the Dataflow Stack

Included with Coursera PlusLearn more

Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

5 hours to complete
Flexible schedule
Learn at your own pace
Gain insight into a topic and learn the fundamentals.
Intermediate level

Recommended experience

5 hours to complete
Flexible schedule
Learn at your own pace

What you'll learn

  • Locate failures in compiled AI workloads by compiler stage and software layer.

  • Distinguish numerical differences from logic bugs using high-precision references and tolerances.

  • Use ablation, provenance, logs, and comparison to narrow the first point of divergence.

Details to know

Shareable certificate

Add to your LinkedIn profile

Assessments

2 assignments

Taught in English

Build your subject-matter expertise

This course is part of the Dataflow Architectures for AI Specialization
When you enroll in this course, you'll also be enrolled in this Specialization.
  • Learn new concepts from industry experts
  • Gain a foundational understanding of a subject or tool
  • Develop job-relevant skills with hands-on projects
  • Earn a shareable career certificate

There are 8 modules in this course

In eager PyTorch, an error is reported at the operation that caused it, every intermediate tensor is available, and each operation runs as its own kernel. Compilation removes part of this behavior on a GPU with torch.compile, and more of it on a dataflow accelerator. This module explains why a compiled program reports an error at the next synchronization point, why a print call changes the compiled graph, and why the intermediate values inside a fused kernel cannot be inspected. The module ends with the failures that a compiled-schedule accelerator detects at compile time instead of at run time.

What's included

2 videos

This module introduces an eight-layer model of the stack, from Python source to hardware execution, and uses it to locate a failure before you read the code. You will match symptoms to layers and study the failure modes that static planning makes more common, including padding errors, scratchpad spills, core-division mismatches and deadlock in a dataflow graph. A case study follows a torch-spyre issue from the first symptom to its root cause.

What's included

1 video

This module follows three steps: an overview of the whole compile, a narrowing step that finds the failing layer, and a detailed reading of the logs and IR for that layer. You will learn backend ablation with torch.compile, single-kernel replay with OpSpec on Spyre, IR dumps for each compiler stage, provenance tracking from a generated kernel back to its source lines, compile logs with TORCH_TRACE and tlparse, and profiler timelines that show host and device activity together. A live Colab demonstration applies provenance tracking to a small attention example. You will also compare the equivalent tools in PyTorch Inductor, JAX with XLA, and torch-spyre.

What's included

1 video

Some failures produce a wrong value without an error or a crash. On a dataflow accelerator, the usual causes are a CPU fallback or the physical layout of the data in memory. This module explains how to turn a fallback warning into an error, how to measure error against an FP64 reference, and how to check invariants at each compiler stage boundary. You will also learn to test the physical bytes with exact-value comparisons and with padding lanes filled with NaN.

What's included

1 video

Differential debugging runs the target and a trusted baseline on the same inputs and compares their outputs at each module boundary. The first module where the outputs differ is the earliest point where the fault appears. This module covers how to choose a baseline and a pass criterion, how to record per-layer outputs with forward hooks, and which controls make two runs comparable. It also covers runs that are correct but slow, and how the torch-spyre test suite applies the same comparison.

What's included

1 video

A model in production runs under a serving runtime, a model plugin and a backend compiler. The cause of a serving bug is often in the layer below the one where the symptom appears. This module applies the TRACE method to the serving layer. You will learn to rerun a failing request on the CPU, find input shapes that do not match a compiled bucket, check the KV cache capacity limit in the scheduler, identify a broadcast bug from a periodic error pattern, read distributed failures from the worker log, and record each workaround as a test.

What's included

1 video

In this lab, you will diagnose four deliberately introduced failures in Google Colab on a free T4 GPU. Each failure exercises two steps of the TRACE method. In Part 1, you load Qwen 2.5 0.5B with an injected fault, record the output of every module with forward hooks, and find the first module with a non-finite output and the first point where the run differs from a clean run. torch.autograd.detect_anomaly reports nothing, because it checks only the backward pass. In Part 2, a block compiled with dynamic=False receives a new prompt length on every call. You count the recompilations with the recompile log, TORCH_TRACE and tlparse, remove them with shape buckets, and add a guard that raises an error on any later compilation. In Part 3, a bug in an Inductor decomposition passes a loose allclose check. You detect it with the FP64 criterion and identify the compiler layer with a four-backend ablation. In Part 4, a small dataflow backend runs one operation on the host. You promote its FallbackWarning to an error to identify the operation, and you find the host round trips in a profiler trace. In Part 5, you add four rows to the Accelerator Landscape Map, one per failure, with the layer where the fault entered, the signal you observed on the GPU, and the signal you predict on Spyre and on TPU. In an optional part, you run a strict-xfail test for the fallback on the backend as shipped and on a fixed version. Learners with Spyre access can repeat Part 4 on torch-spyre.

What's included

1 assignment1 ungraded lab

This quiz covers all six modules of the course: debugging compiled programs, the failure taxonomy for dataflow targets, observability tools, silent failures, differential debugging against a baseline, and debugging across the serving stack. Most of the 20 questions describe a debugging scenario and ask you to choose the next step or locate the fault. Allow about 50 minutes. You need a score of 80% to pass, and you can take the quiz up to 3 times. Your highest score counts.

What's included

1 assignment

Earn a career certificate

Add this credential to your LinkedIn profile, resume, or CV. Share it on social media and in your performance review.

Instructor

Kaoutar El Maghraoui
6 Courses203 learners

Offered by

IBM

Why people choose Coursera for their career

Felipe M.

Learner since 2018
"To be able to take courses at my own pace and rhythm has been an amazing experience. I can learn whenever it fits my schedule and mood."

Jennifer J.

Learner since 2020
"I directly applied the concepts and skills I learned from my courses to an exciting new project at work."

Larry W.

Learner since 2021
"When I need courses on topics that my university doesn't offer, Coursera is one of the best places to go."

Chaitanya A.

"Learning isn't just about being better at your job: it's so much more than that. Coursera allows me to learn without limits."

What brings you to Coursera today?

Frequently asked questions