Skip to content

Commit

Permalink
don't re-clone
Browse files Browse the repository at this point in the history
  • Loading branch information
pyYTn9 authored and pyYTn9 committed Jan 3, 2025
1 parent a68de1d commit 07a1af8
Showing 1 changed file with 84 additions and 19 deletions.
103 changes: 84 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ jobs:
- name: Set LLVM Environment
run: |
# Set LLVM paths
LLVM_PREFIX=$(brew --prefix llvm)
{
echo "LLVM_PATH=$LLVM_PREFIX"
echo "LLVM_DIR=$LLVM_PREFIX/lib/cmake/llvm"
echo "CC=$LLVM_PREFIX/bin/clang"
echo "CXX=$LLVM_PREFIX/bin/clang++"
# Set project paths
ROOT_DIR=$PWD
echo "ROOT_DIR=$ROOT_DIR"
echo "INSTALL_DIR=$ROOT_DIR/usr/local"
echo "HIP_PATH=$ROOT_DIR/usr/local/hip"
echo "PATH=$ROOT_DIR/usr/local/hip/bin:$PATH"
} >> $GITHUB_ENV
# Set LLVM_PATH to the Homebrew LLVM installation
echo "LLVM_PATH=$(brew --prefix llvm)" >> $GITHUB_ENV
echo "LLVM_DIR=$(brew --prefix llvm)/lib/cmake/llvm" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
export ROOT_DIR=`pwd`
echo "ROOT_DIR=$ROOT_DIR" >> $GITHUB_ENV
# Set HIP environment variables
echo "HIP_PATH=$ROOT_DIR/usr/local/hip" >> $GITHUB_ENV
echo "PATH=$ROOT_DIR/usr/local/hip/bin:$PATH" >> $GITHUB_ENV
echo "INSTALL_DIR=$ROOT_DIR/usr/local" >> $GITHUB_ENV # install dir without need for sudo
- name: Cache LLVM Build
uses: actions/cache@v4
Expand All @@ -55,10 +52,14 @@ jobs:

- name: Get LLVM commit hash
run: |
# Build LLVM project with sparse checkout
git clone --depth 1 --filter=blob:none --sparse -b amd-staging https://github.com/ROCm/llvm-project.git
cd llvm-project
git sparse-checkout set llvm clang lld cmake third-party/benchmark third-party/unittest
if [ ! -d "llvm-project" ]; then
# Build LLVM project with sparse checkout
git clone --depth 1 --filter=blob:none --sparse -b amd-staging https://github.com/ROCm/llvm-project.git
cd llvm-project
git sparse-checkout set llvm clang lld cmake third-party/benchmark third-party/unittest
else
cd llvm-project
fi
git checkout ${{ env.LLVM_COMMIT }} # Checkout specific commit
echo "LLVM_COMMIT_HASH=${{ env.LLVM_COMMIT }}" >> $GITHUB_ENV
cd ..
Expand Down Expand Up @@ -773,3 +774,67 @@ jobs:
# run: CI=1 ARM64=1 CLANG=1 python -m pytest -n=auto test/ -k 'not (test_nn.py and (test_conv_transpose2d or test_conv2d))' --ignore=test/models --ignore=test/test_speed_v_torch.py --ignore=test/test_net_speed.py --ignore=test/test_specific_conv.py --ignore=test/unit/test_disk_tensor.py


# osxtests:
# strategy:
# fail-fast: false
# matrix:
# backend: [ptx]

# name: OSX tiny tests on (${{ matrix.backend }})
# runs-on: macos-15
# timeout-minutes: 20

# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
# with:
# fetch-depth: 2 # NOTE: this fetches the HEAD commit of the PR
# - name: Set up Python 3.11
# uses: actions/setup-python@v5
# with:
# python-version: 3.11
# - name: Cache python packages
# uses: actions/cache@v4
# with:
# path: /Users/runner/Library/Python/3.11/lib/python/site-packages
# key: m1-${{ matrix.backend }}-packages-${{ hashFiles('**/setup.py') }}
# - name: Set env
# run: printf "${{ matrix.backend == 'ptx' && 'PTX=1\n\nMOCKGPU=1\nNV=1\nFORWARD_ONLY=1' }}" >> $GITHUB_ENV
# - name: Install packages
# if: matrix.backend == 'ptx' || matrix.backend == 'triton' || matrix.backend == 'nv'
# run: |
# brew update
# brew install cmake ninja llvm@15 zlib glew flex bison boost zstd ncurses
# - name: Cache gpuocelot
# if: matrix.backend == 'ptx'
# id: cache-build
# uses: actions/cache@v4
# env:
# cache-name: cache-gpuocelot-osx-build
# with:
# path: ${{ github.workspace }}/gpuocelot/ocelot
# key: macos-15-gpuocelot-4524e34adb7eaccc6f71262f2e21d7052bb17c2f-rebuild-9
# - name: Clone/compile gpuocelot
# if: matrix.backend == 'ptx' && steps.cache-build.outputs.cache-hit != 'true'
# run: |
# git clone --recurse-submodules https://github.com/gpuocelot/gpuocelot.git ${{ github.workspace }}/gpuocelot
# cd ${{ github.workspace }}/gpuocelot
# git checkout 4524e34adb7eaccc6f71262f2e21d7052bb17c2f
# git apply ${{ github.workspace }}/extra/mockgpu/nv/osx_gpuocelot_patches/*.patch
# cd ocelot
# mkdir build
# cd build
# cmake .. -Wno-dev -G Ninja -DBUILD_TOOLS=OFF -DCMAKE_BUILD_ALWAYS=0 -DBUILD_TESTS_CUDA=OFF
# ninja
# - name: Install gpuocelot
# if: matrix.backend == 'ptx' || matrix.backend == 'triton' || matrix.backend == 'nv'
# run: |
# cd ${{ github.workspace }}/gpuocelot/ocelot/build
# sudo ninja install -d explain
# - name: Install dependencies
# run: pip install --user -e '.[testing]' --extra-index-url https://download.pytorch.org/whl/cpu
# - name: Run tiny test (ptx)
# if: matrix.backend=='ptx'
# run: python3 test/test_tiny.py


0 comments on commit 07a1af8

Please sign in to comment.