From 6218ac382095beafa0dee121f277a48d31286147 Mon Sep 17 00:00:00 2001 From: derekk-nm Date: Wed, 3 Jul 2024 14:47:16 +0000 Subject: [PATCH 1/6] upload RELEASE wheel to pypi.org passing the workflow category and wheel file name to nm-upload-assets-to-gcp.yml workflow so that they can be used by the publish_whl action. --- .github/workflows/nm-build-test.yml | 2 ++ .github/workflows/nm-upload-assets-to-gcp.yml | 20 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nm-build-test.yml b/.github/workflows/nm-build-test.yml index 9a5043308a067..2e666ed70af6e 100644 --- a/.github/workflows/nm-build-test.yml +++ b/.github/workflows/nm-build-test.yml @@ -169,6 +169,8 @@ jobs: label: gcp-k8s-util timeout: ${{ inputs.build_timeout }} gitref: ${{ github.ref }} + wf_category: ${{ inputs.wf_category }} + whl: ${{ needs.BUILD.outputs.whl }} secrets: inherit # update docker diff --git a/.github/workflows/nm-upload-assets-to-gcp.yml b/.github/workflows/nm-upload-assets-to-gcp.yml index 8d8835271de0a..0dad796b13840 100644 --- a/.github/workflows/nm-upload-assets-to-gcp.yml +++ b/.github/workflows/nm-upload-assets-to-gcp.yml @@ -16,7 +16,14 @@ on: description: 'git commit hash or branch name' type: string required: true - + wf_category: + description: "workflow category: REMOTE, NIGHTLY, RELEASE" + type: string + default: "REMOTE" + whl: + description: "wheel file path" + type: string + required: true jobs: PUBLISH: @@ -53,6 +60,16 @@ jobs: with: path: assets + - name: push wheel to pypi.org + # this workflow is only run if push-to-pypi is True, and we only + # want to push RELEASE wheels to the external pypi.org + if: ${{ inputs.wf_category }} == "RELEASE" + uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@main + with: + username: ${{ secrets.PYPI_PUBLIC_USER }} + password: ${{ secrets.PYPI_PUBLIC_AUTH }} + whl: ${{ inputs.whl }} + # GCP - name: 'Authenticate to Google Cloud' id: auth @@ -70,3 +87,4 @@ jobs: - name: cp assets id: cp-assets uses: ./.github/actions/nm-cp-assets/ + From ef34d580d014d1f9b34b23075cf72923bd7fd6e4 Mon Sep 17 00:00:00 2001 From: derekk-nm Date: Tue, 9 Jul 2024 15:59:32 +0000 Subject: [PATCH 2/6] PR revisions - refactor code from nm-cp-assets that gets wheel and tar.gz files into a new action that can be used for that and our nm-upload-assets-to-gcp.yml workflow - correct syntax in the if statement - use nm-actions @v1.0.0 --- .github/actions/nm-cp-assets/action.yml | 19 ++++++------ .../actions/nm_whl_tar_gz_names/action.yml | 25 +++++++++++++++ .github/workflows/nm-build-test.yml | 1 - .github/workflows/nm-upload-assets-to-gcp.yml | 31 +++++++++++++------ 4 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 .github/actions/nm_whl_tar_gz_names/action.yml diff --git a/.github/actions/nm-cp-assets/action.yml b/.github/actions/nm-cp-assets/action.yml index b4957d30d3b25..cf67aaa49e3f6 100644 --- a/.github/actions/nm-cp-assets/action.yml +++ b/.github/actions/nm-cp-assets/action.yml @@ -1,18 +1,17 @@ name: cp assets description: "cp whl and tarfile to Google storage 'neuralmagic-public-pypi/dist'" +inputs: + whl: + description: "the wheel asset file path" + required: true + targz: + description: "the tar.gz asset file path" + required: true runs: using: composite steps: - id: cp_assets run: | - WHL=$(find assets -type f -name "*nm_vllm*.whl") - WHL_FILE=$(basename ${WHL}) - echo "whl: ${WHL}" - echo "whl_file: ${WHL_FILE}" - TAR=$(find assets -path "*nm-vllm*.tar.gz" -type f -name "nm-vllm*.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} + gcloud storage cp ${WHL} gs://neuralmagic-public-pypi/dist/${{ inputs.whl }} + gcloud storage cp ${TAR} gs://neuralmagic-public-pypi/dist/${{ inputs.targz }} shell: bash diff --git a/.github/actions/nm_whl_tar_gz_names/action.yml b/.github/actions/nm_whl_tar_gz_names/action.yml new file mode 100644 index 0000000000000..aa23c2bba00a8 --- /dev/null +++ b/.github/actions/nm_whl_tar_gz_names/action.yml @@ -0,0 +1,25 @@ +name: get wheel and tar.gz names +description: "retrieve the whl and tarfile names from existing assets" +outputs: + whl: + description: "the wheel asset file path" + value: ${{ steps.whl_targz_names.outputs.whl }} + targz: + description: "the tar.gz asset file path" + value: ${{ steps.whl_targz_names.outputs.targz }} +runs: + using: composite + steps: + - id: whl_targz_names + run: | + WHL=$(find assets -type f -name "*nm_vllm*.whl") + WHL_FILE=$(basename ${WHL}) + echo "whl: ${WHL}" + echo "whl_file: ${WHL_FILE}" + TAR=$(find assets -path "*nm-vllm*.tar.gz" -type f -name "nm-vllm*.tar.gz") + TAR_FILE=$(basename ${TAR}) + echo "tar: ${TAR}" + echo "tar_file: ${TAR_FILE}" + echo "whl=${WHL_FILE}" >> $GITHUB_OUTPUT + echo "targz=${TAR_FILE}" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/workflows/nm-build-test.yml b/.github/workflows/nm-build-test.yml index d57acd6a4f8ec..fc64d6dc35d14 100644 --- a/.github/workflows/nm-build-test.yml +++ b/.github/workflows/nm-build-test.yml @@ -170,7 +170,6 @@ jobs: timeout: ${{ inputs.build_timeout }} gitref: ${{ github.ref }} wf_category: ${{ inputs.wf_category }} - whl: ${{ needs.BUILD.outputs.whl }} secrets: inherit # update docker diff --git a/.github/workflows/nm-upload-assets-to-gcp.yml b/.github/workflows/nm-upload-assets-to-gcp.yml index eba427927679d..0e6cb3c14e245 100644 --- a/.github/workflows/nm-upload-assets-to-gcp.yml +++ b/.github/workflows/nm-upload-assets-to-gcp.yml @@ -20,10 +20,6 @@ on: description: "workflow category: REMOTE, NIGHTLY, RELEASE" type: string default: "REMOTE" - whl: - description: "wheel file path" - type: string - required: true workflow_dispatch: inputs: @@ -84,15 +80,29 @@ jobs: with: path: assets + - name: get wheel and tar.gz names + id: whl_targz_names + uses: ./.github/actions/nm_whl_tar_gz_names + + # this workflow is only run if push-to-pypi is True, and we only + # want to push RELEASE assets to the external pypi.org + # publish the wheel file - name: push wheel to pypi.org - # this workflow is only run if push-to-pypi is True, and we only - # want to push RELEASE wheels to the external pypi.org - if: ${{ inputs.wf_category }} == "RELEASE" - uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@main + if: ${{ inputs.wf_category == "RELEASE" }} + uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 with: username: ${{ secrets.PYPI_PUBLIC_USER }} password: ${{ secrets.PYPI_PUBLIC_AUTH }} - whl: ${{ inputs.whl }} + whl: ${{ steps.whl_targz_names.outputs.whl }} + + # publish the tar.gz file + - name: push tar.gz to pypi.org + if: ${{ inputs.wf_category == "RELEASE" }} + uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 + with: + username: ${{ secrets.PYPI_PUBLIC_USER }} + password: ${{ secrets.PYPI_PUBLIC_AUTH }} + whl: ${{ steps.whl_targz_names.outputs.targz }} # GCP - name: 'Authenticate to Google Cloud' @@ -111,6 +121,9 @@ jobs: - name: cp assets id: cp-assets uses: ./.github/actions/nm-cp-assets/ + with: + whl: ${{ steps.whl_targz_names.outputs.whl }} + targz: ${{ steps.whl_targz_names.outputs.targz }} - name: trigger stratus nm-pypi update workflow to update nm-pypi index uses: actions/github-script@v6 From 9e5ffa9f3512a7f883b306fe6d9714c024dd7f19 Mon Sep 17 00:00:00 2001 From: derekk-nm Date: Tue, 9 Jul 2024 16:08:57 +0000 Subject: [PATCH 3/6] fix if --- .github/workflows/nm-upload-assets-to-gcp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nm-upload-assets-to-gcp.yml b/.github/workflows/nm-upload-assets-to-gcp.yml index 0e6cb3c14e245..fb73af2153566 100644 --- a/.github/workflows/nm-upload-assets-to-gcp.yml +++ b/.github/workflows/nm-upload-assets-to-gcp.yml @@ -88,7 +88,7 @@ jobs: # want to push RELEASE assets to the external pypi.org # publish the wheel file - name: push wheel to pypi.org - if: ${{ inputs.wf_category == "RELEASE" }} + if: ${{ inputs.wf_category == 'RELEASE' }} uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 with: username: ${{ secrets.PYPI_PUBLIC_USER }} @@ -97,7 +97,7 @@ jobs: # publish the tar.gz file - name: push tar.gz to pypi.org - if: ${{ inputs.wf_category == "RELEASE" }} + if: ${{ inputs.wf_category == 'RELEASE' }} uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 with: username: ${{ secrets.PYPI_PUBLIC_USER }} From 6370dd0b9609572c404135647050a04467f42579 Mon Sep 17 00:00:00 2001 From: Andy Linfoot <78757007+andy-neuma@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:12:08 -0400 Subject: [PATCH 4/6] expand benchmark to h100's (#371) SUMMARY: * updated "build test" to accept an array of benchmarking labels * updated "remote push" and "nightly" workflows to include benchmarking on h100's * adjusted docker job to have same criteria as upload job. did this since upload could fail, but for auth reasons and this shouldn't stop us from push docker. TEST PLAN: runs on remote push --------- Co-authored-by: andy-neuma --- .github/workflows/nm-build-test.yml | 11 +++++++---- .github/workflows/nm-nightly.yml | 2 +- .github/workflows/nm-remote-push.yml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nm-build-test.yml b/.github/workflows/nm-build-test.yml index fc64d6dc35d14..2e2b404c81fef 100644 --- a/.github/workflows/nm-build-test.yml +++ b/.github/workflows/nm-build-test.yml @@ -58,10 +58,10 @@ on: required: true # benchmark related parameters - benchmark_label: - description: "requested benchmark label (specifies instance)" + benchmark_labels: + description: "stringified Json array of benchmark labels" type: string - default: "" + required: true benchmark_config_list_file: description: "benchmark configs file, e.g. 'nm_benchmark_nightly_configs_list.txt'" type: string @@ -136,9 +136,12 @@ jobs: BENCHMARK: needs: [BUILD] if: success() + strategy: + matrix: + benchmark_label: ${{ fromJson(inputs.benchmark_labels) }} uses: ./.github/workflows/nm-benchmark.yml with: - label: ${{ inputs.benchmark_label }} + label: ${{ matrix.benchmark_label }} benchmark_config_list_file: ${{ inputs.benchmark_config_list_file }} timeout: ${{ inputs.benchmark_timeout }} gitref: ${{ github.ref }} diff --git a/.github/workflows/nm-nightly.yml b/.github/workflows/nm-nightly.yml index 434f2b9032b1b..494198bf496fc 100644 --- a/.github/workflows/nm-nightly.yml +++ b/.github/workflows/nm-nightly.yml @@ -39,7 +39,7 @@ jobs: {"python":"3.11.4","label":"gcp-k8s-l4-solo","test":"neuralmagic/tests/test_skip_env_vars/full.txt"}]' test_timeout: 480 - benchmark_label: gcp-k8s-l4-solo + benchmark_labels: '["gcp-k8s-l4-solo", "k8s-h100-solo"]' benchmark_config_list_file: ./.github/data/nm_benchmark_base_config_list.txt benchmark_timeout: 480 push_benchmark_results_to_gh_pages: "${{ github.event_name == 'schedule' || inputs.push_benchmark_results_to_gh_pages }}" diff --git a/.github/workflows/nm-remote-push.yml b/.github/workflows/nm-remote-push.yml index a44274d9e8a11..17108f345f891 100644 --- a/.github/workflows/nm-remote-push.yml +++ b/.github/workflows/nm-remote-push.yml @@ -25,7 +25,7 @@ jobs: {"python":"3.11.4","label":"gcp-k8s-l4-solo","test":"neuralmagic/tests/test_skip_env_vars/smoke.txt"}]' test_timeout: 480 - benchmark_label: gcp-k8s-l4-solo + benchmark_labels: '["gcp-k8s-l4-solo", "k8s-h100-solo"]' benchmark_config_list_file: ./.github/data/nm_benchmark_base_config_list.txt benchmark_timeout: 480 From b4d90208e26025390f3ff509e0d918bef88800fe Mon Sep 17 00:00:00 2001 From: derekk-nm Date: Tue, 9 Jul 2024 15:59:32 +0000 Subject: [PATCH 5/6] PR revisions - refactor code from nm-cp-assets that gets wheel and tar.gz files into a new action that can be used for that and our nm-upload-assets-to-gcp.yml workflow - correct syntax in the if statement - use nm-actions @v1.0.0 --- .github/workflows/nm-upload-assets-to-gcp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nm-upload-assets-to-gcp.yml b/.github/workflows/nm-upload-assets-to-gcp.yml index fb73af2153566..0e6cb3c14e245 100644 --- a/.github/workflows/nm-upload-assets-to-gcp.yml +++ b/.github/workflows/nm-upload-assets-to-gcp.yml @@ -88,7 +88,7 @@ jobs: # want to push RELEASE assets to the external pypi.org # publish the wheel file - name: push wheel to pypi.org - if: ${{ inputs.wf_category == 'RELEASE' }} + if: ${{ inputs.wf_category == "RELEASE" }} uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 with: username: ${{ secrets.PYPI_PUBLIC_USER }} @@ -97,7 +97,7 @@ jobs: # publish the tar.gz file - name: push tar.gz to pypi.org - if: ${{ inputs.wf_category == 'RELEASE' }} + if: ${{ inputs.wf_category == "RELEASE" }} uses: neuralmagic/nm-actions/actions/publish_whl/action.yml@v1.0.0 with: username: ${{ secrets.PYPI_PUBLIC_USER }} From f13ee3438ea212df2869f4cbcafd747fdb127b4f Mon Sep 17 00:00:00 2001 From: derekk-nm Date: Wed, 10 Jul 2024 11:55:45 +0000 Subject: [PATCH 6/6] PR input remove an extra "whl" arg. rename workflow --- .github/workflows/nm-build-test.yml | 2 +- .../{nm-upload-assets-to-gcp.yml => nm-upload-assets.yml} | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) rename .github/workflows/{nm-upload-assets-to-gcp.yml => nm-upload-assets.yml} (97%) diff --git a/.github/workflows/nm-build-test.yml b/.github/workflows/nm-build-test.yml index 2e2b404c81fef..1b812368c650c 100644 --- a/.github/workflows/nm-build-test.yml +++ b/.github/workflows/nm-build-test.yml @@ -167,7 +167,7 @@ jobs: UPLOAD: needs: [TEST, BENCHMARK, LM-EVAL] if: ${{ inputs.push_to_pypi }} - uses: ./.github/workflows/nm-upload-assets-to-gcp.yml + uses: ./.github/workflows/nm-upload-assets.yml with: label: gcp-k8s-util timeout: ${{ inputs.build_timeout }} diff --git a/.github/workflows/nm-upload-assets-to-gcp.yml b/.github/workflows/nm-upload-assets.yml similarity index 97% rename from .github/workflows/nm-upload-assets-to-gcp.yml rename to .github/workflows/nm-upload-assets.yml index 0e6cb3c14e245..2b75316a38575 100644 --- a/.github/workflows/nm-upload-assets-to-gcp.yml +++ b/.github/workflows/nm-upload-assets.yml @@ -39,10 +39,6 @@ on: description: "workflow category: REMOTE, NIGHTLY, RELEASE" type: string default: "REMOTE" - whl: - description: "wheel file path" - type: string - required: true jobs: