Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression test #250

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/linters/.python-lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ max-line-length = 99
max-locals=100
max-statements=300
min-public-methods=1
max-branches=100
max-branches=120
max-module-lines=5000
max-args=20
max-returns=10
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ jobs:
fetch-depth: 0
submodules: true

- name: Check source code files for Unicode and CRLF
run: |
set -e
find . -name 'distiller' -prune -o -type f -size +0c -regex '.*\.\(py\|yaml\|yml\|txt\|h\|c\|sh\)' -print0 | xargs -0 file | grep -P '^(?!.*ASCII)|CRLF' || exit 0
exit 1

- name: Check shell scripts for x-bit
run: |
set -e
find . -name 'distiller' -prune -o -type f -name \*.sh \! -perm -1 -print0 | xargs -0 grep . || exit 0
exit 1

- name: Lint code
uses: super-linter/super-linter/slim@v5
env:
Expand Down
161 changes: 28 additions & 133 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,140 +1,35 @@
---
name: auto-testing
name: Trigger External Workflow

on:
pull_request:
branches:
- develop
pull_request_target:
types: [opened, edited, synchronize]

jobs:
eval:
runs-on: self-hosted
timeout-minutes: 345600
trigger_dispatch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout PR
run: |
fork_repo=$(jq -r .pull_request.head.repo.clone_url $GITHUB_EVENT_PATH)
git clone $fork_repo --recursive
- name: Checkout synthesis
uses: actions/checkout@v2
with:
repository: MaximIntegratedAI/ai8x-synthesis
ref: develop
path: ai8x-synthesis
- name: Setup Pyenv and Install Dependencies
uses: gabrielfalcao/pyenv-action@v13
with:
default: 3.8.11
- name: Create Venv
run: |
pyenv local 3.8.11
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
run: |
pip3 install -U pip wheel setuptools
pip3 install -r requirements-cu11.txt
- name: Create Evaluation Scripts
run: python ./regression/create_eval_script.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
- name: Run Evaluation Scripts
run: bash ./scripts/evaluation_file.sh
- name: Save Evaluation Log Files
run: cp -r /home/test/actions-runner/_work/ai8x-training/ai8x-training/logs/ /home/test/max7800x/evaluation_logs/
- name: Evaluation Results
run: python ./regression/eval_pass_fail.py --testpaths ./regression/paths.yaml

build:
runs-on: self-hosted
needs: [eval]
timeout-minutes: 345600
steps:
- name: Checkout last-dev
uses: actions/checkout@v2
with:
repository: MaximIntegratedAI/ai8x-training
ref: develop
submodules: recursive
- name: Setup Pyenv and Install Dependencies
uses: gabrielfalcao/pyenv-action@v13
with:
default: 3.8.11
- name: Create Venv
run: |
pyenv local 3.8.11
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
- name: Check repository
run: |
pip3 install -U pip wheel setuptools
pip3 install -r requirements-cu11.txt
- name: Last Develop Check
run: python ./regression/last_dev.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
echo "IS_SPECIFIC_REPOSITORY=${{ github.repository == 'MaximIntegratedAI/ai8x-training' }}" >> $GITHUB_ENV
echo "IS_DEVELOP_BRANCH=${{ github.ref == 'refs/heads/develop' }}" >> $GITHUB_ENV

new-code:
runs-on: self-hosted
needs: [build]
timeout-minutes: 345600
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout PR
run: |
fork_repo=$(jq -r .pull_request.head.repo.clone_url $GITHUB_EVENT_PATH)
git clone $fork_repo --recursive
- name: Setup Pyenv and Install Dependencies
uses: gabrielfalcao/pyenv-action@v13
with:
default: 3.8.11
- name: Create Venv
run: |
pyenv local 3.8.11
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
run: |
pip3 install -U pip wheel setuptools
pip3 install -r requirements-cu11.txt
- name: Create Test Script
run: python ./regression/create_test_script.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
- name: Run Training Scripts
run: bash /home/test/actions-runner/_work/ai8x-training/ai8x-training/scripts/output_file.sh
- name: Save Log Files
run: cp -r /home/test/actions-runner/_work/ai8x-training/ai8x-training/logs/ /home/test/max7800x/test_logs/$(date +%Y-%m-%d_%H-%M-%S)
- name: Save Test Scripts
run: cp -r /home/test/actions-runner/_work/ai8x-training/ai8x-training/scripts/output_file.sh /home/test/max7800x/test_scripts/
- name: Create and run ONNX script
run: python ./regression/create_onnx_script.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
- name: Set up environment
if: env.IS_SPECIFIC_REPOSITORY == 'true' && env.IS_DEVELOP_BRANCH == 'true'
run: |
PR_Branch=${{ github.event.pull_request.head.ref }}
Repository=${{ github.repository }}
PR_Number=${{ github.event.pull_request.number }}
PR_Sha=${{ github.event.pull_request.head.sha }}
echo "PR_Branch: $PR_Branch"
echo "Repository: $Repository"
echo "PR_Number: $PR_Number"
echo "PR_Sha: $PR_Sha"

test-results:
runs-on: self-hosted
needs: [new-code]
timeout-minutes: 345600
steps:
- uses: actions/checkout@v2
name: Checkout Test Code
with:
repository: MaximIntegratedAI/ai8x-training
ref: develop
submodules: recursive
- name: Setup Pyenv and Install Dependencies
uses: gabrielfalcao/pyenv-action@v13
with:
default: 3.8.11
- name: Create Venv
run: |
pyenv local 3.8.11
python -m venv venv --prompt ai8x-training
- name: Activate Venv
run: source venv/bin/activate
- name: Install Dependencies
run: |
pip3 install -U pip wheel setuptools
pip3 install -r requirements-cu11.txt
- name: Log Diff
run: python ./regression/log_comparison.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
- name: Test Results
run: python ./regression/pass_fail.py --testconf ./regression/test_config.yaml --testpaths ./regression/paths.yaml
- name: Dispatch event
if: env.IS_SPECIFIC_REPOSITORY == 'true' && env.IS_DEVELOP_BRANCH == 'true'
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.REGRESSION_TEST }}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/MaximIntegratedAI/ai8x-regression/dispatches" \
-d '{"event_type": "repo-pull-request", "client_payload": {"PR_Branch": "${{ github.event.pull_request.head.ref }}", "Repository": "${{ github.repository }}","PR_Number": "${{ github.event.pull_request.number }}","PR_Sha": "${{ github.event.pull_request.head.sha }}" }'
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ max-line-length = 99
max-locals=100
max-statements=300
min-public-methods=1
max-branches=100
max-branches=120
max-module-lines=5000
max-args=20
max-returns=10
Expand Down
3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
extends: default
rules:
line-length: {max: 1024}
new-lines:
type: platform
new-line-at-end-of-file: enable
33 changes: 0 additions & 33 deletions LICENSE.md

This file was deleted.

Loading
Loading