-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow for GPU Runner #694
Merged
Harsha-Nori
merged 8 commits into
guidance-ai:main
from
riedgar-ms:riedgar-ms/gpu-runner-01
Mar 20, 2024
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cdf51f1
Start drafting GPU workflow
riedgar-ms 1154080
Run a little more
riedgar-ms 0aeba38
Fix bad merge to main
riedgar-ms 39c2254
Try running the tests
riedgar-ms 39e5fd5
Extra pip package
riedgar-ms c6bb031
Merge branch 'riedgar-ms/test-gen-fix-01' into riedgar-ms/gpu-runner-01
riedgar-ms c6ce4bd
Merge remote-tracking branch 'upstream/main' into riedgar-ms/gpu-runn…
riedgar-ms 5fbdf53
Merge branch 'main' into riedgar-ms/gpu-runner-01
riedgar-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Unit tests GPU | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
unit-tests: | ||
|
||
strategy: | ||
matrix: | ||
os: [gpu-runner] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
model: ["gpt2gpu", "phi2gpu"] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Show GPUs | ||
run: | | ||
nvidia-smi | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -e .[test] | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install accelerate | ||
run: | | ||
pip install accelerate | ||
- name: Check GPU available | ||
run: | | ||
python -c "import torch; assert torch.cuda.is_available()" | ||
- name: Run tests (except server) | ||
run: | | ||
pytest --cov=guidance --cov-report=xml --cov-report=term-missing --selected_model ${{ matrix.model }} -m "not server" ./tests/ | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not want the PR trigger here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riedgar-ms Does branches: [main] mean it'll only run when merged to main? brainstorming out loud, is there a way to manually trigger on PR instead of automatically? Another option is to have it run on a "staging" branch or something of the sort which we can merge to before merging with main. That way we can have a maintainer vet that the code isn't malicious, but still verify that it passes GPU tests before we put on main. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
push ...main
is (AIUI) the trigger which will run on the actual merge. Theworkflow_dispatch
trigger is supposed to add a 'Run Workflow' button on the Actions page. Having said that, for the plain 'Unit Test' build, the list of available branches I'm seeing are only those for this repo, not forks.We could have an extra 'staging' branch, but that would be an extra thing to manage. And if the workflow were being automatically run there, there would still be the potential problem of people sneaking in Bitcoin miners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever there's a new contributor, I believe that the builds won't be run until someone listed on the guidance repo clicks on a button, so there is that, @Harsha-Nori