From 666eb492bfe71695e064ddf3939e67f13a056d82 Mon Sep 17 00:00:00 2001 From: Xu Zhao Date: Fri, 24 Jan 2025 12:51:23 -0800 Subject: [PATCH] Run the workflow from non-pull-request (#137) Summary: https://github.com/pytorch-labs/tritonbench/actions/runs/12915411711 works but it fails to upload the artifacts to GH Artifact. We need to fix the artifact path when the workflow is not running in a PR. Pull Request resolved: https://github.com/pytorch-labs/tritonbench/pull/137 Test Plan: https://github.com/pytorch-labs/tritonbench/actions/runs/12919821483 Reviewed By: adamomainz Differential Revision: D68531665 Pulled By: xuzhao9 fbshipit-source-id: 07dea00c70103a7b42b3ab1c246acd5a2f3a8c72 --- .ci/tritonbench/run-benchmark.sh | 3 +++ .github/workflows/_linux-benchmark-h100.yml | 15 ++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.ci/tritonbench/run-benchmark.sh b/.ci/tritonbench/run-benchmark.sh index 8987055..c23d61f 100644 --- a/.ci/tritonbench/run-benchmark.sh +++ b/.ci/tritonbench/run-benchmark.sh @@ -15,4 +15,7 @@ fi BENCHMARK_NAME=$1 +tritonbench_dir=$(dirname "$(readlink -f "$0")")/../.. +cd "${tritonbench_dir}" + python "benchmarks/${BENCHMARK_NAME}/run.py" --ci diff --git a/.github/workflows/_linux-benchmark-h100.yml b/.github/workflows/_linux-benchmark-h100.yml index be8e9ad..ccfc4d6 100644 --- a/.github/workflows/_linux-benchmark-h100.yml +++ b/.github/workflows/_linux-benchmark-h100.yml @@ -30,8 +30,7 @@ jobs: JOB_NAME: tritonbench-h100-${{ inputs.conda_env }}-${{ inputs.benchmark_name }} TRITONBENCH_SCRIBE_GRAPHQL_ACCESS_TOKEN: ${{ secrets.TRITONBENCH_SCRIBE_GRAPHQL_ACCESS_TOKEN }} steps: - - name: Checkout Tritonbench (if on pull_request) - if: github.event_name == 'pull_request' + - name: Checkout Tritonbench uses: actions/checkout@v3 with: submodules: recursive @@ -42,11 +41,8 @@ jobs: nvidia-smi - name: Benchmarking run: | - if [ "${GITHUB_EVENT_NAME}" != "pull_request" ]; then - cd /workspace/tritonbench - fi - bash ./.ci/tritonbench/run-benchmark.sh ${{ inputs.benchmark_name }} - cp -r ./.benchmarks/${{ inputs.benchmark_name }} benchmark-output + bash .ci/tritonbench/run-benchmark.sh ${{ inputs.benchmark_name }} + cp -r .benchmarks/${{ inputs.benchmark_name }} benchmark-output - name: Upload result to GH Actions Artifact uses: actions/upload-artifact@v4 with: @@ -54,9 +50,6 @@ jobs: path: benchmark-output/ - name: Upload result to Scribe run: | - if [ "${GITHUB_EVENT_NAME}" != "pull_request" ]; then - cd /workspace/tritonbench - fi . "${SETUP_SCRIPT}" latest_result_json=$(find ./benchmark-output/ -name "result.json" | sort -r | head -n 1) - python ./.ci/upload/scribe.py --json ${latest_result_json} + python .ci/upload/scribe.py --json ${latest_result_json}