fastai is a deep learning library which provides practitioners withhigh-level components that can quickly and easily provide state-of-the-artresults in standard deep learning domains, and provides researchers withlow-level components that can be mixed and matched to build new approaches. Itaims to do both things without substantial compromises in ease of use,flexibility, or performance. This is possible thanks to a carefully layeredarchitecture, which expresses common underlying patterns of many deep learningand data processing techniques in terms of decoupled abstractions. Theseabstractions can be expressed concisely and clearly by leveraging the dynamismof the underlying Python language and the flexibility of the PyTorch library.fastai includes: a new type dispatch system for Python along with a semantictype hierarchy for tensors; a GPU-optimized computer vision library which canbe extended in pure Python; an optimizer which refactors out the commonfunctionality of modern optimizers into two basic pieces, allowing optimizationalgorithms to be implemented in 4-5 lines of code; a novel 2-way callbacksystem that can access any part of the data, model, or optimizer and change itat any point during training; a new data block API; and much more. We have usedthis library to successfully create a complete deep learning course, which wewere able to write more quickly than using previous approaches, and the codewas more clear. The library is already in wide use in research, industry, andteaching.