[TEST ONLY] Multimodal android jni #1999
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: Android | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
pull_request: | |
paths: | |
- .ci/docker/** | |
- .github/workflows/android.yml | |
- build/*android*.sh | |
- install_requirements.sh | |
- examples/demo-apps/android/** | |
- extension/android/** | |
- extension/module/** | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }} | |
cancel-in-progress: true | |
jobs: | |
build-llm-demo: | |
name: build-llm-demo | |
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | |
strategy: | |
matrix: | |
tokenizer: [bpe, tiktoken] | |
with: | |
runner: linux.2xlarge | |
docker-image: executorch-ubuntu-22.04-clang12-android | |
submodules: 'true' | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
timeout: 90 | |
upload-artifact: android-apps | |
script: | | |
set -eux | |
# The generic Linux job chooses to use base env, not the one setup by the image | |
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]") | |
conda activate "${CONDA_ENV}" | |
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2 | |
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded | |
# Build LLM Demo for Android | |
bash build/build_android_llm_demo.sh ${{ matrix.tokenizer }} ${ARTIFACTS_DIR_NAME} | |
# Upload artifacts to S3. The artifacts are needed not only by the device farm but also TorchChat | |
upload-artifacts: | |
needs: build-llm-demo | |
runs-on: linux.2xlarge | |
steps: | |
- name: Download the artifacts from GitHub | |
uses: actions/download-artifact@v3 | |
with: | |
# The name here needs to match the name of the upload-artifact parameter | |
name: android-apps | |
path: ${{ runner.temp }}/artifacts/ | |
- name: Verify the artifacts | |
shell: bash | |
working-directory: ${{ runner.temp }}/artifacts/ | |
run: | | |
ls -lah ./ | |
- name: Upload the artifacts to S3 | |
uses: seemethere/upload-artifact-s3@v5 | |
with: | |
s3-bucket: gha-artifacts | |
s3-prefix: | | |
${{ github.repository }}/${{ github.run_id }}/artifact | |
# NOTE: Consume stale artifacts won't make sense for benchmarking as the goal is always to | |
# benchmark models as fresh as possible. I'm okay to keep the 14 retention-days for now | |
# for TorchChat until we have a periodic job can publish it more often. Ideally I want to | |
# reduce it to <= 2 day, meaning the benchmark job will run daily. | |
retention-days: 14 | |
if-no-files-found: ignore | |
path: ${{ runner.temp }}/artifacts/ |