Skip to main content

BioNeMo core interfaces and PyTorch-related code.

Project description

bionemo-core

Common code that all BioNeMo framework packages depend on. Contains highly reusable, battle-tested abstractions and implementations that are valuable across a wide variety of domains and applications.

Crucially, the bionemo-core Python package (namespace bionemo.core) depends on PyTorch and PyTorch Lightning. Other key BioNeMo component libraries, such as bionemo-llm and bionemo-geometric, obtain their PyTorch dependencies via bionemo-core.

Developer Setup

After following the setup specified in the README, you may install this project's code in your environment via executing:

pip install -e .

To run unit tests with code coverage, execute:

pytest -v --cov=bionemo --cov-report=term .

Package Highlights

In bionemo.core.model.config:

  • ModelOutput: A Model's forward pass may produce a tensor, multiple tensors, or named tensors.
  • LossType: A generic type parameter for a loss function.
  • Model: An interface for any ML model that accepts and produces torch.Tensors.
  • ModelType: A generic type parameter that is constrained to the Model interface.
  • BionemoModelConfig: An abstract class that enables parameterizable model instantiation that is compatible with Megatron.
  • BionemoTrainableModelConfig: An extension that includes the loss function to use with the model during training.

In bionemo.core.utils:

  • the batching_utils module's pad_token_ids, which pads token ids with padding value & returns a mask.
  • the dtype module's get_autocast_dtype, which converts from nemo/nvidia datatypes to their PyTorch equivalents.
  • the random_utils module, which includes functions for managing random seeds and performing sampling.

In the bionemo.data package, there is:

  • multi_epoch_dataset: contains many dataset implements that are useful for mutli-epoch training.
  • resamplers: contains a P-RNG based Dataset implementation.

There's a constant global value, bionemo.core.BIONEMO_CACHE_DIR, which is used as a local on-disk cache for resources.

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

bionemo_core-0.0.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

bionemo_core-0.0.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file bionemo_core-0.0.1.tar.gz.

File metadata

  • Download URL: bionemo_core-0.0.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for bionemo_core-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1dbd042172680d36b6e748d663b4747c818adc7784fa7a092860a1bc758ca1cd
MD5 6aa5de2be2d29b0e0520280ac39a9f36
BLAKE2b-256 acfc6b76700deb9128be30425770d439e1324b3dab3d9a7afe84cb0cac1692a7

See more details on using hashes here.

File details

Details for the file bionemo_core-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: bionemo_core-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for bionemo_core-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efe8e840dd3eb053896a7cac2dff424907e716395228f8a8a443edbdcc574ed3
MD5 07ed851146c88a4ab7d4420fc2f4e7f5
BLAKE2b-256 f03c59ff45e04925e92efb045b42fb98898af5144dd42cccfd83dbeb363397b2

See more details on using hashes here.

Supported by

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