Installation#
Install from PyPI#
To install skala, you can use pip:
pip install skala
This will install the skala packages and all its dependencies, including
torch, e3nn, and opt_einsum_fx for running the exchange-correlation model
pyscf for running the self-consistent field (SCF) calculations and evaluating the density features
pyscf-dispersion on Linux or dftd3 on macOS on Apple Silicon for computing the D3 dispersion correction to the total energy
Skala supports Linux and macOS on Apple Silicon with Python 3.11 through 3.13, PySCF 2.14, and PyTorch 2.12 or 2.13.
The default Pytorch installation is the GPU version, which the skala package in combination with PySCF doesn’t leverage. To install only the much smaller CPU version of Pytorch, run the following before installing the skala package:
pip install torch --index-url https://download.pytorch.org/whl/cpu
Reproducible source environments#
Skala uses Pixi for source dependency management. The
repository contains one pixi.toml and one committed pixi.lock covering
all supported Python, PySCF, PyTorch, CUDA, documentation, release, and native
build environments. Install Pixi 0.75, then clone the repository and install the
default CPU environment:
git clone https://github.com/microsoft/skala
cd skala
pixi install --locked -e default
The local Skala package is installed editable. Run commands through Pixi so they always use the selected environment:
pixi run -e default python your_script.py
OMP_NUM_THREADS=4 pixi run -e default pytest -v --doctest-modules \
--cov=skala --cov-report=xml --cov-report=term-missing --cov-report=html \
--durations=50 --durations-min=1.0 skala/src/skala/ skala/tests/
pixi run -e default pre-commit run --all-files
Set OMP_NUM_THREADS=4 when running tests locally to match CI.
The locked compatibility environments are:
Environment |
Python |
PySCF |
PyTorch / CUDA |
|---|---|---|---|
|
3.11 |
2.14 |
2.13 CPU |
|
3.12 |
2.14 |
2.12 CPU |
|
3.12 |
2.14 |
2.13 CPU |
|
3.13 |
2.14 |
2.13 CPU |
|
3.12 |
2.14 |
2.12 / CUDA 12 |
|
3.12 |
2.14 |
2.13 / CUDA 12 |
|
3.12 |
2.14 |
2.13 / CUDA 13 |
For example, install and test the primary CUDA environment with:
pixi install --locked -e gpu-cuda12-torch213
pixi run -e gpu-cuda12-torch213 python tools/verify_gpu.py
OMP_NUM_THREADS=4 pixi run -e gpu-cuda12-torch213 \
pytest -v -m 'gpu and not profiling and not model_benchmark' skala/tests/
The CUDA platforms are encoded in the lockfile, so container builds do not need a CUDA override when no GPU is attached. Runtime GPU checks still require a compatible NVIDIA driver and device.
For development purposes, please initialize the pre-commit hooks via:
pixi run -e default pre-commit install
To test your installation, you can run the tests:
OMP_NUM_THREADS=4 pixi run -e default pytest -v --doctest-modules \
--cov=skala --cov-report=xml --cov-report=term-missing --cov-report=html \
--durations=50 --durations-min=1.0 skala/src/skala/ skala/tests/
Model checkpoints#
The pre-trained Skala model checkpoints are hosted on Hugging Face and downloaded automatically by the Python package in this repository from there for running calculations.