34 lines
1.4 KiB
YAML
34 lines
1.4 KiB
YAML
name: GPU smoke
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
extractor:
|
|
runs-on: gpu
|
|
timeout-minutes: 60
|
|
env:
|
|
HF_ENDPOINT: https://hf-mirror.com
|
|
steps:
|
|
- name: Checkout from Gitea
|
|
run: |
|
|
git init .
|
|
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
|
|
git fetch --depth 1 origin "$GITHUB_SHA"
|
|
git checkout --detach FETCH_HEAD
|
|
- name: Verify CUDA
|
|
run: nvidia-smi
|
|
- name: Reuse runner PyTorch and install lightweight dependencies
|
|
run: |
|
|
python -m venv --system-site-packages .venv-gpu
|
|
.venv-gpu/bin/python -m pip install numpy pillow pyyaml "transformers>=4.48,<5" pytest ruff
|
|
- name: Verify PyTorch sees the GPU
|
|
run: |
|
|
.venv-gpu/bin/python -c "import torch; assert torch.cuda.is_available(); print(torch.__version__, torch.version.cuda, torch.cuda.get_device_name(), torch.cuda.get_device_capability())"
|
|
- name: Build smoke dataset
|
|
run: .venv-gpu/bin/python -m data.build_splits --config configs/mvp.yaml --small
|
|
- name: Train extractor
|
|
run: |
|
|
.venv-gpu/bin/python train_extractor.py --config configs/mvp.yaml --backbone clip --epochs 1
|
|
.venv-gpu/bin/python -m eval.benchmark_extractor --config configs/mvp.yaml --checkpoint artifacts/clip/best.pt --backbone clip --output artifacts/clip/benchmark.json
|