amd64-specific requirements handling

This commit is contained in:
shamoon
2026-01-14 00:08:35 -08:00
parent f1b21d4eec
commit 668c146fd0

View File

@@ -200,7 +200,16 @@ RUN set -eux \
'--extra-index-url https://download.pytorch.org/whl/cpu' \
'torch==2.7.0' \
> /tmp/torch-cpu-constraints.txt \
&& uv export --quiet --no-dev --all-extras --format requirements-txt --output-file requirements.txt \
&& if [ "${TARGETARCH}" = "amd64" ]; then \
uv export --quiet --no-dev --all-extras --no-hashes --format requirements-txt --output-file requirements.txt ; \
else \
uv export --quiet --no-dev --all-extras --format requirements-txt --output-file requirements.txt ; \
fi \
&& if [ "${TARGETARCH}" = "amd64" ]; then \
# Drop CUDA/NVIDIA-only packages that are pulled in by the CUDA PyTorch wheels on amd64.
# We'll force a CPU-only torch wheel via constraints during install, so these are unnecessary.
sed -i -E '/^(nvidia-|triton==|cusparselt==)/d' requirements.txt ; \
fi \
&& if [ "${TARGETARCH}" = "amd64" ]; then \
uv pip install --no-cache --system --no-python-downloads --python-preference system \
--index-strategy unsafe-best-match \