Skip to main content

To use Evo2 easily in HPC

Project description

EasyEvo2

Python 3.11+ pypi License: MIT

A Python toolkit for easily using Evo2 models in bioinformatics workflows, particularly in HPC environments.

Description

EasyEvo2 provides a simplified interface to Evo2 foundation models for sequence embedding. It enables biologists and bioinformaticians to efficiently extract embeddings from DNA, RNA, or protein sequences without extensive deep learning expertise. It's specially designed to work well in High-Performance Computing (HPC) environments.

Installation

# Install from PyPI
pip install easyevo2

# Or install from source
git clone https://github.com/ylab-hi/EasyEvo2.git
cd EasyEvo2
pip install .

Usage

Basic Usage

# Embed sequences from a FASTA/FASTQ file using the default model (evo2_7b)
easyevo2 embed input.fa

# Specify a different model and specific layer
easyevo2 embed input.fa --model-type evo2_40b --layer-name blocks.28.mlp.l3

# Specify a different model and multiple layers
easyevo2 embed input.fa --model-type evo2_40b --layer-name blocks.28.mlp.l3 blocks.28.mlp.l2

# Save to a specific output file
easyevo2 embed input.fa --output my_embeddings

The output will be a safetensor file containing the embeddings for each sequence in the input file. We can load the embeddings using the load_tensor function:

from easyevo2.io import load_tensor

embeddings = load_tensor("my_embeddings.mode.layer.safetensors")
print(embeddings)
# Output: {
# "seq1": torch.tensor([...]),
# "seq2": torch.tensor([...]),
# }

Evo2 Memory Estimates

Model GPU Memory Usage Embedding Dimension Batch Size
Evo2 1B Base 1.5 GB 2048 1
Evo2 7B 15 GB 4096 1
Evo2 40B Base >80 GB* -- 1
Evo2 40B >80 GB* -- 1

* Estimated based on scaling from other models

Notes:

  • Longer sequences require proportionally more memory
  • H100 GPUs (80GB) can accommodate the 7B model with batch size 1 but may struggle with the 40B model

Development

This project uses a Makefile to automate common development tasks:

# Show available commands
make help

# Run tests
make test

# Lint code
make lint

# Format code
make format

# Build package
make build

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

easyevo2-0.1.11.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

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

easyevo2-0.1.11-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file easyevo2-0.1.11.tar.gz.

File metadata

  • Download URL: easyevo2-0.1.11.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for easyevo2-0.1.11.tar.gz
Algorithm Hash digest
SHA256 33ad1e636eae91f06aeee887fee2825c2132e942b7cf662e1a980fc5d1981b87
MD5 ba0b41395ea798b0e132618a1ef15bcd
BLAKE2b-256 1ee3d811693a22f606c128ecb261e59ca19d3c770dc104bc20014569e65ec757

See more details on using hashes here.

File details

Details for the file easyevo2-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: easyevo2-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for easyevo2-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 5cd229d195f1ae4b323e7009bdca43d7a26d8934e349a6b9a938d923557f460a
MD5 fab4bce7834eae82dd81f35b2438a43c
BLAKE2b-256 f7f006a2c001828fcdd87537be0e7c64a9017beed8fd899610dc7a532c94597d

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