Skip to main content

Reference implementation of operators for deep signal processing architectures

Project description

Vortex

This repository contains implementations of computational primitives for convolutional multi-hybrid models and layers: Hyena-[SE, MR, LI], StripedHyena 2, Evo 2.

For training, please refer to the savanna project.

Interface

There are two main ways to interface with vortex:

  1. Use vortex as the inference engine for pre-trained multi-hybrids such as Evo 2 40B. In this case, we recommend installing vortex in a new environment (see below).
  2. Import from vortex specific classes, kernels or utilities to work with custom convolutional multi-hybrids. For example,sourcing utilities from hyena_ops.interface.

1. Pip install

The simplest way to install vortex is from PyPi or github.

Requirements

Vortex requires PyTorch and Transformer Engine, and it is strongly recommended to also use Flash Attention. For detailed instructions and compatibility information, please refer to their respective GitHub repositories. Note TransformerEngine requires python 3.12 and has these additional system requirements.

Example of installing prerequisites. We recommended using conda for easy installation of Transformer Engine:

conda install -c nvidia cuda-nvcc cuda-cudart-dev
conda install -c conda-forge transformer-engine-torch==2.3.0
pip install flash-attn==2.8.0.post2

Installing vortex

After installing the requirements, you can install vortex:

pip install vtx

or you can install vortex after cloning the repository:

pip install .

Installing without Transformer Engine (Evo 2 7b only)

If your environment cannot build Transformer Engine (e.g., incompatible CUDA/Python version), you can skip it. The Evo 2 7b models (8k, 262k, 1m context) work without TE in pure bfloat16:

pip install vtx

Note: Evo 2 40b, 20b, and 1b models require Transformer Engine for FP8 support and will not load without it.

2. Quick install for vortex ops

make setup-vortex-ops

Note that this does not install all dependencies required to run autoregressive inference with larger pre-trained models.

3. Running in a Docker environment

Docker is one of the easiest ways to get started with Vortex (and Evo 2). The Docker environment does not depend on the currently installed CUDA version and ensures that major dependencies (such as PyTorch and Transformer Engine) are pinned to specific versions, which is beneficial for reproducibility.

To run Evo 2 40B generation sample, simply run ./run.

To run Evo 2 7B generation sample: sz=7 ./run.

To run tests: ./run ./run_tests.

To interactively execute commands in docker environment: ./run bash.

Generation quickstart

python3 generate.py \
    --config_path <PATH_TO_CONFIG> \
    --checkpoint_path <PATH_TO_CHECKPOINT> \
    --input_file <PATH_TO_INPUT_FILE> \
    --cached_generation

--cached_generation activates KV-caching and custom caching for different variants of Hyena layers, reducing peak memory usage and latency.

Acknowledgements

Vortex was developed by Michael Poli (Zymrael) and Garyk Brixi (garykbrixi). Vortex maintainers include Michael Poli (Zymrael), Garyk Brixi (garykbrixi), Anton Vorontsov (antonvnv) with contributions from Amy Lu (amyxlu), Jerome Ku (jeromeku).

Cite

If you find this project useful, consider citing the following references.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vtx-1.1.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vtx-1.1.0-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

Details for the file vtx-1.1.0.tar.gz.

File metadata

  • Download URL: vtx-1.1.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for vtx-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0d54516d8a76aeec6839539b17273fa763349041266b6be7a1ae85c59f6d2404
MD5 168dac92acd0826df6985faa941ac6c0
BLAKE2b-256 45f738fd51db739d11d22d4231bb096769a98d1972447f9c39ee483da362e773

See more details on using hashes here.

File details

Details for the file vtx-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: vtx-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for vtx-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ff9f1db2f9e81e288150b60fd4fe4832b8b992ac2c6c947271b2036ffeb8299
MD5 53bd24b8c395149d95d6f72d8311ee9d
BLAKE2b-256 e2ed9dab64893b6b78f832e4d18522bbd6696350a415c20e0af6bcea1b0f8152

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page