merge EfficientNet to C with clang job (#4426)

* merge ImageNet to C with linters

* add to clang

* delete from linter
This commit is contained in:
qazal
2024-05-06 01:33:12 +08:00
committed by GitHub
parent 3b30756cbb
commit 760776c59d

View File

@@ -115,39 +115,6 @@ jobs:
- name: Repo line count <8000 lines
run: MAX_LINE_COUNT=8000 python sz.py
testcpuimagenet:
name: ImageNet to C Tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Cache python packages
uses: actions/cache@v4
with:
path: ${{ env.Python3_ROOT_DIR }}/lib/python3.8/site-packages
key: testing-packages-${{ hashFiles('**/setup.py') }}
- name: Cache downloads
uses: actions/cache@v4
with:
path: ~/.cache/tinygrad/downloads/
key: downloads-cache-cpu-${{ env.DOWNLOAD_CACHE_VERSION }}
- name: Install Dependencies
run: pip install -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
#- name: Run Pytest
# run: python -m pytest -n=auto test/ -k "not (test_efficientnet and models/test_train.py)" --durations=20
- name: Compile EfficientNet to C
run: PYTHONPATH="." CLANG=1 python examples/compile_efficientnet.py > recognize.c
- name: Compile C to native
run: clang -O2 recognize.c -lm -o recognize
- name: Test EfficientNet
run: cat test/models/efficientnet/Chicken.jpg | ./recognize | grep cock
testopencl:
strategy:
fail-fast: false
@@ -487,6 +454,12 @@ jobs:
- name: Run pytest (hip)
if: matrix.backend=='hip'
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/external/external_test_hip_compile.py --durations=20
- name: Compile EfficientNet to C and test it
if: matrix.backend=='clang'
run: |
PYTHONPATH="." python examples/compile_efficientnet.py > recognize.c
clang -O2 recognize.c -lm -o recognize
cat test/models/efficientnet/Chicken.jpg | ./recognize | grep cock
#testunicorn:
# name: ARM64 unicorn Test