Skip to content

Commit 9524f67

Browse files
authored
Merge pull request #109 from talmolab/aidan/uv
Added uv support
2 parents 6dc8ff3 + d43c917 commit 9524f67

File tree

4 files changed

+83
-140
lines changed

4 files changed

+83
-140
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,70 @@
44
This is part of the Virtual Neuroscience Lab (VNL) project.
55

66
## Installation
7+
8+
### Option 1: `uv`
9+
10+
#### Prerequisites
11+
12+
- Python 3.11 or 3.12
13+
- [uv](https://docs.astral.sh/uv/) package manager (recommended) or pip
14+
- CUDA 12.x or 13.x (for GPU support, optional)
15+
16+
#### Installing `uv`
17+
18+
If you don't have uv installed:
19+
20+
```bash
21+
# Linux/macOS
22+
curl -LsSf https://astral.sh/uv/install.sh | sh
23+
24+
# Or using pip
25+
pip install uv
26+
```
27+
28+
#### Installation Steps
29+
30+
1. Clone the repository:
31+
```bash
32+
git clone https://github.com/talmolab/stac-mjx.git
33+
```
34+
2. Create and activate a virutal environment:
35+
```bash
36+
uv venv
37+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
38+
```
39+
3. Install the package with optional dependencies based on your hardware. CUDA 12, CUDA 13, and CPU-only configurations are supported:
40+
41+
For CUDA 12.x:
42+
```bash
43+
uv pip install -e ".[cuda12]"
44+
```
45+
46+
For CUDA 13.x:
47+
```bash
48+
uv pip install -e ".[cuda13]"
49+
```
50+
51+
For CPU-only:
52+
```bash
53+
uv pip install -e .
54+
```
55+
56+
For development, include the `[dev]` extras in addition to the hardware optional dependencies:
57+
```bash
58+
uv pip install -e ".[cuda13,dev]"
59+
```
60+
4. Verify the installation:
61+
```bash
62+
python -c "import jax; print(f'JAX version: {jax.__version__}'); print(f'Available devices: {jax.devices()}')"
63+
```
64+
5. Register the environment as a Jupyter kernel:
65+
```bash
66+
python -m ipykernel install --user --name=stac-mjx --display-name="Python (stac-mjx)"
67+
```
68+
69+
### Option 2: `conda`
70+
771
stac-mjx relies on many prerequisites, therefore we suggest installing in a new conda environment, using the provided `environment.yaml`:
872
[Local installation before package is officially published]
973
1. Clone the repository `git clone https://github.com/talmolab/stac-mjx.git` and `cd` into it

demos/rodent_demo.ipynb

Lines changed: 17 additions & 140 deletions
Large diffs are not rendered by default.
File renamed without changes.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ version = {attr = "stac_mjx.version.__version__"}
4242
readme = {file = ["README.md"], content-type="text/markdown"}
4343

4444
[project.optional-dependencies]
45+
cuda12 = ["jax[cuda12]==0.7.2 ; sys_platform == 'linux'"]
46+
cuda13 = ["jax[cuda13]==0.7.2 ; sys_platform == 'linux'"]
4547
dev = [
4648
"pytest",
4749
"pytest-cov",

0 commit comments

Comments
 (0)