We began with a Metal operation and ended with training choices. That is the backward way of thinking: the layer below sets a limit, and the layer above can only depend on it if it meets that limit. Now rebuild the original course without losing that map.
Reversed map, first look
The graph must give the hardware operations it can run. The file must give the graph a stable form. The runtime can now load the file because its function and tensor descriptions are real.
Reversed map, host look
The host must give the compiled graph correct buffers and a prepare-once lifecycle. SwiftUI must give the host one float32 NCHW array, not a vaguely image-shaped object. Prepare once so the trace measures inference, not accidental setup.
Reversed map, product look
Training sits before all of it. The dataset and ClothingCNN must give conversion a fixed shape and portable CPU weights. Conversion must give the runtime a graph. The runtime must give Metal work it can run. The UI must give the runtime a valid tensor. The label is useful only when every arrow met its requirement.
Turn the arrows forward again
This is the same route as the original course, but the reading is different. Each forward arrow is a requirement for the layer below. Training must give a model that can be exported. Conversion must give operations the runtime can use. The runtime must give correctly prepared execution. SwiftUI must give the tensor contract. Profiling checks whether the chip received what the whole stack said it would send.
For the complete original build, continue through PyTorch to Core AI in Xcode. For the agent recipe that matches this course, use the course SKILL.md.
Key concepts
- The backward path is complete: silicon limits, graph,
.aimodel, runtime, thin UI, conversion, training. - Turn the arrows forward again: Fashion-MNIST and
ClothingCNNto.aimodeltoAIModelto photo to label. - Each forward arrow is a requirement for the layer below.
- Profiling checks whether the chip received what the stack promised.
Takeaways
- You can hold the reversed map and the original forward pipeline at the same time.
- Open the original course's first pipeline lesson with this backward map beside it.
- A useful label only happens when Metal, runtime, model file, tensor contract, and training all met their limits.