diff --git a/docker/gpu/Dockerfile b/docker/gpu/Dockerfile index 0f5ae779..e6685abd 100644 --- a/docker/gpu/Dockerfile +++ b/docker/gpu/Dockerfile @@ -21,7 +21,11 @@ COPY --chown=appuser:appuser pyproject.toml ./pyproject.toml # Install dependencies with GPU extras RUN uv venv --python 3.10 && \ - uv sync --extra gpu --no-cache + if [ "$(uname -m)" = "aarch64" ]; then \ + uv pip install --python .venv/bin/python --no-cache -e ".[gpu-arm64]" --prerelease=allow; \ + else \ + uv sync --extra gpu --no-cache; \ + fi # Copy project files including models COPY --chown=appuser:appuser api ./api diff --git a/pyproject.toml b/pyproject.toml index 13447b57..17cc5f14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ dependencies = [ [project.optional-dependencies] gpu = ["torch==2.8.0+cu129"] +gpu-arm64 = ["torch"] cpu = ["torch==2.8.0"] test = [ "pytest==8.3.5", @@ -55,12 +56,13 @@ test = [ ] [tool.uv] -conflicts = [[{ extra = "cpu" }, { extra = "gpu" }]] +conflicts = [[{ extra = "cpu" }, { extra = "gpu" }, { extra = "gpu-arm64" }]] [tool.uv.sources] torch = [ { index = "pytorch-cpu", extra = "cpu" }, { index = "pytorch-cuda", extra = "gpu" }, + { index = "pytorch-nightly", extra = "gpu-arm64" }, ] [[tool.uv.index]] @@ -73,6 +75,11 @@ name = "pytorch-cuda" url = "https://download.pytorch.org/whl/cu129" explicit = true +[[tool.uv.index]] +name = "pytorch-nightly" +url = "https://download.pytorch.org/whl/nightly/cu126" +explicit = true + [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta"