Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor argument addition using addArguments in FuncOpConversion #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:
jobs:
pre-commit:
name: Pre-commit checks
runs-on:
- glados
- intel
- x86
runs-on: ubuntu-latest
#- glados
#- intel
#- x86
steps:
- name: Print inputs
run: |
Expand Down Expand Up @@ -46,10 +46,10 @@ jobs:

build-test:
name: Build and test
runs-on:
- glados
- intel
- x86
runs-on: ubuntu-latest
#- glados
#- intel
#- x86
strategy:
matrix:
python: ['3.11']
Expand All @@ -69,8 +69,9 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install wheel cmake==3.24 ninja pytest-xdist lit pybind11
sudo apt-get update
sudo apt-get install -y zlib1g-dev g++
sudo apt-get install -y zlib1g-dev g++ build-essential cmake ninja-build python3-dev
pip install torch==2.1.2
git submodule update --init --recursive

- name: Install Triton
run: |
Expand Down
9 changes: 3 additions & 6 deletions third_party/cpu/lib/TritonCPUToLLVM/FuncOpToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,9 @@ struct FuncOpConversion : public ConvertOpToLLVMPattern<triton::FuncOp> {
auto amendedFuncOp = rewriter.create<triton::FuncOp>(
funcOp.getLoc(), funcOp.getName(), amendedFuncTy, amendedAttrs);
auto &region = funcOp.getBody();
region.addArgument(i32_ty, loc);
region.addArgument(i32_ty, loc);
region.addArgument(i32_ty, loc);
region.addArgument(ui32_ty, loc);
region.addArgument(ui32_ty, loc);
region.addArgument(ui32_ty, loc);
region.front().addArguments(
{i32_ty, i32_ty, i32_ty, ui32_ty, ui32_ty, ui32_ty}, loc);

rewriter.inlineRegionBefore(region, amendedFuncOp.getBody(),
amendedFuncOp.end());
return amendedFuncOp;
Expand Down
Loading