Home

Awesome

EOLE

Documentation

Open language modeling toolkit based on PyTorch.

👷‍♂️🚧 Work in Progress

EOLE is a spin-off of the OpenNMT-py project. We aim to maintain the research-friendly approach of the original project while updating the structure and expanding it to include new topics related to large language models (LLMs) and various other techniques. Our goal is to provide a comprehensive yet compact and modular codebase for experimenting with various types of language models (encoder, decoder, seq2seq).


Current State

We have made significant progress in several areas:

Future Directions

There are still several exciting avenues to explore:


Key Features


Setup

Using Docker

To facilitate setup and reproducibility, we provide Docker images via the GitHub Container Registry: EOLE Docker Images.

You can customize the workflow and build your own images based on specific needs using build.sh and Dockerfile in the docker directory of the repository.

There are two images with CUDA 11.8 and 12.1 prebuilt, change the -cudaXX.X to your desired version when pulling the Docker images

To pull the Docker image:

docker pull ghcr.io/eole-nlp/eole:0.0.1-torch2.3.0-ubuntu22.04-cuda12.1 

Example one-liner to run a container and open a bash shell within it:

docker run --rm -it --runtime=nvidia ghcr.io/eole-nlp/eole:0.0.1-torch2.3.0-ubuntu22.04-cuda12.1 

Note: Ensure you have the Nvidia Container Toolkit (formerly nvidia-docker) installed to take advantage of CUDA/GPU features.

Depending on your needs, you can add various flags:

Installing Locally

Requirements

Installation from Source

To install from source:

git clone https://github.com/eole-nlp/eole
cd eole
pip install -e .

Installation from PyPI

Installation from PyPI will be available soon.

Notes

If you encounter a MemoryError during installation, try using pip with the --no-cache-dir option.

(Optional) Some advanced features (e.g., pretrained models or specific transforms) require extra packages. Install them with:

pip install -r requirements.opt.txt

Manual Installation of Some Dependencies

Apex

Apex is recommended for improved performance, especially for the legacy fusedadam optimizer and FusedRMSNorm.

git clone https://github.com/NVIDIA/apex
cd apex
pip3 install -v --no-build-isolation --config-settings --build-option="--cpp_ext --cuda_ext --deprecated_fused_adam --xentropy --fast_multihead_attn" ./
cd ..

Flash Attention

To use Flash Attention, install it manually:

pip install flash-attn --no-build-isolation

AWQ

For inference or quantizing an AWQ model, AutoAWQ is required. Install it with:

pip install autoawq

For more details, refer to AutoAWQ.


Contributing

We love contributions! Please look at issues marked with the contributions welcome tag.

Before raising an issue, make sure you read the requirements and the Full Documentation. You can also check if a Recipe fits your use case.

Unless there is a bug, please use the Discussions tab to ask questions or propose new topics/features.