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 producestorch.Tensor
s.ModelType
: A generic type parameter that is constrained to theModel
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'spad_token_ids
, which pads token ids with padding value & returns a mask. - the
dtype
module'sget_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bionemo_core-0.0.2.tar.gz
.
File metadata
- Download URL: bionemo_core-0.0.2.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4e9343796d89736e1bfd38166fd2db31e10a7f3c49aad4f8b2f6b4c44f81e70 |
|
MD5 | a6f5fb4e242803461421d0d033357e01 |
|
BLAKE2b-256 | c1382bb085479ee86825e2fc4024166d7640f3c1324b9d933ae3764ec6808958 |
File details
Details for the file bionemo_core-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: bionemo_core-0.0.2-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a231d95396185fcf96dcf1e9cce358cb9a194a097aa0319c3e4a7ab42709efe |
|
MD5 | 18718b950c3dc75a2999d883778177a5 |
|
BLAKE2b-256 | b0670bb6e307d19d388fb9ce65ad3314de0776f96bf2a46141b31ca2e25dc612 |