test: run non-gpu tests on github

pull/425/head
Bryce 4 months ago committed by Bryce Drennan
parent df00109074
commit d834e8b5b3

@ -8,6 +8,10 @@ on:
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
@ -48,31 +52,50 @@ jobs:
- name: Lint
run: |
black --diff --fast .
test:
runs-on: ${{ matrix.os }}
test-gpu:
runs-on: nvidia-4090
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
# cache: pip
# cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
python -m pip uninstall torch torchvision xformers triton imaginairy -y
python -m pip install -r requirements-dev.in . --upgrade
- name: Test with pytest
timeout-minutes: 30
env:
CUDA_LAUNCH_BLOCKING: 1
run: |
pytest --durations=10 -v -m "gputest"
test-non-gpu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
os: ["nvidia-4090"]
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# cache: pip
# cache-dependency-path: requirements-dev.txt
python-version: "3.10"
cache: pip
cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
python -m pip uninstall torch torchvision xformers triton imaginairy -y
python -m pip install -r requirements-dev.in . --upgrade
- name: Test with pytest
timeout-minutes: 30
env:
CUDA_LAUNCH_BLOCKING: 1
run: |
pytest --durations=10 -v
pytest --durations=10 -v -m "not gputest"
type-check:
runs-on: ubuntu-latest
steps:

2
.gitignore vendored

@ -31,3 +31,5 @@ tests/vastai_cli.py
/img_size_memory_usage.csv
/tests/test_cluster_output/
/.env
*.ipynb
.ipynb_checkpoints

@ -152,8 +152,8 @@ def detect_cuda_tests(request):
print(f"Test {test_id} used {memory_diff} bytes of GPU memory")
cuda_tests_node_ids.append(test_id)
torch.cuda.empty_cache()
gc.collect()
torch.cuda.empty_cache()
gc.collect()
@pytest.hookimpl()
@ -162,9 +162,7 @@ def pytest_collection_modifyitems(config, items):
node_ids_to_mark = read_stored_cuda_test_nodes()
for item in items:
print(item.nodeid)
if item.nodeid in node_ids_to_mark:
print(f"Marking {item.nodeid} as gputest")
item.add_marker(pytest.mark.gputest)
filtered_node_ids = set()

@ -1 +1,55 @@
tests/img_processors/test_control_modes.py::test_control_images[depth-create_depth_map]
tests/img_processors/test_control_modes.py::test_control_images[hed-create_hed_edges]
tests/img_processors/test_control_modes.py::test_control_images[normal-create_normal_map]
tests/img_processors/test_control_modes.py::test_control_images[openpose-create_pose_map]
tests/img_processors/test_control_modes.py::test_control_images[qrcode-adaptive_threshold_binarize]
tests/modules/diffusion/test_model.py::test_nonlinearity
tests/test_api.py::test_cliptext_inpainting_pearl_doctor
tests/test_api.py::test_controlnet[canny]
tests/test_api.py::test_controlnet[colorize]
tests/test_api.py::test_controlnet[depth]
tests/test_api.py::test_controlnet[details]
tests/test_api.py::test_controlnet[edit]
tests/test_api.py::test_controlnet[hed]
tests/test_api.py::test_controlnet[inpaint]
tests/test_api.py::test_controlnet[normal]
tests/test_api.py::test_controlnet[openpose]
tests/test_api.py::test_controlnet[qrcode]
tests/test_api.py::test_controlnet[shuffle]
tests/test_api.py::test_imagine[ddim]
tests/test_api.py::test_imagine[dpmpp]
tests/test_api.py::test_img2img_beach_to_sunset[ddim]
tests/test_api.py::test_img2img_beach_to_sunset[dpmpp]
tests/test_api.py::test_img2img_low_noise[ddim]
tests/test_api.py::test_img2img_low_noise[dpmpp]
tests/test_api.py::test_img_to_file
tests/test_api.py::test_img_to_img_from_url_cats[ddim]
tests/test_api.py::test_img_to_img_from_url_cats[dpmpp]
tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0.05]
tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0.2]
tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0]
tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-1]
tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0.05]
tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0.2]
tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0]
tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-1]
tests/test_api.py::test_img_to_img_fruit_2_gold_repeat
tests/test_api.py::test_inpainting_bench
tests/test_api.py::test_large_image
tests/test_api.py::test_model_versions[SD-1.5]
tests/test_api.py::test_tile_mode
tests/test_cli/test_cmds.py::test_colorize_cmd
tests/test_cli/test_cmds.py::test_describe_cmd
tests/test_cli/test_cmds.py::test_edit_cmd
tests/test_cli/test_cmds.py::test_edit_demo
tests/test_cli/test_cmds.py::test_imagine_cmd
tests/test_clip_embedder.py::test_text_conditioning
tests/test_enhancers.py::test_clip_masking
tests/test_enhancers.py::test_clip_text_comparison
tests/test_enhancers.py::test_describe_picture
tests/test_enhancers.py::test_fix_faces
tests/test_outpaint.py::test_outpainting_outpaint
tests/test_safety.py::test_is_nsfw
tests/test_utils/test_model_cache.py::test_cache_ordering
tests/test_utils/test_model_cache.py::test_get_existing_move_to_gpu
tests/test_utils/test_model_cache.py::test_set_cpu_full

