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

testpr #412

Closed
wants to merge 1 commit 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
4 changes: 4 additions & 0 deletions .github/scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ def get_bench_cmd(run_type, run_id, run_name, runfile, run_param_name, dtype):
return cmd

if __name__ == '__main__':
sec = os.environ.get('TEST_SEC')
print("testing sec, run_tests.py: " + sec + ";")
exit()

parser = argparse.ArgumentParser(prog='Run Benchmarks')
parser.add_argument(
'--print',
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/start_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ def run_command(cmd):


if __name__ == '__main__':
sec = os.environ.get('TEST_SEC')
print("testing sec, start_instances.py: " + sec + ";")
exit()
conn = get_db_conn()
cursor = conn.cursor()

Expand Down
213 changes: 101 additions & 112 deletions .github/workflows/regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
HF_TOKEN: ${{ secrets.HF_TOKEN }}
TEST_SEC: ${{ secrets.TEST_SEC}}

jobs:
start_instances:
Expand All @@ -33,41 +34,35 @@ jobs:
contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) &&
contains(github.event.comment.body, '$hidet-ci launch')
runs-on: ubuntu-latest
outputs:
started_instances: ${{ steps.run_py_script.outputs.started_instances }}
hw_configs: ${{ steps.run_py_script.outputs.hw_configs }}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install dependencies
run: pip install mysql-connector-python
# - name: Install dependencies
# run: pip install mysql-connector-python

- name: Run main Python script
id: run_py_script
run: timeout 900 python ./.github/scripts/start_instances.py
env:
# TODO: Allow launching only specified GPU instances
HW_CONFIG: all
REPO_NAME: ${{ github.repository }}
# env:
# # TODO: Allow launching only specified GPU instances
# HW_CONFIG: all
# REPO_NAME: ${{ github.repository }}

- name: Upload run configs
uses: actions/upload-artifact@v3
with:
name: run_configs
path: run_configs.json
retention-days: 1
# - name: Upload run configs
# uses: actions/upload-artifact@v3
# with:
# name: run_configs
# path: run_configs.json
# retention-days: 1

run_tests:
needs: start_instances
timeout-minutes: 2880
strategy:
matrix:
hw_configs: ${{ fromJSON(needs.start_instances.outputs.hw_configs) }}
runs-on: ${{ matrix.hw_configs }}
container:
image: nvcr.io/nvidia/pytorch:23.10-py3
options: --gpus all
# strategy:
# matrix:
# hw_configs: ${{ fromJSON(needs.start_instances.outputs.hw_configs) }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -77,112 +72,106 @@ jobs:
format('refs/pull/{0}/head', github.event.issue.number) }}
path: hidet

- name: Checkout models
uses: actions/checkout@v4
with:
repository: ${{ secrets.MODEL_REPO }}
token: ${{ secrets.GH_PAT }}
path: models
ref: ci
# - name: Checkout models
# uses: actions/checkout@v4
# with:
# repository: ${{ secrets.MODEL_REPO }}
# token: ${{ secrets.GH_PAT }}
# path: models
# ref: ci

- name: Install dependencies
run: |
pip install -r hidet/requirements.txt
pip install -r hidet/requirements-dev.txt
pip install -r hidet/.github/requirements-ci.txt
# - name: Install dependencies
# run: |
# pip install -r hidet/requirements.txt
# pip install -r hidet/requirements-dev.txt
# pip install -r hidet/.github/requirements-ci.txt

- name: Build hidet
run: |
bash hidet/scripts/wheel/build_wheel.sh
WHEEL=$(find hidet/scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
echo "Built wheel: ${{ env.WHEEL_NAME }}"
# - name: Build hidet
# run: |
# bash hidet/scripts/wheel/build_wheel.sh
# WHEEL=$(find hidet/scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
# echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
# echo "Built wheel: ${{ env.WHEEL_NAME }}"

- name: Install hidet
run: |
pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
# - name: Install hidet
# run: |
# pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}

- name: Install models
run: |
pip install -e models
# - name: Install models
# run: |
# pip install -e models

- name: Download run configs
uses: actions/download-artifact@v3
with:
name: run_configs
# - name: Download run configs
# uses: actions/download-artifact@v3
# with:
# name: run_configs

- name: Clear cache
run: |
hidet cache clear --all
# - name: Clear cache
# run: |
# hidet cache clear --all

- name: Run tests
timeout-minutes: 2880
run: |
python hidet/.github/scripts/run_tests.py
env:
HW_CONFIG: ${{ matrix.hw_configs }}
REPO_NAME: ${{ github.repository }}
REPO_BRANCH: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('pull/{0}', github.event.issue.number) }}

