|
| 1 | +# CUDA testing |
| 2 | + |
| 3 | +The script, `test-pr.py`, is a quick and easy way to run CUDA tests on a PR. |
| 4 | + |
| 5 | +This should be done after code review, see [issue #457](https://github.com/tensor-compiler/taco/issues/457) for a discussion of the overall process. |
| 6 | + |
| 7 | +## System requirements |
| 8 | + |
| 9 | +You will need write access to the `tensor-compiler/taco` github repo, and access to run actions. |
| 10 | + |
| 11 | +You will need to have the command line `git` and `gh` tools installed, configured, and talking to github. |
| 12 | + |
| 13 | +`git` needs to be set up with SSH authentication or HTTPS authentication to push to the `tensor-compiler/taco` github repo without a password prompt. If you don't have that, please see [ssh setup in the github docs](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) or [seting up an HTTPS token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token). |
| 14 | + |
| 15 | +`gh` is a command-line interface to the github REST API. If you don't have `gh`, please see [their installation guide](https://github.com/cli/cli#installation). |
| 16 | + |
| 17 | +`gh` needs to be set up to hit REST API endpoints without a password prompt. If you don't have that, the [gh auth login](https://cli.github.com/manual/gh_auth_login) command should help. |
| 18 | + |
| 19 | +The script requires python version 3.x, and a few basic python modules that should be installed by default (like subprocess and tempfile). |
| 20 | + |
| 21 | +## What it does |
| 22 | + |
| 23 | +This script does the following: |
| 24 | + |
| 25 | +* creates a temporary test branch for a PR |
| 26 | +* pushes that test branch to the taco github repo |
| 27 | +* kicks off the cuda test (with the default parameters) to run on that test branch |
| 28 | +* waits for the test to complete |
| 29 | +* removes the temporary test branch |
| 30 | + |
| 31 | +The script will give you a link to the test run on the github website, so you can watch and inspect the results. |
| 32 | + |
| 33 | +## Using it |
| 34 | + |
| 35 | +`python3 test-pr.md [--protocol=(ssh|https)] <PRNUMBER> [<TRYNUMBER>]` |
| 36 | + |
| 37 | +`PRNUMBER` is the PR you want to test, without the `#` prefix. |
| 38 | + |
| 39 | +If specified, `TRYNUMBER` becomes a suffix for the temporary test branch, so you can have multiple test branches going at once. That can be omitted unless it is needed. |
| 40 | + |
| 41 | +## what it looks like |
| 42 | + |
| 43 | +This output comes from my own fork of taco as I was testing the script: |
| 44 | + |
| 45 | +``` |
| 46 | +% python3 test-pr.py 3 |
| 47 | +
|
| 48 | +=== looking up ID and params of test action |
| 49 | +
|
| 50 | +=== creating test branch test-pr3 |
| 51 | +remote: |
| 52 | +remote: Create a pull request for 'test-pr3' on GitHub by visiting: |
| 53 | +remote: https://github.com/Infinoid/taco/pull/new/test-pr3 |
| 54 | +remote: |
| 55 | +
|
| 56 | +=== triggering test action |
| 57 | +✓ Created workflow_dispatch event for cuda-test-manual.yml at test-pr3 |
| 58 | +
|
| 59 | +To see runs for this workflow, try: gh run list --workflow=cuda-test-manual.yml |
| 60 | +Test action is at: https://github.com/Infinoid/taco/actions/runs/882846018?check_suite_focus=true |
| 61 | +
|
| 62 | +=== waiting for action to complete |
| 63 | +
|
| 64 | +Refreshing run status every 3 seconds. Press Ctrl+C to quit. |
| 65 | +
|
| 66 | +X test-pr3 CUDA build and test (manual) · 882846018 |
| 67 | +Triggered via workflow_dispatch about 11 minutes ago |
| 68 | +
|
| 69 | +JOBS |
| 70 | +X tests CUDA in 10m54s (ID 2686889157) |
| 71 | + ✓ Set up job |
| 72 | + ✓ Run actions/checkout@v2 |
| 73 | + ✓ create_build |
| 74 | + ✓ cmake |
| 75 | + ✓ make |
| 76 | + X test |
| 77 | + ✓ Post Run actions/checkout@v2 |
| 78 | + ✓ Complete job |
| 79 | +
|
| 80 | +ANNOTATIONS |
| 81 | +X Process completed with exit code 2. |
| 82 | +tests CUDA: .github#1 |
| 83 | +
|
| 84 | +
|
| 85 | +X Run CUDA build and test (manual) (882846018) completed with 'failure' |
| 86 | +Test results are at: https://github.com/Infinoid/taco/actions/runs/882846018?check_suite_focus=true |
| 87 | +
|
| 88 | +=== cleaning up test branch test-pr3 |
| 89 | +
|
| 90 | +=== cleaning up temp dir |
| 91 | +
|
| 92 | +``` |
| 93 | + |
| 94 | +# Troubleshooting |
| 95 | + |
| 96 | +## no access to taco repo, no access to run actions in taco repo |
| 97 | + |
| 98 | +If you are a taco developer, ask Fred for access. |
| 99 | + |
| 100 | +## test workflow does not exist |
| 101 | + |
| 102 | +If you see output that looks like this: |
| 103 | + |
| 104 | +``` |
| 105 | +=== triggering test action |
| 106 | +could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger (https://api.github.com/repos/tensor-compiler/taco/actions/workflows/someIDnumber/dispatches) |
| 107 | +``` |
| 108 | + |
| 109 | +This means the test branch does not have the cuda test workflow file. In other words, the file `.github/workflows/cuda-test-manual.yml` does not exist yet in the version of taco that the PR is based on. |
| 110 | + |
| 111 | +To fix this, rebase or merge the PR to the current taco master branch, and then rerun the test. |
| 112 | + |
| 113 | +## other stuff |
| 114 | + |
| 115 | +If you have some other problem with it, at me on github (@infinoid) or email me for help figuring it out. |
0 commit comments