diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c19ed8495..1c8fd04ed 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,149 +1,149 @@ -name: Benchmark - -on: - issue_comment: - types: created - -jobs: - benchmark_base: - # On pull requests and if the comment starts with `/run-benchmark` - if: github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/run-benchmark') - runs-on: self-hosted - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: main - - - name: Get base branch commit ID - id: get_base_commit - run: echo "BASE_COMMIT_ID=$(git rev-parse HEAD)" > base_commit_id.txt - - - name: Upload base commit ID - uses: actions/upload-artifact@v3 - with: - name: base-commit-id - path: base_commit_id.txt - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - - name: Create virtual environment - run: python -m venv bitblas_benchmark - - - name: Activate virtual environment and install dependencies - run: | - source bitblas_benchmark/bin/activate - python -m pip install --upgrade pip - if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi - - - name: Install project in wheel mode - run: | - source bitblas_benchmark/bin/activate - python -m pip install . +# name: Benchmark + +# on: +# issue_comment: +# types: created + +# jobs: +# benchmark_base: +# # On pull requests and if the comment starts with `/run-benchmark` +# if: github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/run-benchmark') +# runs-on: self-hosted + +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 +# with: +# ref: main + +# - name: Get base branch commit ID +# id: get_base_commit +# run: echo "BASE_COMMIT_ID=$(git rev-parse HEAD)" > base_commit_id.txt + +# - name: Upload base commit ID +# uses: actions/upload-artifact@v3 +# with: +# name: base-commit-id +# path: base_commit_id.txt + +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.9' + +# - name: Create virtual environment +# run: python -m venv bitblas_benchmark + +# - name: Activate virtual environment and install dependencies +# run: | +# source bitblas_benchmark/bin/activate +# python -m pip install --upgrade pip +# if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi + +# - name: Install project in wheel mode +# run: | +# source bitblas_benchmark/bin/activate +# python -m pip install . - - name: Matmul Benchmark - run: | - source bitblas_benchmark/bin/activate - cd benchmark/operators - python ./benchmark_ops_matmul.py - - benchmark_head: - # On pull requests and if the comment starts with `/run-benchmark` - if: github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/run-benchmark') - runs-on: self-hosted - needs: [benchmark_base] - - steps: - - name: Checkout PR branch code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - - - name: Get PR branch commit ID - id: get_pr_commit - run: echo "PR_COMMIT_ID=$(git rev-parse HEAD)" > pr_commit_id.txt - - - name: Upload PR commit ID - uses: actions/upload-artifact@v3 - with: - name: pr-commit-id - path: pr_commit_id.txt - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - - name: Create virtual environment - run: python -m venv bitblas_benchmark - - - name: Activate virtual environment and install dependencies - run: | - source bitblas_benchmark/bin/activate - python -m pip install --upgrade pip - if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi - - - name: Install project in wheel mode - run: | - source bitblas_benchmark/bin/activate - python -m pip install . +# - name: Matmul Benchmark +# run: | +# source bitblas_benchmark/bin/activate +# cd benchmark/operators +# python ./benchmark_ops_matmul.py + +# benchmark_head: +# # On pull requests and if the comment starts with `/run-benchmark` +# if: github.event.issue.pull_request != null && startsWith(github.event.comment.body, '/run-benchmark') +# runs-on: self-hosted +# needs: [benchmark_base] + +# steps: +# - name: Checkout PR branch code +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# ref: ${{ github.event.pull_request.head.ref }} + +# - name: Get PR branch commit ID +# id: get_pr_commit +# run: echo "PR_COMMIT_ID=$(git rev-parse HEAD)" > pr_commit_id.txt + +# - name: Upload PR commit ID +# uses: actions/upload-artifact@v3 +# with: +# name: pr-commit-id +# path: pr_commit_id.txt + +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.9' + +# - name: Create virtual environment +# run: python -m venv bitblas_benchmark + +# - name: Activate virtual environment and install dependencies +# run: | +# source bitblas_benchmark/bin/activate +# python -m pip install --upgrade pip +# if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi + +# - name: Install project in wheel mode +# run: | +# source bitblas_benchmark/bin/activate +# python -m pip install . - - name: Matmul Benchmark - run: | - source bitblas_benchmark/bin/activate - cd benchmark/operators - python ./benchmark_ops_matmul.py - - benchmark_compare: - if: github.event.issue.pull_request != null && contains(github.event.comment.body, '/run-benchmark') - needs: [benchmark_base, benchmark_head] - runs-on: self-hosted - - steps: - - name: Download commit IDs - uses: actions/download-artifact@v4.1.7 - with: - name: base-commit-id - path: . - - - name: Download PR commit ID - uses: actions/download-artifact@v4.1.7 - with: - name: pr-commit-id - path: . - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - - name: Create virtual environment - run: python -m venv bitblas_benchmark - - - name: Activate virtual environment and install dependencies - run: | - source bitblas_benchmark/bin/activate - python -m pip install --upgrade pip - if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi - - - name: Compare benchmark results - run: | - source bitblas_benchmark/bin/activate - cd benchmark/operators - python ./compare_benchmark.py --base $(cat base_commit_id.txt) --head $(cat pr_commit_id.txt) 2>&1 | tee compare_results.txt - - - name: Authenticate GitHub CLI - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - - - name: Post benchmark results - run: | - cat compare_results.txt - gh pr comment ${{ github.event.issue.number }} --body "$(cat compare_results.txt)" +# - name: Matmul Benchmark +# run: | +# source bitblas_benchmark/bin/activate +# cd benchmark/operators +# python ./benchmark_ops_matmul.py + +# benchmark_compare: +# if: github.event.issue.pull_request != null && contains(github.event.comment.body, '/run-benchmark') +# needs: [benchmark_base, benchmark_head] +# runs-on: self-hosted + +# steps: +# - name: Download commit IDs +# uses: actions/download-artifact@v4.1.7 +# with: +# name: base-commit-id +# path: . + +# - name: Download PR commit ID +# uses: actions/download-artifact@v4.1.7 +# with: +# name: pr-commit-id +# path: . + +# - name: Set up Python +# uses: actions/setup-python@v2 +# with: +# python-version: '3.9' + +# - name: Create virtual environment +# run: python -m venv bitblas_benchmark + +# - name: Activate virtual environment and install dependencies +# run: | +# source bitblas_benchmark/bin/activate +# python -m pip install --upgrade pip +# if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi + +# - name: Compare benchmark results +# run: | +# source bitblas_benchmark/bin/activate +# cd benchmark/operators +# python ./compare_benchmark.py --base $(cat base_commit_id.txt) --head $(cat pr_commit_id.txt) 2>&1 | tee compare_results.txt + +# - name: Authenticate GitHub CLI +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + +# - name: Post benchmark results +# run: | +# cat compare_results.txt +# gh pr comment ${{ github.event.issue.number }} --body "$(cat compare_results.txt)" diff --git a/3rdparty/tvm b/3rdparty/tvm index c6be66d56..180359a9a 160000 --- a/3rdparty/tvm +++ b/3rdparty/tvm @@ -1 +1 @@ -Subproject commit c6be66d563695bfbaf4f3d46d312e82b6ad9be1d +Subproject commit 180359a9ab7a04e6b3ad472a12295d9d3056fa95 diff --git a/bitblas/tl/mfma_macro_generator.py b/bitblas/tl/mfma_macro_generator.py index b6ccc7b2a..2fe8c0061 100644 --- a/bitblas/tl/mfma_macro_generator.py +++ b/bitblas/tl/mfma_macro_generator.py @@ -146,7 +146,7 @@ def ldmatrix_a(self, A_local_buf, A_shared_buf, ki, thread_bindings, rk=0): WARP_SIZE = self.WARP_SIZE block_row_warps = self.block_row_warps block_col_warps = self.block_col_warps - warp_col_tiles = self.warp_col_tiles + warp_row_tiles = self.warp_row_tiles warp_cols = self.warp_cols chunk = self.chunk micro_size_x = self.micro_size_x @@ -171,13 +171,13 @@ def _warp_ldmatrix_a( for local_id in T.vectorized(local_size_a): row, col = T.meta_var(reverse_index_map(tx, local_id)) l, r = (rk * chunk + ki * micro_size_k, - tz * warp_col_tiles + i * micro_size_x) + tz * warp_row_tiles + i * micro_size_x) A_local_buf[i * local_size_a + local_id] = A_shared_buf[l + row, r + col] else: for i in T.serial(warp_cols): for local_id in T.vectorized(local_size_a): row, col = T.meta_var(reverse_index_map(tx, local_id)) - l, r = (tz * warp_col_tiles + i * micro_size_x, + l, r = (tz * warp_row_tiles + i * micro_size_x, rk * chunk + ki * micro_size_k) A_local_buf[i * local_size_a + local_id] = A_shared_buf[l + row, r + col]