mirror of
https://github.com/brycedrennan/imaginAIry
synced 2024-10-31 03:20:40 +00:00
test: run non-gpu tests on github
This commit is contained in:
parent
df00109074
commit
d834e8b5b3
43
.github/workflows/ci.yaml
vendored
43
.github/workflows/ci.yaml
vendored
@ -8,6 +8,10 @@ on:
|
|||||||
env:
|
env:
|
||||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -48,19 +52,14 @@ jobs:
|
|||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
black --diff --fast .
|
black --diff --fast .
|
||||||
test:
|
test-gpu:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: nvidia-4090
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
python-version: ["3.10"]
|
|
||||||
os: ["nvidia-4090"]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: "3.10"
|
||||||
# cache: pip
|
# cache: pip
|
||||||
# cache-dependency-path: requirements-dev.txt
|
# cache-dependency-path: requirements-dev.txt
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@ -72,7 +71,31 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CUDA_LAUNCH_BLOCKING: 1
|
CUDA_LAUNCH_BLOCKING: 1
|
||||||
run: |
|
run: |
|
||||||
pytest --durations=10 -v
|
pytest --durations=10 -v -m "gputest"
|
||||||
|
test-non-gpu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10"]
|
||||||
|
os: ["ubuntu-latest"]
|
||||||
|
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 install -r requirements-dev.in . --upgrade
|
||||||
|
- name: Test with pytest
|
||||||
|
timeout-minutes: 30
|
||||||
|
env:
|
||||||
|
CUDA_LAUNCH_BLOCKING: 1
|
||||||
|
run: |
|
||||||
|
pytest --durations=10 -v -m "not gputest"
|
||||||
type-check:
|
type-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -31,3 +31,5 @@ tests/vastai_cli.py
|
|||||||
/img_size_memory_usage.csv
|
/img_size_memory_usage.csv
|
||||||
/tests/test_cluster_output/
|
/tests/test_cluster_output/
|
||||||
/.env
|
/.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")
|
print(f"Test {test_id} used {memory_diff} bytes of GPU memory")
|
||||||
cuda_tests_node_ids.append(test_id)
|
cuda_tests_node_ids.append(test_id)
|
||||||
|
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
|
|
||||||
@pytest.hookimpl()
|
@pytest.hookimpl()
|
||||||
@ -162,9 +162,7 @@ def pytest_collection_modifyitems(config, items):
|
|||||||
|
|
||||||
node_ids_to_mark = read_stored_cuda_test_nodes()
|
node_ids_to_mark = read_stored_cuda_test_nodes()
|
||||||
for item in items:
|
for item in items:
|
||||||
print(item.nodeid)
|
|
||||||
if item.nodeid in node_ids_to_mark:
|
if item.nodeid in node_ids_to_mark:
|
||||||
print(f"Marking {item.nodeid} as gputest")
|
|
||||||
item.add_marker(pytest.mark.gputest)
|
item.add_marker(pytest.mark.gputest)
|
||||||
|
|
||||||
filtered_node_ids = set()
|
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_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
|
||||||
|
|
@ -78,6 +78,9 @@ def test_feather_tile_simple(img_ratio, tile_size, overlap_pct):
|
|||||||
assert diff < 1
|
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():
|
def test_feather_tile_brute():
|
||||||
source_img = pillow_img_to_torch_image(
|
source_img = pillow_img_to_torch_image(
|
||||||
LazyLoadingImage(filepath=f"{TESTS_FOLDER}/data/bowl_of_fruit.jpg")
|
LazyLoadingImage(filepath=f"{TESTS_FOLDER}/data/bowl_of_fruit.jpg")
|
||||||
|
Loading…
Reference in New Issue
Block a user