IBM

Compilation for Dataflow

IBM

Compilation for Dataflow

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

  • Trace the PyTorch 2 compilation path from TorchDynamo through TorchInductor.

  • Find and fix graph breaks and diagnose recompilation in compiled models.

  • Compare fusion, tiling, layout, and scheduling decisions across Inductor, XLA, and Spyre.

Details to know

Shareable certificate

Add to your LinkedIn profile

Recently updated!

October 2026

Assessments

2 assignments

Taught in English

See how employees at top companies are mastering in-demand skills

 logos of Petrobras, TATA, Danone, Capgemini, P&G and L'Oreal

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

This module covers the part of compilation that every PyTorch backend shares. It starts from the FX graph introduced in week two and explains why torch.compile exists. You will then follow a model through TorchDynamo, AOTAutograd and Core ATen decomposition, and see how graph breaks and guards affect what the backend receives.

What's included

1 video

A compiler uses several intermediate representations between source code and machine code. This module covers five of them: FX, Core ATen, HLO, MLIR and KTIR. For each one, you will see what it makes explicit and what it no longer records, and why different transformations need different levels.

What's included

1 video

Five compiler passes matter most for dataflow hardware: decomposition, operator fusion, layout, tiling for on-chip memory, and scheduling. This module explains what each pass decides and how a decision in one pass limits the others. It also introduces tile-level kernel languages such as Triton.

What's included

1 video

XLA is a compiler built for TPU, and its design follows from the hardware. A large systolic matrix unit is efficient only when it receives regular, correctly shaped data on every cycle. This module covers why TPU needs a whole-graph compiler, what the HLO representation makes possible, the two ways a PyTorch model reaches XLA, and the cost of requiring static shapes.

What's included

1 video

On Spyre, many decisions that a GPU leaves to caches or runtime scheduling are made by the compiler before execution. This module studies torch-spyre, the open-source frontend for Spyre, and the plans it produces. It distinguishes features that are published, features that are implemented today and features that are planned.

What's included

1 video

One attention block is compiled with XLA for TPU and with torch-spyre for Spyre. You will see where the two pipelines make the same choices and where they differ. Some transformations follow from the graph alone. Others depend on local memory size, matrix-array shape, the interconnect or the scheduling model.

What's included

1 video

This lab compiles a transformer block with torch.compile in Google Colab and measures the speedup over eager execution, weighing one-time compilation latency against the per-call steady-state saving. Students ablate the eager, aot_eager, and inductor backends to locate where the speedup originates, then detect and repair graph breaks that prevent whole-graph compilation. Reading the generated Triton and cuBLAS kernels connects operator fusion to dataflow execution. The lab adds the Week 3 row to the Accelerator Landscape Map.

What's included

1 assignment1 ungraded lab

This quiz covers all six modules of the course: the PyTorch compilation frontend, intermediate representations from FX to KTIR, the main compiler passes, XLA on TPU, torch-spyre on Spyre, and the two compilers side by side. It has 18 questions, including calculations of fusion traffic, padding waste and scratchpad slice size. Allow about 45 minutes and keep a calculator nearby. You need 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
1 Course1 learner

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."

Frequently asked questions