diff --git a/.github/workflows/cuda-perf.yml b/.github/workflows/cuda-perf.yml index ff126dbef1c..6c1e6219b60 100644 --- a/.github/workflows/cuda-perf.yml +++ b/.github/workflows/cuda-perf.yml @@ -144,6 +144,13 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: | set -eux + + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" + echo "::group::Setup ExecuTorch" # OSDC runners can't reach the public PyPI CDN that download.pytorch.org's # transitive deps resolve to. Pre-install torch's pure-python deps from the @@ -160,8 +167,7 @@ jobs: echo "::group::Setup Huggingface" pip install -U "huggingface_hub[cli]>=1.2.1,<2.0" accelerate "optimum~=2.0.0" "transformers==5.0.0rc1" - HF_AUTH_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" - hf auth login --token "$HF_AUTH_TOKEN" + export HF_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) pip install --no-deps git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} echo "::endgroup::" @@ -219,6 +225,13 @@ jobs: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} script: | set -eux + + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" + echo "::group::Setup environment" # OSDC runners can't reach the public PyPI CDN that download.pytorch.org's # transitive deps resolve to. Pre-install torch's pure-python deps from the diff --git a/.github/workflows/cuda-windows.yml b/.github/workflows/cuda-windows.yml index 1af6fdac0ca..175251f7b14 100644 --- a/.github/workflows/cuda-windows.yml +++ b/.github/workflows/cuda-windows.yml @@ -99,6 +99,12 @@ jobs: script: | set -eux + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" + echo "::group::Fix libstdc++ GLIBCXX version" # The executorch pybindings require GLIBCXX_3.4.30 which conda's libstdc++ doesn't have. # Replace conda's libstdc++ with the system version to fix ImportError. @@ -126,8 +132,7 @@ jobs: if [ "${{ matrix.model_name }}" != "dinov2-small-imagenet1k-1-layer" ]; then echo "::group::Setup Huggingface" pip install -U "huggingface_hub[cli]>=1.2.1,<2.0" accelerate "optimum~=2.0.0" "transformers==5.0.0rc1" - HF_AUTH_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" - hf auth login --token "$HF_AUTH_TOKEN" + export HF_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) pip install --no-deps git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} echo "::endgroup::" diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index e4a13c079a5..5178cbcbd0b 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -388,6 +388,12 @@ jobs: script: | set -eux + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" + echo "::group::Setup ExecuTorch" # OSDC runners can't reach the public PyPI CDN that download.pytorch.org's # transitive deps resolve to. Pre-install torch's pure-python deps from the @@ -406,8 +412,7 @@ jobs: if [ "${{ matrix.model.name }}" != "parakeet-tdt" ] && [ "${{ matrix.model.name }}" != "dinov2-small-imagenet1k-1-layer" ]; then echo "::group::Setup Huggingface" pip install -U "huggingface_hub[cli]>=1.2.1,<2.0" accelerate "optimum~=2.0.0" "transformers==5.0.0rc1" - HF_AUTH_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" - hf auth login --token "$HF_AUTH_TOKEN" + export HF_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" OPTIMUM_ET_VERSION=$(cat .ci/docker/ci_commit_pins/optimum-executorch.txt) pip install --no-deps git+https://github.com/huggingface/optimum-executorch.git@${OPTIMUM_ET_VERSION} echo "::endgroup::" @@ -554,6 +559,11 @@ jobs: # fsspec is pinned to satisfy datasets' fsspec[http]<=2025.3.0 so the later # examples install doesn't try to downgrade it from the public CDN. pip install filelock typing-extensions "setuptools<82" sympy networkx jinja2 "fsspec[http]<=2025.3.0" numpy pillow + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" source .ci/scripts/test_model_e2e.sh cuda "${{ matrix.model.repo }}/${{ matrix.model.name }}" "${{ matrix.quant }}" "${RUNNER_ARTIFACT_DIR}" test-cuda-pybind: @@ -605,6 +615,12 @@ jobs: script: | set -eux + # OSDC mounts HF_HOME read-only at /mnt/hf_cache; redirect to a writable dir + # (RUNNER_TEMP, or /tmp when RUNNER_TEMP isn't writable inside the container). + export HF_HOME="${RUNNER_TEMP:-/tmp}/hf_cache" + mkdir -p "${HF_HOME}" 2>/dev/null || export HF_HOME=/tmp/hf_cache + mkdir -p "${HF_HOME}" + echo "::group::Setup ExecuTorch" # Disable MKL to avoid duplicate target error when conda has multiple MKL installations export USE_MKL=OFF @@ -626,8 +642,7 @@ jobs: echo "::group::Setup Huggingface" pip install -U "huggingface_hub[cli]>=1.2.1,<2.0" - HF_AUTH_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" - hf auth login --token "$HF_AUTH_TOKEN" + export HF_TOKEN="$(printf '%s' "$SECRET_EXECUTORCH_HF_TOKEN" | tr -d '\r\n')" echo "::endgroup::" echo "::group::Install optimum-executorch"