Create unified script and workflow for llama-fast models validationin #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: executorch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
jobs: | ||
gather-models: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
models: ${{ steps.gather-models.outputs.models }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'false' | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Extract the list of models to test | ||
id: gather-models | ||
run: | | ||
set -eux | ||
PYTHONPATH="${PWD}" python ./scripts/gather_test_models.py | ||
test-models-mobile-linux: | ||
name: test-models-mobile-linux | ||
needs: gather-models | ||
strategy: | ||
matrix: ${{ fromJSON(needs.gather-models.outputs.models) }} | ||
runner: ["32-core-ubuntu"] | ||
Check failure on line 32 in .github/workflows/executorch.yml GitHub Actions / executorchInvalid workflow file
|
||
fail-fast: false | ||
runs-on: ${{ matrix.runner }} | ||
env: | ||
LLAMA_FAST_ROOT: ${{ github.workspace }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Print machine info | ||
run: | | ||
echo "Platform: $(uname -s)" | ||
echo "Processor type: $(uname -p)" | ||
echo "Number of processors: $(nproc)" | ||
echo "RAM: $(free -h | awk '/Mem/ {print $2}')" | ||
echo "Disk space: $(df -h --total | awk '/total/ {print $2}')" | ||
- name: Install ExecuTorch | ||
run: | | ||
bash ${LLAMA_FAST_ROOT}/scripts/install_et.sh | ||
- name: Download checkpoints | ||
run: | | ||
bash ${LLAMA_FAST_ROOT}/.ci/scripts/download_checkpoints.sh ${{ matrix.checkpoint_name }} "${{ matrix.resources }}" | ||
- name: Run inferencec | ||
run: | | ||
set -exu | ||
pushd ${LLAMA_FAST_ROOT} | ||
export CHECKPOINT_NAME=${{ matrix.checkpoint_name }} | ||
export CHECKPOINT_PATH=${LLAMA_FAST_ROOT}/checkpoints/${CHECKPOINT_NAME}/${CHECKPOINT_NAME}.pt | ||
python generate.py --checkpoint-path ${CHECKPOINT_PATH} --temperature 0 > ${PWD}/output_eager | ||
cat ${PWD}/output_eager | ||
python export.py --checkpoint-path ${CHECKPOINT_PATH} --output-pte-path ${PWD}/${CHECKPOINT_NAME}.pte | ||
python generate.py --checkpoint-path ${CHECKPOINT_PATH} --temperature 0 --pte-path ${PWD}/${CHECKPOINT_NAME}.pte > ${PWD}/output_et | ||
cat ${PWD}/output_et | ||
echo "Tests complete." | ||
test-models-mobile-macos: | ||
name: test-models-mobile-macos | ||
needs: gather-models | ||
strategy: | ||
matrix: ${{ fromJSON(needs.gather-models.outputs.models) }} | ||
runner: ["macos-12", "macos-14"] | ||
runs-on: ${{ matrix.runner }} | ||
env: | ||
LLAMA_FAST_ROOT: ${{ github.workspace }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Print machine info | ||
run: | | ||
uname -a | ||
if [ $(uname -s) == Darwin ]; then | ||
sysctl machdep.cpu.brand_string | ||
sysctl machdep.cpu.core_count | ||
fi | ||
- name: Install ExecuTorch | ||
run: | | ||
bash ${LLAMA_FAST_ROOT}/scripts/install_et.sh | ||
- name: Download checkpoints | ||
run: | | ||
bash ${LLAMA_FAST_ROOT}/.ci/scripts/download_checkpoints.sh ${{ matrix.checkpoint_name }} "${{ matrix.resources }}" | ||
- name: Run inference | ||
run: | | ||
set -exu | ||
pushd ${LLAMA_FAST_ROOT} | ||
export CHECKPOINT_NAME=${{ matrix.checkpoint_name }} | ||
export CHECKPOINT_PATH=${LLAMA_FAST_ROOT}/checkpoints/${CHECKPOINT_NAME}/${CHECKPOINT_NAME}.pt | ||
python generate.py --checkpoint-path ${CHECKPOINT_PATH} --temperature 0 > ${PWD}/output_eager | ||
cat ${PWD}/output_eager | ||
python export.py --checkpoint-path ${CHECKPOINT_PATH} --output-pte-path ${PWD}/${CHECKPOINT_NAME}.pte | ||
python generate.py --checkpoint-path ${CHECKPOINT_PATH} --temperature 0 --pte-path ${PWD}/${CHECKPOINT_NAME}.pte > ${PWD}/output_et | ||
cat ${PWD}/output_et | ||
echo "Tests complete." |