Skip to main content

A framework for building and running distributed, AI-powered data pipelines using Ray

Project description

Cosmos-xenna

Introduction

Cosmos-xenna is a Python library for building and running distributed data pipelines using Ray. It has a heavy focus on pipelines which are a series of inference steps using AI models. For example, a pipeline which downloads an image, runs a VLM on it to produce a caption, and then runs an embedding model to produce a text embedding and uploads the resulting data.

Cosmos-xenna simplifies the development of distributed AI pipelines by providing:

  • A simple interface
  • Autoscaling/autobalancing of stages
  • Stateful actors which allow the user to load/download weights before running processing
  • Independent allocation of NVDEC/NVENC hardware and "main" GPU compute

Installing

pip install cosmos-xenna[gpu]

Quick Start

For detailed examples, check out the examples/ directory.

Ray cluster requirements

Cosmos-xenna needs a few environment variables to be set before starting Ray clusters. These are set by Xenna when we start clusters locally, but if using an already existing cluster, they will need to be set in the processes initializing the cluster.

# Needed to give Xenna control over setting CUDA environment variables. Without this, Ray will overwrite the
# environment variables we set.
RAY_EXPERIMENTAL_NOSET_CUDA_VISIBLE_DEVICES="0"
# Needed to get debug info from as many actors as possible. By default, Ray only allows 10k
# actors to be listed. However, on large clusters, we may have more than 10k actors.
RAY_MAX_LIMIT_FROM_API_SERVER=40000
RAY_MAX_LIMIT_FROM_DATA_SOURCE=40000

Development

Setup development environment

We use UV for development. To get started, install UV, and run uv sync in this directory.

This will create a virtual environment at .venv based on the current lock file and will include all of the dependencies from core, dev, GPU, and examples.

Running commands

Use UV to run all commands. For example, to run the example pipeline, use:

uv run examples/simple_vlm_inference.py 

This will auto-sync dependencies if needed and execute the command in the UV-managed virtualenv.

VSCode integration

We provide recommended extensions and default settings for yotta via the .vscode/ folder. With these settings, VSCode should automatically format your code and raise linting/typing issues. VSCode will try to fix some minor linting issues on save.

Linting

We use Ruff and PyRight for static analysis. Using the default VSCode settings and recommended extensions, these should auto-run in VSCode. They can be run manually with:

uv run run_presubmit.py default

Adding dependencies

To add packages to the core dependencies, use uv add some-package-name

To add packages to dev use uv add --dev some-package-name

To add packages to other groups use uv add --group some-group some-package-name

License and Contact

This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use.

NVIDIA Cosmos source code is released under the Apache 2 License.

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

cosmos_xenna-0.1.5.tar.gz (404.7 kB view details)

Uploaded Source

Built Distributions

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

cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_28_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

File details

Details for the file cosmos_xenna-0.1.5.tar.gz.

File metadata

  • Download URL: cosmos_xenna-0.1.5.tar.gz
  • Upload date:
  • Size: 404.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cosmos_xenna-0.1.5.tar.gz
Algorithm Hash digest
SHA256 9f45e149f8c38d3c524e12a692848f9e24f04283c6e468a41f572fdce9877eab
MD5 01fdf933b1646ab8c21d5ccbf30b8279
BLAKE2b-256 78be0bb0b9b5afacfc1190159a6fd0f9d7b17b1a157baaca9be76cfe2f21bdbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosmos_xenna-0.1.5.tar.gz:

Publisher: release-from-tag.yml on nvidia-cosmos/cosmos-xenna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 045a52bb9a27bb68bd5fa0598657c8405fee9843c0462a8d696ed31c25ee6e6c
MD5 16b2c5dc7f02fbfd5ea98cda6fec2858
BLAKE2b-256 145c968d9f0bd2df2755ee03ddfbdba747accd90c153ed18c0e7f47f7d0e33bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_28_aarch64.whl:

Publisher: release-from-tag.yml on nvidia-cosmos/cosmos-xenna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65a9aa80f71c02470cacd1d6212c29fef633151e0a9b5d22c77100eb93a0f4f9
MD5 9848050c4df38da4a748bd4f77787db8
BLAKE2b-256 e46496269b8ade87ef3210589b38167e6a7501eb674550c21aab9231c18d7f8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cosmos_xenna-0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-from-tag.yml on nvidia-cosmos/cosmos-xenna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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