name: Test Parallel (v2)
on:
workflow_call:
inputs:
resolved_short:
required: true
type: string
description: Short SHA of upstream PyTorch (from _build-new.yml outputs)
defaults:
run:
shell: bash
jobs:
config:
runs-on: ubuntu-latest
outputs:
matrix_json: ${{ steps.build.outputs.matrix_json }}
steps:
- uses: actions/checkout@v6
with:
ref: ci-test
- name: Build test matrix from classification config
id: build
run: |
python3 -c "
import json
import sys; sys.path.insert(0, '.github/scripts/v2')
from shard_test_files import load_categories_config
config = load_categories_config('.github/config/nightly_v2_test_whitelist.yml')
include = []
for cat_name, cat_cfg in config.get('categories', {}).items():
n = cat_cfg.get('shards', 1)
runner = cat_cfg.get('runner', 'linux-aarch64-a3-8')
npu_count = int(runner.rsplit('-', 1)[-1]) if runner else 8
devices_per_proc = cat_cfg.get('devices_per_proc', 1)
for s in range(1, n + 1):
include.append({
'category': cat_name,
'shard': s,
'num_shards': n,
'runner': runner,
'npu_count': npu_count,
'devices_per_proc': devices_per_proc,
})
matrix = {'include': include}
print(json.dumps(matrix))
" > /tmp/matrix.json
MATRIX=$(cat /tmp/matrix.json)
echo "matrix_json=${MATRIX}" >> "$GITHUB_OUTPUT"
echo "Test matrix: ${MATRIX}"
test:
needs: config
strategy:
matrix: ${{ fromJson(needs.config.outputs.matrix_json) }}
fail-fast: false
uses: ./.github/workflows/_test-exec-new.yml
secrets: inherit
with:
resolved_short: ${{ inputs.resolved_short }}
category: ${{ matrix.category }}
shard: ${{ matrix.shard }}
num_shards: ${{ matrix.num_shards }}
runner: ${{ matrix.runner }}
npu_count: ${{ matrix.npu_count }}
devices_per_proc: ${{ matrix.devices_per_proc }}
report:
needs: [config, test]
if: always() && needs.config.result == 'success'
uses: ./.github/workflows/_test-report-new.yml
secrets: inherit