mirror of
https://github.com/nod-ai/AMD-SHARK-Studio.git
synced 2026-02-19 11:56:43 -05:00
* Update nightly.yml to fix wheel building issues. * Update setup_venv.sh to only install torch+cu116 if IMPORTER=1 is set.
94 lines
3.6 KiB
YAML
94 lines
3.6 KiB
YAML
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: Nightly Release
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 5 * * *'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: a100
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Setup pip cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Compute version
|
|
run: |
|
|
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
|
|
tag_name="${package_version}"
|
|
echo "package_version=${package_version}" >> $GITHUB_ENV
|
|
echo "tag_name=${tag_name}" >> $GITHUB_ENV
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.NODAI_INVOCATION_TOKEN }}
|
|
with:
|
|
tag_name: ${{ env.tag_name }}
|
|
release_name: nod.ai SHARK ${{ env.tag_name }}
|
|
body: |
|
|
Automatic snapshot release of nod.ai SHARK.
|
|
draft: true
|
|
prerelease: false
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install flake8 pytest toml
|
|
if [ -f requirements.txt ]; then pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases; fi
|
|
- name: Lint with flake8
|
|
run: |
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude shark.venv,lit.cfg.py
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude shark.venv,lit.cfg.py
|
|
|
|
- name: Build and validate the package
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
./setup_venv.sh
|
|
source shark.venv/bin/activate
|
|
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
|
|
SHARK_PACKAGE_VERSION=${package_version} \
|
|
pip wheel -v -w wheelhouse . --pre -f https://download.pytorch.org/whl/nightly/torch -f https://github.com/llvm/torch-mlir/releases -f https://github.com/nod-ai/SHARK-Runtime/releases
|
|
# Install the built wheel
|
|
pip install ./wheelhouse/nodai*
|
|
# Validate the Models
|
|
pytest -k 'not benchmark' --ignore=benchmarks/tests/test_hf_benchmark.py --ignore=benchmarks/tests/test_benchmark.py --ignore=shark/tests/test_shark_importer.py --ignore=tank/tf/
|
|
|
|
- name: Upload Release Assets
|
|
id: upload-release-assets
|
|
uses: dwenegar/upload-release-assets@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.NODAI_INVOCATION_TOKEN }}
|
|
with:
|
|
release_id: ${{ steps.create_release.outputs.id }}
|
|
assets_path: ./wheelhouse/nodai_*.whl
|
|
|
|
- name: Publish Release
|
|
id: publish_release
|
|
uses: eregon/publish-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.NODAI_INVOCATION_TOKEN }}
|
|
with:
|
|
release_id: ${{ steps.create_release.outputs.id }}
|