1 tests/test_outpaint.py::test_outpainting_outpaint tests/img_processors/test_control_modes.py::test_control_images[depth-create_depth_map]
1 tests/img_processors/test_control_modes.py::test_control_images[depth-create_depth_map]
2 tests/img_processors/test_control_modes.py::test_control_images[hed-create_hed_edges]
3 tests/img_processors/test_control_modes.py::test_control_images[normal-create_normal_map]
4 tests/img_processors/test_control_modes.py::test_control_images[openpose-create_pose_map]
5 tests/img_processors/test_control_modes.py::test_control_images[qrcode-adaptive_threshold_binarize]
6 tests/modules/diffusion/test_model.py::test_nonlinearity
7 tests/test_api.py::test_cliptext_inpainting_pearl_doctor
8 tests/test_api.py::test_controlnet[canny]
9 tests/test_api.py::test_controlnet[colorize]
10 tests/test_api.py::test_controlnet[depth]
11 tests/test_api.py::test_controlnet[details]
12 tests/test_api.py::test_controlnet[edit]
13 tests/test_api.py::test_controlnet[hed]
14 tests/test_api.py::test_controlnet[inpaint]
15 tests/test_api.py::test_controlnet[normal]
16 tests/test_api.py::test_controlnet[openpose]
17 tests/test_api.py::test_controlnet[qrcode]
18 tests/test_api.py::test_controlnet[shuffle]
19 tests/test_api.py::test_imagine[ddim]
20 tests/test_api.py::test_imagine[dpmpp]
21 tests/test_api.py::test_img2img_beach_to_sunset[ddim]
22 tests/test_api.py::test_img2img_beach_to_sunset[dpmpp]
23 tests/test_api.py::test_img2img_low_noise[ddim]
24 tests/test_api.py::test_img2img_low_noise[dpmpp]
25 tests/test_api.py::test_img_to_file
26 tests/test_api.py::test_img_to_img_from_url_cats[ddim]
27 tests/test_api.py::test_img_to_img_from_url_cats[dpmpp]
28 tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0.05]
29 tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0.2]
30 tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-0]
31 tests/test_api.py::test_img_to_img_fruit_2_gold[ddim-1]
32 tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0.05]
33 tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0.2]
34 tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-0]
35 tests/test_api.py::test_img_to_img_fruit_2_gold[dpmpp-1]
36 tests/test_api.py::test_img_to_img_fruit_2_gold_repeat
37 tests/test_api.py::test_inpainting_bench
38 tests/test_api.py::test_large_image
39 tests/test_api.py::test_model_versions[SD-1.5]
40 tests/test_api.py::test_tile_mode
41 tests/test_cli/test_cmds.py::test_colorize_cmd
42 tests/test_cli/test_cmds.py::test_describe_cmd
43 tests/test_cli/test_cmds.py::test_edit_cmd
44 tests/test_cli/test_cmds.py::test_edit_demo
45 tests/test_cli/test_cmds.py::test_imagine_cmd
46 tests/test_clip_embedder.py::test_text_conditioning
47 tests/test_enhancers.py::test_clip_masking
48 tests/test_enhancers.py::test_clip_text_comparison
49 tests/test_enhancers.py::test_describe_picture
50 tests/test_enhancers.py::test_fix_faces
51 tests/test_outpaint.py::test_outpainting_outpaint tests/test_outpaint.py::test_outpainting_outpaint
52 tests/test_safety.py::test_is_nsfw
53 tests/test_utils/test_model_cache.py::test_cache_ordering
54 tests/test_utils/test_model_cache.py::test_get_existing_move_to_gpu
55 tests/test_utils/test_model_cache.py::test_set_cpu_full

@ -78,6 +78,9 @@ def test_feather_tile_simple(img_ratio, tile_size, overlap_pct):
assert diff < 1
@pytest.mark.skip(
reason="takes too long. runs 5000 scenarios. if you mess with feather_tile, run this test"
)
def test_feather_tile_brute():
source_img = pillow_img_to_torch_image(
LazyLoadingImage(filepath=f"{TESTS_FOLDER}/data/bowl_of_fruit.jpg")

Loading…
Cancel
Save