Pixi is a great tool for Python dependency management, supporting both conda and pypi out of the box. It also includes many other great features, such as tasks and multi-platform support.
Another great feature of pixi is the support for multiple environments. The following pyproject.toml
shows how to setup a simple Jax project with two distinct environments (called "features" in pixi) for CPU-only or GPU support. This allows debugging code locally on a laptop without GPU support, and allows for running training on separate devices on a machine with a GPU, by specifying the -e
(--environment
) flag:
pixi run python train.py # Runs on CPU by default
pixi run -e gpu python train.py # Runs on Jax with cuda support
pyproject.toml