This repository offers a curated selection of open-source large language model implementations using JAX and Flax, optimized for high-speed TPU/GPU training. Built with a modular and extensible codebase, it supports various architectures and fine-tuning capabilities, suitable for educational and experimental purposes.
Welcome to Awesome JAX & Flax LLMs, a curated collection of open-source large language model (LLM) implementations constructed using JAX and Flax. This repository features modular, efficient, and scalable implementations of transformer-based models that are specifically optimized for high-speed TPU/GPU training and efficient inference.
Note: The implementations provided here are intended for educational purposes only and are not meant for production use. They encompass all model components and can be adapted to fulfill production requirements.
This implementation of a compact transformer-based language model is developed in pure JAX/Flax, leveraging XLA optimizations for parallelism, thus ensuring efficiency on TPUs and GPUs. It serves as the basis for exploring JAX-based language modeling.
models/gpt-2/gpt2_in_jax.ipynbmodels/gpt-2/train.pyAn enhanced version of the Llama series, it incorporates state-of-the-art optimizations in JAX that handle longer context windows and achieve a reduced memory footprint through precision tuning.
models/llama3/llama3_in_jax.ipynbmodels/llama3/llama3_in_jax.pyThis cutting-edge deep learning model is designed for highly efficient semantic search. It employs advanced transformer architectures and JAX optimizations for faster retrieval and lower computational costs.
Anticipated to deliver a high-performance implementation of the Mistral architecture, featuring dense & sparse mixture-of-expert layers. This model will showcase advanced TPU utilization along with optimized autoregressive decoding.
The models are best executed in Google Colab, which provides free TPU support for optimal performance.
Each model comes with its dedicated Jupyter notebook. Users can navigate to the specific directories and open the notebooks in Google Colab for hands-on exploration of the implementations.
Contributions to the repository are welcome, and community members are encouraged to submit issues and pull requests.
No comments yet.
Sign in to be the first to comment.