Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
okay ... here we go
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-neuma committed Jun 6, 2024
1 parent 9e7c545 commit 74568f4
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 132 deletions.
23 changes: 23 additions & 0 deletions .github/actions/nm-cp-assets/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: cp assets
description: "cp whl and tarfile to Google storage 'neuralmagic-public-pypi/dist'"
inputs:
python:
description: 'python version, e.g. 3.10.12'
required: true
runs:
using: composite
steps:
- id: mv_assets
run: |
VERSION_BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
WHL=$(find assets -type f -name "*nm_magic_wand*${VERSION_BASE}*.whl")
WHL_FILE=$(basename ${WHL})
echo "whl: ${WHL}"
echo "whl_file: ${WHL_FILE}"
TAR=$(find assets -path "*${{ inputs.python }}-nm-magic-wand*.tar.gz" -type f -name "nm-magic-wand*.tar.gz")
TAR_FILE=$(basename ${TAR})
echo "tar: ${TAR}"
echo "tar_file: ${TAR_FILE}"
gcloud storage cp ${WHL} gs://neuralmagic-public-pypi/dist/${WHL_FILE}
gcloud storage cp ${TAR} gs://neuralmagic-public-pypi/dist/${TAR_FILE}
shell: bash
89 changes: 44 additions & 45 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,57 +107,56 @@ jobs:
test_skip_list: ${{ inputs.test_skip_list }}
secrets: inherit

PUBLISH:
needs: [TEST-SOLO, TEST-MULTI]
uses: ./.github/workflows/nm-publish.yml
UPLOAD:
needs: [TEST-SOLO]
if: contains(fromJSON('["NIGHTLY", "WEEKLY", "RELEASE"]'), inputs.wf_category)
uses: ./.github/workflows/nm-upload-assets-to-gcp.yml
with:
label: ${{ inputs.build_label }}
timeout: ${{ inputs.build_timeout }}
gitref: ${{ github.ref }}
python: ${{ inputs.python }}
whl: ${{ needs.BUILD.outputs.whl }}
tarfile: ${{ needs.BUILD.outputs.tarfile }}
secrets: inherit

BENCHMARK:
needs: [BUILD]
if: success()
uses: ./.github/workflows/nm-benchmark.yml
with:
label: ${{ inputs.test_label_solo }}
benchmark_config_list_file: ${{ inputs.benchmark_config_list_file }}
timeout: ${{ inputs.benchmark_timeout }}
gitref: ${{ github.ref }}
python: ${{ inputs.python }}
whl: ${{ needs.BUILD.outputs.whl }}
# Always push if it is a scheduled job
push_benchmark_results_to_gh_pages: "${{ github.event_name == 'schedule' || inputs.push_benchmark_results_to_gh_pages }}"
secrets: inherit
# BENCHMARK:
# needs: [BUILD]
# if: success()
# uses: ./.github/workflows/nm-benchmark.yml
# with:
# label: ${{ inputs.test_label_solo }}
# benchmark_config_list_file: ${{ inputs.benchmark_config_list_file }}
# timeout: ${{ inputs.benchmark_timeout }}
# gitref: ${{ github.ref }}
# python: ${{ inputs.python }}
# whl: ${{ needs.BUILD.outputs.whl }}
# # Always push if it is a scheduled job
# push_benchmark_results_to_gh_pages: "${{ github.event_name == 'schedule' || inputs.push_benchmark_results_to_gh_pages }}"
# secrets: inherit

TEST-ACCURACY-SMOKE:
needs: [BUILD]
if: inputs.wf_category == 'NIGHTLY'
uses: ./.github/workflows/nm-test-accuracy-smoke.yml
with:
label: ${{ inputs.test_label_solo }}
timeout: ${{ inputs.benchmark_timeout }}
gitref: ${{ inputs.gitref }}
Gi_per_thread: ${{ inputs.Gi_per_thread }}
nvcc_threads: ${{ inputs.nvcc_threads }}
python: ${{ inputs.python }}
whl: ${{ needs.BUILD.outputs.whl }}
secrets: inherit
# TEST-ACCURACY-SMOKE:
# needs: [BUILD]
# if: inputs.wf_category == 'NIGHTLY'
# uses: ./.github/workflows/nm-test-accuracy-smoke.yml
# with:
# label: ${{ inputs.test_label_solo }}
# timeout: ${{ inputs.benchmark_timeout }}
# gitref: ${{ inputs.gitref }}
# Gi_per_thread: ${{ inputs.Gi_per_thread }}
# nvcc_threads: ${{ inputs.nvcc_threads }}
# python: ${{ inputs.python }}
# whl: ${{ needs.BUILD.outputs.whl }}
# secrets: inherit

