diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff45087f2677c..8b717552eb024 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ on: jobs: linter: name: Linters - runs-on: ubuntu-latest + runs-on: rocm #runs on rocm server timeout-minutes: 20 steps: @@ -41,8 +41,8 @@ jobs: run: python -m pylint tinygrad/ - name: Run mypy run: python -m mypy - - name: Install SLOCCount - run: sudo apt install sloccount + # - name: Install SLOCCount + # run: sudo apt install sloccount - name: Check <5000 lines run: sloccount tinygrad test examples extra; if [ $(sloccount tinygrad | sed -n 's/.*Total Physical Source Lines of Code (SLOC)[ ]*= \([^ ]*\).*/\1/p' | tr -d ',') -gt 5000 ]; then exit 1; fi - name: Test Docs @@ -64,7 +64,7 @@ jobs: testcpuimagenet: name: CPU and ImageNet to C Tests - runs-on: ubuntu-latest + runs-on: rocm timeout-minutes: 20 steps: @@ -92,7 +92,7 @@ jobs: testtorch: name: Torch Tests - runs-on: ubuntu-latest + runs-on: rocm timeout-minutes: 20 steps: @@ -126,11 +126,11 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 - - name: Install OpenCL - run: | - echo "deb [ allow-insecure=yes ] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt update - sudo apt install --allow-unauthenticated -y --no-install-recommends intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl + # - name: Install OpenCL + # run: | + # echo "deb [ allow-insecure=yes ] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + # sudo apt update + # sudo apt install --allow-unauthenticated -y --no-install-recommends intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl - name: Set up Python 3.11 uses: actions/setup-python@v4 with: @@ -260,41 +260,41 @@ jobs: key: ${{ matrix.backend }}-packages-${{ hashFiles('**/setup.py') }} - name: Set env run: printf "${{ matrix.backend == 'llvm' && 'LLVM=1' || matrix.backend == 'clang' && 'CLANG=1' || matrix.backend == 'gpu' && 'GPU=1' || matrix.backend == 'cuda' && 'FORWARD_ONLY=1\nJIT=1\nOPT=2\nCUDA=1\nCUDACPU=1\n' || matrix.backend == 'PTX' && 'FORWARD_ONLY=1\nJIT=1\nOPT=2\nCUDA=1\nCUDACPU=1\nPTX=1' || matrix.backend == 'triton' && 'FORWARD_ONLY=1\nJIT=1\nOPT=2\nCUDA=1\nCUDACPU=1\nTRITON=1\nTRITON_PTXAS_PATH=/usr/bin/ptxas'}}" >> $GITHUB_ENV - - name: Install OpenCL - if: matrix.backend == 'gpu' - run: | - echo "deb [ allow-insecure=yes ] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt update - sudo apt install --allow-unauthenticated -y --no-install-recommends intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl - - name: Install packages (cuda) - if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' - run: | - echo 'Acquire::http::Pipeline-Depth "5";' | sudo tee -a /etc/apt/apt.conf.d/99parallel - sudo apt update -y - sudo apt install -y --no-install-recommends git g++ cmake ninja-build llvm-15-dev zlib1g-dev libglew-dev flex bison libfl-dev libboost-thread-dev libboost-filesystem-dev nvidia-cuda-toolkit-gcc - - name: Cache gpuocelot - if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' - id: cache-build - uses: actions/cache@v3 - env: - cache-name: cache-gpuocelot-build - with: - path: ${{ github.workspace }}/gpuocelot/ocelot - key: ubuntu22.04-gpuocelot-szymonozog-tinygrad-norebuild - - name: Clone/compile gpuocelot - if: (matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton') && steps.cache-build.outputs.cache-hit != 'true' - run: | - git clone --recurse-submodules --single-branch --branch tinygrad https://github.com/SzymonOzog/gpuocelot.git ${{ github.workspace }}/gpuocelot - cd ${{ github.workspace }}/gpuocelot/ocelot - mkdir build - cd build - cmake .. -Wno-dev -G Ninja -DOCELOT_BUILD_TOOLS=OFF -DCMAKE_BUILD_ALWAYS=0 - ninja - - name: Install gpuocelot - if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' - run: | - cd ${{ github.workspace }}/gpuocelot/ocelot/build - sudo ninja install -d explain + # - name: Install OpenCL + # if: matrix.backend == 'gpu' + # run: | + # echo "deb [ allow-insecure=yes ] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + # sudo apt update + # sudo apt install --allow-unauthenticated -y --no-install-recommends intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl + # - name: Install packages (cuda) + # if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' + # run: | + # echo 'Acquire::http::Pipeline-Depth "5";' | sudo tee -a /etc/apt/apt.conf.d/99parallel + # sudo apt update -y + # sudo apt install -y --no-install-recommends git g++ cmake ninja-build llvm-15-dev zlib1g-dev libglew-dev flex bison libfl-dev libboost-thread-dev libboost-filesystem-dev nvidia-cuda-toolkit-gcc + # - name: Cache gpuocelot + # if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' + # id: cache-build + # uses: actions/cache@v3 + # env: + # cache-name: cache-gpuocelot-build + # with: + # path: ${{ github.workspace }}/gpuocelot/ocelot + # key: ubuntu22.04-gpuocelot-szymonozog-tinygrad-norebuild + # - name: Clone/compile gpuocelot + # if: (matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton') && steps.cache-build.outputs.cache-hit != 'true' + # run: | + # git clone --recurse-submodules --single-branch --branch tinygrad https://github.com/SzymonOzog/gpuocelot.git ${{ github.workspace }}/gpuocelot + # cd ${{ github.workspace }}/gpuocelot/ocelot + # mkdir build + # cd build + # cmake .. -Wno-dev -G Ninja -DOCELOT_BUILD_TOOLS=OFF -DCMAKE_BUILD_ALWAYS=0 + # ninja + # - name: Install gpuocelot + # if: matrix.backend == 'cuda' || matrix.backend == 'ptx' || matrix.backend == 'triton' + # run: | + # cd ${{ github.workspace }}/gpuocelot/ocelot/build + # sudo ninja install -d explain - name: Install dependencies run: pip install -e '.[testing${{matrix.backend=='llvm'&&',llvm'||matrix.backend=='cuda'&&',cuda'||matrix.backend=='ptx'&&',cuda'||matrix.backend=='triton'&&',triton'||''}}]' --extra-index-url https://download.pytorch.org/whl/cpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ - name: Check Device.DEFAULT and print some source @@ -313,7 +313,7 @@ jobs: #testunicorn: # name: ARM64 unicorn Test - # runs-on: ubuntu-latest + # runs-on: rocm # timeout-minutes: 20 # steps: # - name: Checkout Code