Skip to content

Commit

Permalink
Run the workflow from non-pull-request (#137)
Browse files Browse the repository at this point in the history
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: #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
  • Loading branch information
xuzhao9 authored and facebook-github-bot committed Jan 24, 2025
1 parent dd8e622 commit 666eb49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .ci/tritonbench/run-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ fi

BENCHMARK_NAME=$1

tritonbench_dir=$(dirname "$(readlink -f "$0")")/../..
cd "${tritonbench_dir}"

python "benchmarks/${BENCHMARK_NAME}/run.py" --ci
15 changes: 4 additions & 11 deletions .github/workflows/_linux-benchmark-h100.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,21 +41,15 @@ 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:
name: ${{ env.JOB_NAME }}
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}

0 comments on commit 666eb49

Please sign in to comment.