TEST-ACCURACY-FULL:
needs: [BUILD]
if: ${{ inputs.wf_category == 'WEEKLY' || inputs.wf_category == 'RELEASE' }}
uses: ./.github/workflows/nm-test-accuracy-full.yml
with:
label: ${{ inputs.test_label_multi }}
timeout: ${{ inputs.benchmark_timeout }}
gitref: ${{ inputs.gitref }}
Gi_per_thread: ${{ inputs.Gi_per_thread }}
nvcc_threads: ${{ inputs.nvcc_threads }}
python: ${{ inputs.python }}
whl: ${{ needs.BUILD.outputs.whl }}
secrets: inherit
# TEST-ACCURACY-FULL:
# needs: [BUILD]
# if: ${{ inputs.wf_category == 'WEEKLY' || inputs.wf_category == 'RELEASE' }}
# uses: ./.github/workflows/nm-test-accuracy-full.yml
# with:
# label: ${{ inputs.test_label_multi }}
# timeout: ${{ inputs.benchmark_timeout }}
# gitref: ${{ inputs.gitref }}
# Gi_per_thread: ${{ inputs.Gi_per_thread }}
# nvcc_threads: ${{ inputs.nvcc_threads }}
# python: ${{ inputs.python }}
# whl: ${{ needs.BUILD.outputs.whl }}
# secrets: inherit
8 changes: 4 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
test_label_solo: aws-test-a10g-24G
test_label_multi: ignore
test_timeout: 480
test_skip_list: neuralmagic/tests/skip-for-nightly.txt
test_skip_list: neuralmagic/tests/skip-for-remote-push-tmp.txt

benchmark_label: aws-test-a10g-24G
benchmark_config_list_file: ./.github/data/nm_benchmark_nightly_configs_list.txt
Expand All @@ -45,7 +45,7 @@ jobs:
test_label_solo: aws-test-a10g-24G
test_label_multi: ignore
test_timeout: 480
test_skip_list: neuralmagic/tests/skip-for-nightly.txt
test_skip_list: neuralmagic/tests/skip-for-remote-push-tmp.txt

benchmark_label: aws-test-a10g-24G
benchmark_config_list_file: ./.github/data/nm_benchmark_nightly_configs_list.txt
Expand All @@ -63,7 +63,7 @@ jobs:
test_label_solo: aws-test-a10g-24G
test_label_multi: aws-test-4-a10g-96G
test_timeout: 480
test_skip_list: neuralmagic/tests/skip-for-nightly.txt
test_skip_list: neuralmagic/tests/skip-for-remote-push-tmp.txt

benchmark_label: aws-test-a10g-24G
benchmark_config_list_file: ./.github/data/nm_benchmark_nightly_configs_list.txt
Expand All @@ -81,7 +81,7 @@ jobs:
test_label_solo: aws-test-a10g-24G
test_label_multi: ignore
test_timeout: 480
test_skip_list: neuralmagic/tests/skip-for-nightly.txt
test_skip_list: neuralmagic/tests/skip-for-remote-push-tmp.txt

benchmark_label: aws-test-a10g-24G
benchmark_config_list_file: ./.github/data/nm_benchmark_nightly_configs_list.txt
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/nm-publish.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/nm-upload-assets-to-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: nm upload assets to GCP
run-name: ${{ github.actor }} publishing whl on branch '${{ github.ref}}'
on:

workflow_call:
inputs:
label:
description: "requested runner label (specifies instance)"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
gitref:
description: 'git commit hash or branch name'
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true

jobs:

PUBLISH:
runs-on: ${{ inputs.label }}
timeout-minutes: ${{ fromJson(inputs.timeout) }}

permissions:
contents: 'read'
id-token: 'write'

steps:

- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.gitref }}
submodules: recursive

- name: setenv
id: setenv
uses: ./.github/actions/nm-set-env/

- name: download assets
id: download_whl
uses: actions/download-artifact@v4
with:
path: assets

# GCP
- name: 'Authenticate to Google Cloud'
id: auth
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCP_SA }}

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 473.0.0'

- name: cp assets
id: cp-assets
uses: ./.github/actions/nm-cp-assets/
with:
python: ${{ inputs.python }}
1 change: 1 addition & 0 deletions .github/workflows/remote-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- main
- upload-to-gcp

concurrency:
group: ${{ github.head_ref || github.ref_name }}
Expand Down

0 comments on commit 74568f4

Please sign in to comment.