forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 3.38 KB
/
upload-torch-dynamo-perf-stats.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Upload torch dynamo performance stats
on:
workflow_run:
workflows: [inductor-A100-perf-nightly, inductor-perf-nightly-A10g, inductor-perf-nightly-aarch64, inductor-perf-nightly-x86]
types:
- completed
jobs:
get-conclusion:
runs-on: ubuntu-latest
outputs:
conclusion: ${{ fromJson(steps.get-conclusion.outputs.data).conclusion }}
steps:
- name: Get workflow run conclusion
uses: octokit/[email protected]
id: get-conclusion
with:
route: GET /repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/attempts/${{ github.event.workflow_run.run_attempt }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-perf-stats:
needs: get-conclusion
if: github.event.workflow_run.conclusion == 'success' || needs.get-conclusion.outputs.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure' || needs.get-conclusion.outputs.conclusion == 'failure'
runs-on: ubuntu-22.04
environment: upload-stats
permissions:
id-token: write
name: Upload dynamo performance stats for ${{ github.event.workflow_run.id }}, attempt ${{ github.event.workflow_run.run_attempt }}
steps:
- name: Checkout PyTorch
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
with:
submodules: false
fetch-depth: 1
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
continue-on-error: true
with:
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_upload-torch-test-stats
aws-region: us-east-1
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
- run: |
pip3 install requests==2.32.2 rockset==1.0.3 boto3==1.19.12
- name: Upload torch dynamo performance stats to S3
id: upload-s3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_ARTIFACTS_URL: ${{ github.event.workflow_run.artifacts_url }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
REPO_FULLNAME: ${{ github.event.workflow_run.repository.full_name }}
run: |
# Upload perf test reports from GHA to S3, which can now be downloaded
# on HUD
python3 -m tools.stats.upload_artifacts --workflow-run-id "${WORKFLOW_RUN_ID}" --workflow-run-attempt "${WORKFLOW_RUN_ATTEMPT}" --repo "${REPO_FULLNAME}"
- name: Upload torch dynamo performance stats to Rockset
if: steps.upload-s3.outcome && steps.upload-s3.outcome == 'success'
env:
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
WORKFLOW_RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
REPO_FULLNAME: ${{ github.event.workflow_run.repository.full_name }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
python3 -m tools.stats.upload_dynamo_perf_stats --workflow-run-id "${WORKFLOW_RUN_ID}" --workflow-run-attempt "${WORKFLOW_RUN_ATTEMPT}" --repo "${REPO_FULLNAME}" --head-branch "${HEAD_BRANCH}" --rockset-collection torch_dynamo_perf_stats --rockset-workspace inductor --dynamodb-table torchci-dynamo-perf-stats --match-filename "^inductor_"