Skip to content

Commit 208097d

Browse files
authored
try reducing testing deps [pr] (tinygrad#8976)
* reduce testing deps * break out test models * add PR to models, add models to metal * okay, not that * mac cleanup * mac typo * other typo
1 parent 6ffee2f commit 208097d

File tree

1 file changed

+56
-66
lines changed

1 file changed

+56
-66
lines changed

.github/workflows/test.yml

+56-66
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,29 @@ jobs:
371371
- name: Run process replay tests
372372
uses: ./.github/actions/process-replay
373373

374+
testmodels:
375+
name: Models (llvm+clang+gpu)
376+
runs-on: ubuntu-22.04
377+
timeout-minutes: 10
378+
steps:
379+
- name: Checkout Code
380+
uses: actions/checkout@v4
381+
- name: Setup Environment
382+
uses: ./.github/actions/setup-tinygrad
383+
with:
384+
key: models
385+
deps: testing
386+
opencl: 'true'
387+
llvm: 'true'
388+
- name: Test models (llvm)
389+
run: LLVM=1 python -m pytest -n=auto test/models --durations=20
390+
- name: Test models (gpu)
391+
run: GPU=1 python -m pytest -n=auto test/models --durations=20
392+
- name: Test models (clang)
393+
run: CLANG=1 python -m pytest -n=auto test/models --durations=20
394+
- name: Run process replay tests
395+
uses: ./.github/actions/process-replay
396+
374397
testdsp:
375398
name: Linux (DSP)
376399
runs-on: ubuntu-24.04
@@ -404,8 +427,8 @@ jobs:
404427
- name: Setup Environment
405428
uses: ./.github/actions/setup-tinygrad
406429
with:
407-
key: webgpu
408-
deps: testing
430+
key: webgpu-minimal
431+
deps: testing_minimal
409432
python-version: '3.11'
410433
webgpu: 'true'
411434
- name: Check Device.DEFAULT (WEBGPU) and print some source
@@ -414,13 +437,12 @@ jobs:
414437
WEBGPU=1 DEBUG=4 FORWARD_ONLY=1 python3 test/test_ops.py TestOps.test_add
415438
- name: Run selected webgpu tests
416439
run: |
417-
WEBGPU=1 python3 -m pytest -n=auto test/ --ignore=test/external --ignore=test/models --ignore=test/unit \
440+
WEBGPU=1 python3 -m pytest -n=auto test/ --ignore=test/models --ignore=test/unit \
418441
--ignore=test/test_copy_speed.py --ignore=test/test_rearrange_einops.py --ignore=test/test_speed_v_torch.py --ignore=test/test_transcendental.py \
419442
--ignore=test/test_fuzz_shape_ops.py --ignore=test/test_linearizer_failures.py --durations=20
420443
- name: Run process replay tests
421444
uses: ./.github/actions/process-replay
422445

423-
424446
tests:
425447
strategy:
426448
fail-fast: false
@@ -437,8 +459,8 @@ jobs:
437459
- name: Setup Environment
438460
uses: ./.github/actions/setup-tinygrad
439461
with:
440-
key: ${{ matrix.backend }}
441-
deps: testing${{matrix.backend=='ptx'&&',cuda'||matrix.backend=='triton'&&',triton'||''}}
462+
key: ${{ matrix.backend }}-minimal
463+
deps: testing_minimal${{matrix.backend=='ptx'&&',cuda'||matrix.backend=='triton'&&',triton'||''}}
442464
opencl: ${{ matrix.backend == 'gpu' && 'true' }}
443465
amd: ${{ matrix.backend == 'amd' && 'true' }}
444466
cuda: ${{ (matrix.backend == 'ptx' || matrix.backend == 'triton' || matrix.backend == 'nv') && 'true' }}
@@ -450,10 +472,10 @@ jobs:
450472
DEBUG=5 PYTHONPATH=${{ github.workspace }} FORWARD_ONLY=1 python3 test/test_ops.py TestOps.test_add
451473
- name: Run pytest (not cuda or amd)
452474
if: matrix.backend!='ptx' && matrix.backend!='triton' && matrix.backend != 'amd' && matrix.backend != 'nv'
453-
run: python -m pytest -n=auto test/ --ignore=test/unit --durations=20
475+
run: python -m pytest -n=auto test/ --ignore=test/models --ignore=test/unit --durations=20
454476
- name: Run pytest (cuda)
455477
if: matrix.backend=='ptx'||matrix.backend=='triton'||matrix.backend=='nv'
456-
run: python -m pytest -n=auto test/ -k 'not (half or test_efficientnet_safetensors)' --ignore=test/external --ignore=test/models --ignore=test/unit --ignore test/test_gc.py --durations=20
478+
run: python -m pytest -n=auto test/ -k 'not (half or test_efficientnet_safetensors)' --ignore=test/models --ignore=test/unit --ignore test/test_gc.py --durations=20
457479
- name: Run pytest (amd)
458480
if: matrix.backend=='amd'
459481
run: python -m pytest -n=auto test/test_ops.py test/test_dtype.py test/test_dtype_alu.py test/test_linearizer.py test/test_randomness.py test/imported/test_indexing.py test/test_hcq.py test/external/external_test_am.py --durations=20
@@ -478,8 +500,11 @@ jobs:
478500
key: metal2
479501
deps: testing
480502
python-version: '3.11'
503+
amd: 'true'
481504
- name: Run real world test
482505
run: JIT=2 METAL=1 python -m pytest -n=auto test/models/test_real_world.py --durations=20
506+
- name: Test models (Metal)
507+
run: JIT=2 METAL=1 python -m pytest -n=auto test/models --durations=20
483508
- name: Run ONNX
484509
run: JIT=2 METAL=1 python -m pytest -n=auto test/external/external_test_onnx_backend.py --durations=20
485510
- name: Test tensor core ops (fake)
@@ -496,29 +521,13 @@ jobs:
496521
# run: FUZZ_SCHEDULE=1 FUZZ_SCHEDULE_MAX_PATHS=5 python -m pytest test/models/test_train.py test/models/test_end2end.py
497522
- name: Run TRANSCENDENTAL math
498523
run: TRANSCENDENTAL=2 python -m pytest -n=auto test/test_ops.py::TestOps::test_sin test/test_ops.py::TestOps::test_cos test/test_ops.py::TestOps::test_tan test/test_ops.py::TestOps::test_exp test/test_ops.py::TestOps::test_log --durations=20
499-
- name: Run process replay tests
500-
uses: ./.github/actions/process-replay
501-
502-
testmetal:
503-
name: MacOS (metal)
504-
runs-on: macos-14
505-
timeout-minutes: 10
506-
507-
steps:
508-
- name: Checkout Code
509-
uses: actions/checkout@v4
510-
- name: Setup Environment
511-
uses: ./.github/actions/setup-tinygrad
512-
with:
513-
key: metal
514-
deps: testing
515-
python-version: '3.11'
516-
- name: Check Device.DEFAULT (METAL) and print some source
524+
- name: Run pytest (amd)
525+
env:
526+
MOCKGPU: 1
527+
AMD: 1
528+
FORWARD_ONLY: 1
517529
run: |
518-
METAL=1 python -c "from tinygrad import Device; assert Device.DEFAULT == 'METAL', Device.DEFAULT"
519-
METAL=1 DEBUG=4 FORWARD_ONLY=1 python3 test/test_ops.py TestOps.test_add
520-
- name: Run metal test
521-
run: JIT=2 METAL=1 python -m pytest -n=auto test/ --ignore=test/external --ignore=test/models --ignore=test/unit --durations=20
530+
python3 -m pytest -n=auto test/test_hcq.py test/test_tiny.py --durations=20
522531
- name: Run process replay tests
523532
uses: ./.github/actions/process-replay
524533

@@ -543,27 +552,12 @@ jobs:
543552
- name: Run WEBGPU Efficientnet
544553
run: node test/web/test_webgpu.js
545554

546-
osxclang:
547-
name: MacOS (clang)
548-
runs-on: macos-15
549-
timeout-minutes: 10
550-
steps:
551-
- name: Checkout Code
552-
uses: actions/checkout@v4
553-
- name: Setup Environment
554-
uses: ./.github/actions/setup-tinygrad
555-
with:
556-
key: macos-clang
557-
deps: testing
558-
- name: Run pytest (clang)
559-
env:
560-
CLANG: 1
561-
run: |
562-
python3 -m pytest -n=auto test/ --ignore=test/unit --durations=20
563-
! (DEBUG=7 python3 test/test_zero_copy.py 2>&1 || true) | grep -E '^0x.*[^0](x18|w18).*$'
564-
565555
osxtests:
566-
name: MacOS (amd+llvm)
556+
strategy:
557+
fail-fast: false
558+
matrix:
559+
backend: [metal, llvm, clang]
560+
name: MacOS (${{ matrix.backend }})
567561
runs-on: macos-15
568562
timeout-minutes: 10
569563
steps:
@@ -572,23 +566,19 @@ jobs:
572566
- name: Setup Environment
573567
uses: ./.github/actions/setup-tinygrad
574568
with:
575-
key: macos-other
576-
deps: testing
577-
amd: 'true'
578-
llvm: 'true'
579-
- name: Run pytest (amd)
580-
env:
581-
MOCKGPU: 1
582-
AMD: 1
583-
FORWARD_ONLY: 1
584-
run: |
585-
python3 -m pytest -n=auto test/test_hcq.py test/test_tiny.py --durations=20
586-
- name: Run pytest (llvm)
587-
env:
588-
LLVM: 1
569+
key: macos-${{ matrix.backend }}-minimal
570+
deps: testing_minimal
571+
llvm: ${{ matrix.backend == 'llvm' && 'true' }}
572+
- name: Set env
573+
run: printf "${{ matrix.backend == 'llvm' && 'LLVM=1' || matrix.backend == 'clang' && 'CLANG=1' || matrix.backend == 'metal' && 'METAL=1\nJIT=2'}}" >> $GITHUB_ENV
574+
- name: Check Device.DEFAULT and print some source
589575
run: |
590-
python3 -m pytest -n=auto test/ --ignore=test/unit --durations=20
591-
! (DEBUG=7 python3 test/test_zero_copy.py 2>&1 || true) | grep -E '^0x.*[^0](x18|w18).*$'
576+
python -c "from tinygrad import Device; assert Device.DEFAULT == '${{ matrix.backend }}'.upper(), Device.DEFAULT"
577+
DEBUG=4 python3 test/test_tiny.py TestTiny.test_plus
578+
- name: Run pytest (${{ matrix.backend }})
579+
run: python3 -m pytest -n=auto test/ --ignore=test/models --ignore=test/unit --durations=20
580+
- name: Run process replay tests
581+
uses: ./.github/actions/process-replay
592582

593583
# ****** Windows Tests ******
594584

0 commit comments

Comments
 (0)