-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are actually three current build breaks: - A mysterious push to `main` broke our tests. Skip the offending items - `llama-cpp-python` has started segfaulting. Refactoring the workflow files a little appears to have solved this for reasons which are not entirely clear - The `macos-latest` Runner [has changed](https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/) and no longer has Python 3.8 and 3.9
- Loading branch information
1 parent
d2525a3
commit c23c8b0
Showing
5 changed files
with
77 additions
and
52 deletions.
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
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,66 @@ | ||
name: unit-tests-gpu-template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
python: | ||
required: true | ||
type: string | ||
model: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
unit-tests-on-gpu: | ||
runs-on: ${{ inputs.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- name: Set up Python ${{ inputs.python }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python }} | ||
- name: Show GPUs | ||
run: | | ||
nvidia-smi | ||
- name: Update Ubuntu | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y upgrade | ||
- name: Ensure NVIDIA SDK available | ||
run: | | ||
sudo apt-get -y install cuda-toolkit | ||
echo "/usr/local/cuda-12.4/bin" >> $GITHUB_PATH | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -e .[schemas,test] | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: GPU pip installs | ||
run: | | ||
pip install accelerate | ||
CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install "llama-cpp-python!=0.2.58" | ||
- name: Check GPU available | ||
run: | | ||
python -c "import torch; assert torch.cuda.is_available()" | ||
- name: Run tests (except server) for ${{ inputs.model }} | ||
run: | | ||
pytest -vv --cov=guidance --cov-report=xml --cov-report=term-missing \ | ||
--selected_model ${{ inputs.model }} \ | ||
-m "not (server or needs_credentials)" \ | ||
./tests/ | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v4 | ||
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
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