- name: Upload run configs
uses: actions/upload-artifact@v3
with:
name: run_configs_${{ matrix.hw_configs }}
path: run_configs.json
retention-days: 1
# - name: Upload run configs
# uses: actions/upload-artifact@v3
# with:
# name: run_configs_${{ matrix.hw_configs }}
# path: run_configs.json
# retention-days: 1

upload_results:
runs-on: ubuntu-latest
needs: [start_instances, run_tests]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('refs/pull/{0}/head', github.event.issue.number) }}
# upload_results:
# runs-on: ubuntu-latest
# needs: [start_instances, run_tests]
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# with:
# ref: |
# ${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
# format('refs/pull/{0}/head', github.event.issue.number) }}

- name: Install dependencies
run: pip install mysql-connector-python
# - name: Install dependencies
# run: pip install mysql-connector-python

- name: Download run configs
uses: actions/download-artifact@v3
# - name: Download run configs
# uses: actions/download-artifact@v3

- name: Setup ENV
run: |
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
COMMIT_AUTHOR=$(git log -1 --format=%an)
COMMIT_SHA=$(git log -1 --format=%H)
echo "COMMIT_TIME=$COMMIT_TIME" >> $GITHUB_ENV
echo "COMMIT_AUTHOR=$COMMIT_AUTHOR" >> $GITHUB_ENV
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
# - name: Setup ENV
# run: |
# COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
# COMMIT_AUTHOR=$(git log -1 --format=%an)
# COMMIT_SHA=$(git log -1 --format=%H)
# echo "COMMIT_TIME=$COMMIT_TIME" >> $GITHUB_ENV
# echo "COMMIT_AUTHOR=$COMMIT_AUTHOR" >> $GITHUB_ENV
# echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV

- name: Run main Python script
run: python ./.github/scripts/upload_results.py
env:
REPO_NAME: ${{ github.repository }}
REPO_BRANCH: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('pull/{0}', github.event.issue.number) }}
COMMIT_SHA: ${{ env.COMMIT_SHA }}
COMMIT_TIME: ${{ env.COMMIT_TIME }}
COMMIT_AUTHOR: ${{ env.COMMIT_AUTHOR }}
HW_CONFIGS: ${{ needs.start_instances.outputs.hw_configs }}
# - name: Run main Python script
# run: python ./.github/scripts/upload_results.py
# env:
# REPO_NAME: ${{ github.repository }}
# REPO_BRANCH: |
# ${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
# format('pull/{0}', github.event.issue.number) }}
# COMMIT_SHA: ${{ env.COMMIT_SHA }}
# COMMIT_TIME: ${{ env.COMMIT_TIME }}
# COMMIT_AUTHOR: ${{ env.COMMIT_AUTHOR }}
# HW_CONFIGS: ${{ needs.start_instances.outputs.hw_configs }}

stop_instances:
if: |
github.event_name == 'workflow_dispatch' && inputs.shutdown_instances ||
github.event_name == 'issue_comment' && github.event.issue.pull_request != '' &&
!contains(github.event.comment.body, '--keep')
runs-on: ubuntu-latest
needs: [start_instances, run_tests]
steps:
- name: Checkout repo
uses: actions/checkout@v4
# stop_instances:
# if: |
# github.event_name == 'workflow_dispatch' && inputs.shutdown_instances ||
# github.event_name == 'issue_comment' && github.event.issue.pull_request != '' &&
# !contains(github.event.comment.body, '--keep')
# runs-on: ubuntu-latest
# needs: [start_instances, run_tests]
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4

- name: Run main Python script
run: timeout 900 python ./.github/scripts/stop_instances.py
env:
STARTED_INSTANCES: ${{ needs.start_instances.outputs.started_instances }}
# - name: Run main Python script
# run: timeout 900 python ./.github/scripts/stop_instances.py
# env:
# STARTED_INSTANCES: ${{ needs.start_instances.outputs.started_instances }}
7 changes: 7 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
pull_request:
workflow_call:

env:
TEST_SEC: ${{ secrets.TEST_SEC }}

jobs:
tests:
if: github.repository == 'hidet-org/hidet'
Expand All @@ -18,6 +21,10 @@ jobs:
image: nvidia/cuda:11.8.0-devel-ubuntu20.04
options: --gpus all
steps:
- name: testing sec
run: |
echo "testing sec: $TEST_SEC"

- name: Install dependencies via apt
run: |
apt update && DEBIAN_FRONTEND=noninteractive apt install -y ccache git graphviz
Expand Down
Loading