Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
69 changes: 69 additions & 0 deletions .github/workflows/_ci-run-decision.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI Run Decision

# Single source of truth for "should this commit force-run all CI jobs
# regardless of path filter?". Used by per-job ``if:`` gates in pull.yml
# and trunk.yml so the sampling logic isn't repeated per job.
#
# Returns ``is-full-run = 'true'`` for:
# - workflow_dispatch (manual run)
# - ciflow/* tag pushes (maintainer-forced full run)
# - push events whose SHA is in the deterministic 25% sample
# (last hex char in {0,4,8,c})
#
# Returns ``is-full-run = 'false'`` for:
# - pull_request / pull_request_target (use path filter instead)
# - push events not matching any of the above (path-filtered runs)
#
# See ``viable-strict-gate.yml``: viable/strict only advances on
# commits where this is true, so the path-filtered fast path doesn't
# silently advance partial signal.

on:
workflow_call:
outputs:
is-full-run:
description: "'true' if this commit should run all CI jobs regardless of path filter; 'false' otherwise."
value: ${{ jobs.decide.outputs.is-full-run }}

jobs:
decide:
runs-on: ubuntu-latest
outputs:
is-full-run: ${{ steps.compute.outputs.is-full-run }}
steps:
- name: Compute is-full-run
id: compute
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
SHA: ${{ github.sha }}
run: |
set -eu

IS_FULL=false

case "$EVENT_NAME" in
workflow_dispatch)
IS_FULL=true
;;
esac

