## Two Sentence Summary of Proposal
To improve adoption of Julia for deep learning, I plan to make the breadth of available pretrained models in the Python ecosystem interoperable with Julia's deep learning ecosystem. I will integrate Python model libraries with the high-level workflows in Julia libraries to ease the transition for newcomers from Python and help researchers using Julia to build on existing research published in Python.
## Description of the proposal
While Julia's package ecosystem for deep learning is maturing, Python's deep learning community remains orders of magnitudes larger. As a result, the number of implemented research papers and pretrained models available in Python is much larger. From conversations I've had with people active in the Python community, not being able to use those models in Julia represents a major barrier to entry.
Additionally, there are other benefits to being able to use Python models in Julia:
- reduced compilation time, allowing for faster iteration
- access to sometimes better optimized runtime performance and GPU memory due to hundreds of person-years of work put into major Python deep learning frameworks
- using those frameworks' infrastructure, for example to export a PyTorch model to ONNX, run a Jax model on TPU hardware, or optimize and export a model for mobile inference
This project aims to make existing Python models trainable from Julia. I plan to:
- solidify infrastructure that allows using models from Python deep learning frameworks together with Julia's Automatic Differentiation libraries
- implement a model registry that allows accessing models from Python models without manual setup
- add model architectures and pretrained weights from at least two major model libraries
- seamlessly integrate those models into high-level Julia workflows; and
- provide end-to-end tutorials as well as reference documentation for using the provided Python models
Specific deliverables are:
- Contributing to PyCallChainRules.jl, by (1) fixing an issue with GPU memory leaking that is preventing serious usage, and (2) replacing the current manual installation steps with an automated one.
- Adding a model registry to FastAI.jl that allows listing, searching for, and loading models and can be extended by other packages (like the existing registries: https://fluxml.ai/FastAI.jl/dev/documents/docs/discovery.md)
- Creating a package for Python models that makes the pretrained models in timm (https://github.com/rwightman/pytorch-image-models) and TorchHub (https://pytorch.org/docs/stable/hub.html) available in the model registry and handles setup of Python dependencies.
- Integrating the Python models with high-level workflows in FastAI.jl (https://fluxml.ai/FastAI.jl/dev/documents/notebooks/quickstart.ipynb) so that they can be used as drop-in replacements to existing backbones for all computer vision tasks
- Writing documentation, including a tutorial that shows how to finetune a pretrained PyTorch model for image classification and export it to ONNX.