Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Documentation

- Refactor `README.md` installation section to recommend uv as the
primary method for managing tinytopics as a project dependency,
with a canonical example for configuring PyTorch with GPU support (#80).
- Remove reference to Rye in `README.md` installation instructions
as it is no longer being developed (#79).

Expand Down
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,39 @@ cd tinytopics
python3 -m pip install -e .
```

### Install PyTorch with GPU support
### Using uv (recommended)

The above will likely install the CPU version of PyTorch by default.
To install PyTorch with GPU support, follow the
[official guide](https://pytorch.org/get-started/locally/).
For a more robust package management experience, use
[uv](https://docs.astral.sh/uv/) to manage tinytopics as a project dependency.

For example, install PyTorch for Windows with CUDA 13.0:
Add tinytopics and PyTorch to your project:

```bash
pip uninstall torch
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130
uv add tinytopics torch torchvision
```

### Install alternative PyTorch versions
To install PyTorch with GPU support (for example, Windows with CUDA 13.0),
configure `pyproject.toml`:

For users stuck with older PyTorch or NumPy versions, for instance, in HPC
cluster settings, a workaround is to skip installing the dependencies with
`--no-deps` and install specific versions of all dependencies manually:
```toml
[tool.uv.sources]
torch = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]
torchvision = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]

```bash
pip install tinytopics --no-deps
pip install torch==2.2.0
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
```

### Use tinytopics in a project
Then sync your environment:

To have a more hassle-free package management experience, it is recommended
to use tinytopics as a dependency under a project context using
virtual environments.
```bash
uv sync
```

You should probably set up a manual source/index for PyTorch.
As an example, check out the official guidelines when
[using uv](https://docs.astral.sh/uv/guides/integration/pytorch/).
For other platforms and accelerators (CPU-only, ROCm, Intel GPUs), see
[Using uv with PyTorch](https://docs.astral.sh/uv/guides/integration/pytorch/).

## Examples

Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Documentation

- Refactor `README.md` installation section to recommend uv as the
primary method for managing tinytopics as a project dependency,
with a canonical example for configuring PyTorch with GPU support (#80).
- Remove reference to Rye in `README.md` installation instructions
as it is no longer being developed (#79).

Expand Down
42 changes: 21 additions & 21 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,39 @@ cd tinytopics
python3 -m pip install -e .
```

### Install PyTorch with GPU support
### Using uv (recommended)

The above will likely install the CPU version of PyTorch by default.
To install PyTorch with GPU support, follow the
[official guide](https://pytorch.org/get-started/locally/).
For a more robust package management experience, use
[uv](https://docs.astral.sh/uv/) to manage tinytopics as a project dependency.

For example, install PyTorch for Windows with CUDA 13.0:
Add tinytopics and PyTorch to your project:

```bash
pip uninstall torch
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130
uv add tinytopics torch torchvision
```

### Install alternative PyTorch versions
To install PyTorch with GPU support (for example, Windows with CUDA 13.0),
configure `pyproject.toml`:

For users stuck with older PyTorch or NumPy versions, for instance, in HPC
cluster settings, a workaround is to skip installing the dependencies with
`--no-deps` and install specific versions of all dependencies manually:
```toml
[tool.uv.sources]
torch = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]
torchvision = [{ index = "pytorch-cu130", marker = "sys_platform == 'win32'" }]

```bash
pip install tinytopics --no-deps
pip install torch==2.2.0
[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true
```

### Use tinytopics in a project
Then sync your environment:

To have a more hassle-free package management experience, it is recommended
to use tinytopics as a dependency under a project context using
virtual environments.
```bash
uv sync
```

You should probably set up a manual source/index for PyTorch.
As an example, check out the official guidelines when
[using uv](https://docs.astral.sh/uv/guides/integration/pytorch/).
For other platforms and accelerators (CPU-only, ROCm, Intel GPUs), see
[Using uv with PyTorch](https://docs.astral.sh/uv/guides/integration/pytorch/).

## Examples

Expand Down