case "$REF" in
refs/tags/ciflow/*)
IS_FULL=true
;;
esac

# Deterministic 25% sample on push: SHA's last hex char in {0,4,8,c}.
# Keep in sync with the sample in viable-strict-gate.yml.
if [ "$IS_FULL" = "false" ] && [ "$EVENT_NAME" = "push" ]; then
case "$SHA" in
*0|*4|*8|*c) IS_FULL=true ;;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can hit 100 consecutive sha ending it 0,4,8,c in a row :p

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very unlikely, but I take the point :)

I'll change sampling to be based on git history depth so it regularly runs every 4 commits

esac
fi

echo "Event: $EVENT_NAME"
echo "Ref: $REF"
echo "SHA: $SHA"
echo "is-full-run: $IS_FULL"
echo "is-full-run=$IS_FULL" >> "$GITHUB_OUTPUT"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
98 changes: 98 additions & 0 deletions .github/workflows/promote-to-viable-strict.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Promote commit to viable/strict

# Manual escape hatch for the sampled-CI gating in
# `_ci-run-decision.yml` + `viable-strict-gate.yml`.
#
# Pushes a `ciflow/trunk/<sha>` tag at a chosen commit, which:
# 1. Re-triggers `pull.yml` / `trunk.yml` against that commit with
# ``is-full-run = true`` (every gated job runs regardless of
# path filter or SHA sample).
# 2. Triggers `viable-strict-gate.yml` for that commit; the gate
# succeeds because tag pushes always count as a full-run.
#
# Once those tag-triggered runs all pass, the next
# `update-viablestrict` cron run will be able to advance viable/strict
# to the chosen commit.
#
# Use cases:
# - Bisecting a regression on a non-sampled commit.
# - Pre-release validation: pin viable/strict to a specific commit
# (e.g. release branch tip) regardless of its SHA's sample bit.
# - Recovering when recent sampled commits all happen to be red.

on:
workflow_dispatch:
inputs:
sha:
description: "Full 40-char SHA on main / release/* to promote"
required: true
type: string

permissions:
contents: write

concurrency:
# One in-flight promotion at a time; safer than racing tag pushes.
group: promote-to-viable-strict
cancel-in-progress: false

jobs:
push-ciflow-tag:
if: ${{ github.repository_owner == 'pytorch' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate SHA and push ciflow tag
env:
SHA: ${{ inputs.sha }}
run: |
set -euo pipefail

# Reject anything that isn't a full 40-char lowercase hex SHA.
if [[ ! "$SHA" =~ ^[0-9a-f]{40}$ ]]; then
echo "::error::Input must be a full 40-char lowercase hex SHA; got: '$SHA'"
exit 1
fi

# The commit must exist locally (fetch-depth: 0 above pulls
# everything, but defensively confirm it's an object).
if ! git cat-file -e "$SHA^{commit}" 2>/dev/null; then
echo "::error::SHA $SHA is not a commit in this repository."
exit 1
fi

# Restrict promotion to commits reachable from a release-track
# branch. Prevents tagging arbitrary commits (PR heads,
# rewritten branches, etc.) that aren't part of the official
# main/release history.
REACHABLE=false
for branch in main $(git branch -r | grep -E 'origin/release/' | sed 's|origin/||'); do
if git merge-base --is-ancestor "$SHA" "origin/$branch" 2>/dev/null; then
echo "SHA is reachable from origin/$branch"
REACHABLE=true
break
fi
done
if [ "$REACHABLE" = "false" ]; then
echo "::error::SHA $SHA is not reachable from main or any release/* branch."
exit 1
fi

TAG="ciflow/trunk/$SHA"

# If the tag already exists (e.g. someone already promoted
# this commit), exit cleanly — no-op is a valid outcome.
if git ls-remote --tags --exit-code origin "refs/tags/$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists on origin; nothing to do."
exit 0
fi

git config user.name "pytorchbot"
git config user.email "pytorchbot@users.noreply.github.com"
git tag "$TAG" "$SHA"
git push origin "$TAG"

echo "::notice::Pushed $TAG. Watch the tag-triggered workflow runs (pull / trunk / viable-strict-gate); once they pass, the next update-viablestrict cron (every 30 min) will advance viable/strict."
14 changes: 11 additions & 3 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
name: Get changed files
uses: ./.github/workflows/_get-changed-files.yml

# Emits is-full-run='true' for PR/dispatch/tag/sampled-push commits
# (the ~25% of pushes that should run full CI) and 'false' otherwise.
# Per-job `if:` checks this to bypass path filtering on full-run
# commits while staying path-filtered on the 75% non-sampled pushes.
run-decision:
name: CI run decision
uses: ./.github/workflows/_ci-run-decision.yml

test-qnn-wheel-packages-linux:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: test-qnn-wheel-packages-linux
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
Expand Down Expand Up @@ -1517,17 +1525,17 @@
python -m unittest backends/vulkan/test/test_vulkan_delegate.py -k "*torchao*"

test-coreml-bc-macos:
needs: changed-files
needs: [changed-files, run-decision]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do it for windows?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll focus on macOS + core infra (viable strict update changes and main PR selection job) in this PR. windows and cuda enablement can be follow-ups.

if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_coreml_bc.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/utils.sh') ||
contains(needs.changed-files.outputs.changed-files, 'install_executorch.py') ||
contains(needs.changed-files.outputs.changed-files, 'install_executorch.sh') ||
contains(needs.changed-files.outputs.changed-files, 'install_requirements.py') ||
contains(needs.changed-files.outputs.changed-files, 'install_requirements.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/pull.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/pull.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
name: test-coreml-bc-macos (${{ matrix.runner }})
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
permissions:
Expand Down
69 changes: 50 additions & 19 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,24 @@
name: Get changed files
uses: ./.github/workflows/_get-changed-files.yml

# Emits is-full-run='true' for PR/dispatch/tag/sampled-push commits
# (the ~25% of pushes that should run full CI) and 'false' otherwise.
# Per-job `if:` checks this to bypass path filtering on full-run
# commits while staying path-filtered on the 75% non-sampled pushes.
run-decision:
name: CI run decision
uses: ./.github/workflows/_ci-run-decision.yml

test-models-macos-cpu:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: test-models-macos-cpu
needs: run-decision
# Path-filter-on-push (sampled): runs on every PR / dispatch /
# ciflow tag, and on ~25% of pushes via _ci-run-decision.yml.
# The viable-strict-gate workflow blocks viable/strict from
# advancing on the 75% non-sampled pushes.
if: |
github.event_name == 'pull_request' ||
needs.run-decision.outputs.is-full-run == 'true'
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
matrix:
Expand Down Expand Up @@ -146,6 +162,10 @@

test-custom-ops-macos:
name: test-custom-ops-macos
needs: run-decision
if: |
github.event_name == 'pull_request' ||
needs.run-decision.outputs.is-full-run == 'true'
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
matrix:
Expand All @@ -169,6 +189,10 @@

test-selective-build-macos:
name: test-selective-build-macos
needs: run-decision
if: |
github.event_name == 'pull_request' ||
needs.run-decision.outputs.is-full-run == 'true'
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
matrix:
Expand Down Expand Up @@ -310,67 +334,68 @@
backends/arm/test/test_arm_backend.sh "${ARM_TEST}"

test-coreml-delegate:
needs: changed-files
needs: [changed-files, run-decision]
# Path-filtered: see _ci-run-decision.yml for the sampling policy.
if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'examples/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-macos.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-conda.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
name: test-coreml-delegate
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
default-packages: ""
runner: macos-14-xlarge
python-version: '3.11'
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
BUILD_TOOL=cmake

bash .ci/scripts/setup-conda.sh
# Setup MacOS dependencies as there is no Docker support on MacOS atm
GITHUB_RUNNER=1 PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
# Build and test coreml delegate
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/build_all.sh

test-static-llama-ane:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: changed-files
needs: [changed-files, run-decision]
if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'examples/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'examples/models/llama') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/export') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/tokenizers') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_ane_static_llama.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/utils.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
Comment on lines +375 to +376
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not add the sha % 4 logic here and not kick off a new job? curious

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

B/c then we can use it in other jobs (like mlx.yml or cuda.yml) and keep the selection logic in one place

name: test-static-llama-ane
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
default-packages: ""
runner: macos-m1-stable
python-version: '3.11'
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
script: |
set -eux
bash .ci/scripts/setup-conda.sh
eval "$(conda shell.bash hook)"

# Install requirements
${CONDA_RUN} sh install_requirements.sh
${CONDA_RUN} sh backends/apple/coreml/scripts/install_requirements.sh
${CONDA_RUN} python install_executorch.py
${CONDA_RUN} sh examples/models/llama/install_requirements.sh

# Test ANE llama
${CONDA_RUN} sh .ci/scripts/test_ane_static_llama.sh

test-llama-torchao-lowbit:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: test-llama-torchao-lowbit
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
with:
Expand Down Expand Up @@ -451,59 +476,59 @@
PYTHON_EXECUTABLE=python bash .ci/scripts/test_llama.sh -model stories110M -build_tool "${BUILD_TOOL}" -dtype "${DTYPE}" -mode "${MODE}" -upload "${ARTIFACTS_DIR_NAME}"

test-llama-runner-macos:
needs: changed-files
needs: [changed-files, run-decision]
# Whole-job gate (matrix cells can't be individually if'd):
# mps / coreml / xnnpack+custom+quantize_kv.
if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/mps') ||
contains(needs.changed-files.outputs.changed-files, 'backends/xnnpack') ||
contains(needs.changed-files.outputs.changed-files, 'examples/models/llama') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/export') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/tokenizers') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/runner') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/custom_ops') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/sampler') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_llama.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-macos.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
name: test-llama-runner-mac
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
matrix:
dtype: [fp32]
mode: [mps, coreml, xnnpack+custom+quantize_kv]
fail-fast: false
with:
default-packages: ""
runner: macos-m1-stable
python-version: '3.11'
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 900
script: |

DTYPE=${{ matrix.dtype }}
MODE=${{ matrix.mode }}

bash .ci/scripts/setup-conda.sh

# Setup executorch
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool cmake

if [[ "${MODE}" == "coreml" ]]; then
# Install coreml delegate
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
echo "Finishing installing coreml."
fi

# Install requirements for export_llama
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash examples/models/llama/install_requirements.sh
# Test llama2
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_llama.sh -model stories110M -build_tool cmake -dtype "${DTYPE}" -mode "${MODE}"

test-torchao-huggingface-checkpoints:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: test-torchao-huggingface-checkpoints
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
permissions:
Expand Down Expand Up @@ -551,7 +576,13 @@
bash .ci/scripts/test_torchao_huggingface_checkpoints.sh ${{ matrix.model }} --test_with_runner ${{ matrix.backend == 'torchao' && '--use_torchao_kernels' || '' }}

test-multimodal-macos:
if: ${{ !github.event.pull_request.head.repo.fork }}
needs: run-decision
if: |
!github.event.pull_request.head.repo.fork &&
(
github.event_name == 'pull_request' ||
needs.run-decision.outputs.is-full-run == 'true'
)
name: test-multimodal-macos
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
permissions:
Expand Down Expand Up @@ -644,95 +675,95 @@
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"

test-models-macos-coreml:
needs: changed-files
needs: [changed-files, run-decision]
if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'examples/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'examples/models') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_model.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-macos.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
name: test-models-macos-coreml
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
matrix:
model: [dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, ic4, mobilebert, mv2, mv3, resnet50, vit, w2l]
fail-fast: false
with:
default-packages: ""
runner: macos-m1-stable
python-version: '3.11'
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
MODEL_NAME=${{ matrix.model }}
BUILD_TOOL=cmake
BACKEND="coreml-pybind"


# Set model specific overrides
if [[ "${MODEL_NAME}" == "mobilebert" ]]; then
# See https://github.com/pytorch/executorch/issues/12907
# mobilebert has nan output on FP16, and high MSE on fp32, so we disable runtime test now
BACKEND="coreml"
fi

if [[ "${MODEL_NAME}" == "efficient_sam" ]]; then
# See https://github.com/pytorch/executorch/issues/12906
# efficient_sam fails to run on CoreML
BACKEND="coreml"
fi

bash .ci/scripts/setup-conda.sh

# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
echo "Finishing installing coreml."

PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"

test-models-macos-mps:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
needs: changed-files
needs: [changed-files, run-decision]
if: |
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/mps') ||
contains(needs.changed-files.outputs.changed-files, 'examples/apple/mps') ||
contains(needs.changed-files.outputs.changed-files, 'examples/models') ||
contains(needs.changed-files.outputs.changed-files, 'devtools/bundled_program') ||
contains(needs.changed-files.outputs.changed-files, 'devtools/etrecord') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/export') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_model.sh') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/setup-macos.sh') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
name: test-models-macos-mps
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
strategy:
fail-fast: false
with:
default-packages: ""
runner: macos-m1-stable
python-version: '3.11'
submodules: 'recursive'
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
timeout: 90
script: |
BUILD_TOOL=cmake
bash .ci/scripts/setup-conda.sh

# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"

# Build and test mps model
for MODEL_NAME in mv3 ic4 resnet50 edsr mobilebert w2l; do
echo "::group::Exporting mps model: $MODEL_NAME"
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "mps"
echo "::endgroup::"
done

test-huggingface-transformers-xnnpack:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
# NB: Don't run this on fork PRs because they won't have access to the secret and would fail anyway
if: ${{ !github.event.pull_request.head.repo.fork }}
name: test-huggingface-transformers-xnnpack
Expand Down Expand Up @@ -821,19 +852,19 @@
echo "::endgroup::"

test-huggingface-transformers-macos:
needs: changed-files
needs: [changed-files, run-decision]
# NB: Don't run this on fork PRs because they won't have access to the secret and would fail anyway
if: |
!github.event.pull_request.head.repo.fork &&
(
github.event_name != 'pull_request' ||
contains(needs.changed-files.outputs.changed-files, 'backends/apple/coreml') ||
contains(needs.changed-files.outputs.changed-files, 'extension/llm/runner') ||
contains(needs.changed-files.outputs.changed-files, '.ci/scripts/test_huggingface_optimum_model.py') ||
contains(needs.changed-files.outputs.changed-files, '.ci/docker/ci_commit_pins/optimum-executorch.txt') ||
contains(needs.changed-files.outputs.changed-files, 'install_executorch.py') ||
contains(needs.changed-files.outputs.changed-files, 'install_requirements.py') ||
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml')
contains(needs.changed-files.outputs.changed-files, '.github/workflows/trunk.yml') ||
needs.run-decision.outputs.is-full-run == 'true'
)
name: test-huggingface-transformers-macos
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
Expand Down
Loading
Loading