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