PyTorch Certified Associate (PTCA) Practice Questions

PyTorch Certified Associate exam preparation

PyTorch Certified Associate (PTCA) practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

PyTorch Certified Associate (PTCA) free question 9 / 10 · Domain 3: Performance & Optimization

After compiling a model with torch.compile, a team sees little speedup. What does the FAQ name as the main reason for not seeing the speedups?

  1. The default inductor backend generates Triton kernels that are slower than eager kernels
  2. Excessive graph breaks that split the program into small graphs
  3. A model is supported for inference but its backward graphs stay uncompiled
  4. The compile cache keeps results per code object and prevents reuse across frames
Show the answer and explanation

Answer: B

Why this is correct
The FAQ's section on missing speedups says the main reason you won't see the speedups you'd like by using dynamo is excessive graph breaks. TorchDynamo attempts to compile all of the torch and tensor operations within a function into a single FX graph, but it may fail to capture everything into one graph. Some graph break reasons are insurmountable, like calling into a C extension other than PyTorch, which is invisible to TorchDynamo. To maximize performance, it is important to have as few graph breaks as possible.

Why the other options are wrong
"The default inductor backend generates Triton kernels that are slower than eager kernels" … The FAQ says Inductor first fuses whatever it can and then generates Triton kernels, and that Triton offers speedups through memory coalescing and scheduling. It does not name them as the main cause.
"The compile cache keeps results per code object and prevents reuse across frames" … The cache rule belongs to the torch.compile page and concerns functions created dynamically. The FAQ names graph breaks, not cache layout, as the main reason for missing speedups.
"A model is supported for inference but its backward graphs stay uncompiled" … The FAQ says torch.compile supports training by using AOTAutograd to capture backwards. Missing speedups are tied there to graph breaks, not to uncompiled backward graphs.

Key points
When torch.compile shows no speedup, look for graph breaks first. Each break splits the program into smaller graphs.

Go to the PyTorch Certified Associate (PTCA) practice app (10 free questions; purchase unlocks all questions)

See the full practice set