Skala Installation#
Install from PyPI#
To install skala, you can use pip:
pip install skala
This will install the skala package and all its dependencies, including
torch 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#
The above instructions cover the installation from PyPI, if you want an environment
that is guaranteed to work, we provide instructions for setting up a reproducible
source environment using Pixi as a package manager. 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, 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
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/
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.