repo_name
stringlengths
1
62
dataset
stringclasses
1 value
lang
stringclasses
11 values
pr_id
int64
1
20.1k
owner
stringlengths
2
34
reviewer
stringlengths
2
39
diff_hunk
stringlengths
15
262k
code_review_comment
stringlengths
1
99.6k
intel-xpu-backend-for-triton
github_2023
cpp
2,518
intel
etiotto
@@ -390,6 +415,7 @@ emitBaseIndexForDpasLayout(Location loc, RewriterBase &rewriter, Value warpId = udiv(threadId, warpSize); Value laneId = urem(threadId, warpSize); + unsigned rank = type.getShape().size();
```suggestion size_t rank = type.getShape().size(); ```
intel-xpu-backend-for-triton
github_2023
cpp
2,518
intel
victor-eds
@@ -102,51 +102,80 @@ SmallVector<unsigned> DpasEncodingAttr::getDPASInstShapeC() const { }; SmallVector<unsigned> DpasEncodingAttr::getShapeA() const { - auto shapeA = getDPASInstShapeA(); + auto instShapeA = getDPASInstShapeA(); auto repCluster = getRepCluster(); - return {shapeA[0] * repCluster[0], shapeA[...
```suggestion llvm::transform(llvm::zip_equal(shapeC, warpsPerCTA), shapePerCTATile.begin(), [](auto entry) { return entry.first * entry.second; }); ``` Cleaner IMO
intel-xpu-backend-for-triton
github_2023
cpp
2,518
intel
victor-eds
@@ -157,65 +186,99 @@ unsigned DpasEncodingAttr::getTotalElemsPerThread(ArrayRef<int64_t> shape, } SmallVector<unsigned> DpasEncodingAttr::getCTASplitNum() const { - SmallVector<unsigned> res{1, 1}; + size_t rank = getWarpsPerCTA().size(); + SmallVector<unsigned> res(rank, 1); return res; } SmallVector<un...
`llvm::to_vector(llvm::reverse(llvm::seq<unsigned>(rank)));` was nicer IMO
intel-xpu-backend-for-triton
github_2023
cpp
2,518
intel
victor-eds
@@ -157,65 +186,99 @@ unsigned DpasEncodingAttr::getTotalElemsPerThread(ArrayRef<int64_t> shape, } SmallVector<unsigned> DpasEncodingAttr::getCTASplitNum() const { - SmallVector<unsigned> res{1, 1}; + size_t rank = getWarpsPerCTA().size(); + SmallVector<unsigned> res(rank, 1); return res; } SmallVector<un...
Same
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +83,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
```suggestion /// So we can reduce on dimensions 6 and 4 to get to: ```
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +83,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
Clarify `size` refers to the tensor's shape (all other identifiers are attributes in the layout).
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -222,10 +255,14 @@ struct DpasOperandPattern final : OpRewritePattern<ReduceOp> { ArrayRef<int64_t> oldShape = oldType.getShape(); auto oldEncoding = cast<DpasEncodingAttr>(oldType.getEncoding()); - constexpr size_t rank = 5; + constexpr size_t rank = 7; std::array<int64_t, rank> shape{ ...
Add comments explaining the dim (similar to what you did for the split X-axis).
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +75,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
`size[1]` should be `getShape()[1]` then?
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +75,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
Same as above.
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +75,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
This layout conversion is handled by the new subgroup transpose codegen you added in the other PRs, correct?
intel-xpu-backend-for-triton
github_2023
cpp
2,533
intel
jopperm
@@ -83,66 +75,89 @@ static Value createReshapeForReduction(PatternRewriter &rewriter, Location loc, /// | t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... tnn tn1 tn2 tn3 tn4 ... tnn | /// v t0 t1 t2 t3 ... tn t0 t1 t2 t3 ... tn tn1 tn2 tn3 ... ...
Could you annotate the dimension number in the figures, please?
intel-xpu-backend-for-triton
github_2023
others
2,573
intel
mfrancepillois
@@ -257,3 +257,106 @@ module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 1 : tt.return %0 : tensor<32xf32, #sliced1> } } + +// ----- + +// Case of more than one element per thread in the non-sliced dimension. + +#blocked = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp =...
Can you use a more explicit name? ```suggestion tt.func @test_f64(%arg0: tensor<32xf64, #sliced>) -> tensor<32xf64, #sliced1> { ```
intel-xpu-backend-for-triton
github_2023
others
2,573
intel
mfrancepillois
@@ -257,3 +257,106 @@ module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 1 : tt.return %0 : tensor<32xf32, #sliced1> } } + +// ----- + +// Case of more than one element per thread in the non-sliced dimension. + +#blocked = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp =...
Same as above. ```suggestion tt.func @test_i32_2warps(%arg0: tensor<128xi32, #sliced>) -> tensor<128xi32, #sliced1> { ```
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -0,0 +1,19 @@ +print_conda_info() {
It is specific for conda, let's move to run-conda.sh.
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -92,8 +92,10 @@ run_tutorial_test() { capture_runtime_env() { mkdir -p "$TRITON_TEST_REPORTS_DIR" + set +u
You can use this instead of `set +u/set -u` ``` echo "${CMPLR_ROOT:-}" > $TRITON_TEST_REPORTS_DIR/cmplr_version.txt ```
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -69,18 +73,29 @@ jobs: runs-on: ${{ fromJson(inputs.runner_label && format('["{0}"]', inputs.runner_label) || format('["{0}", "{1}", "{2}"]', inputs.device, inputs.driver_version, inputs.runner_version)) }} defaults: run: - shell: bash -noprofile --norc -eo pipefail -c "source /opt/intel/onea...
I don't like the idea to pass the python version to this script and also that this "environment manager" creates conda environment. Instead, you can make it in a separate step with custom shell, so the default shell is not used.
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -159,16 +195,17 @@ jobs: echo "TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION" | tee -a $GITHUB_ENV - name: Install transformers - if: ${{ inputs.python_version != '3.12' }} + if: inputs.env_manager == 'base' && inputs.python_version != '3.12' uses: ./.github/actions/install-de...
`.github/actions/install-dependency` does not have input `env_manager`.
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -91,26 +111,42 @@ jobs: key: pip-${{ inputs.python_version }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }} - name: Install Python ${{ inputs.python_version }} + if: inputs.env_manager == 'base' uses: actions/setup-python@v5 with: ...
The `environment manager` is active here, why do you still need `conda run`?
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -159,32 +203,56 @@ jobs: echo "TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION" | tee -a $GITHUB_ENV - name: Install transformers + if: inputs.env_manager == 'base' uses: ./.github/actions/install-dependency with: package: transformers repository: hugging...
This is by design: we do not cache installed packages, instead we cache the pip cache, which pip uses to install packages from instead of Downloading from the Internet. Please remove this FIXME.
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -69,48 +73,88 @@ jobs: runs-on: ${{ fromJson(inputs.runner_label && format('["{0}"]', inputs.runner_label) || format('["{0}", "{1}", "{2}"]', inputs.device, inputs.driver_version, inputs.runner_version)) }} defaults: run: - shell: bash -noprofile --norc -eo pipefail -c "source /opt/intel/onea...
Use actions/checkout instead. Also `inputs.pytorch_ref` is empty by default with the expected result (https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/11364623535/job/31611044974#step:3:4): ``` git checkout ``` The semantic is different with the "base" mode: when `pytorch_ref` is empty, the...
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -159,32 +209,55 @@ jobs: echo "TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION" | tee -a $GITHUB_ENV - name: Install transformers + if: inputs.env_manager == 'base' uses: ./.github/actions/install-dependency with: package: transformers repository: hugging...
Use actions/checkout?
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -307,6 +312,22 @@ run_instrumentation_tests() { pytest -vvv --device xpu instrumentation/test_gpuhello.py } +run_inductor_tests() { + test -d pytorch || ( + git clone https://github.com/pytorch/pytorch + rev=$(cat .github/pins/pytorch-upstream.txt) + cd pytorch + git checkout $rev + ) + + pip ...
For some reason the original important comments are missing: ``` # TODO: Find the fastest Hugging Face model # The script above always returns 0, so we need an additional check to see if the accuracy test passed ```
intel-xpu-backend-for-triton
github_2023
others
2,458
intel
pbchekin
@@ -298,7 +303,7 @@ run_instrumentation_tests() { return fi - INSTRUMENTATION_LIB_DIR=$(ls -1d $TRITON_PROJ/python/build/*lib*/triton/instrumentation) || err "Could not find $TRITON_PROJ/python/build/*lib*/triton/instrumentation, build Triton first" + INSTRUMENTATION_LIB_DIR=$(ls -1d $TRITON_PROJ/python/bui...
```suggestion INSTRUMENTATION_LIB_DIR=$(ls -1d $TRITON_PROJ/python/build/*lib*/triton/instrumentation) || INSTRUMENTATION_LIB_DIR=$(ls -1d $TRITON_PROJ/python/triton/_C) || err "Could not find $TRITON_PROJ/python/build/*lib*/triton/instrumentation, build Triton first" ```
intel-xpu-backend-for-triton
github_2023
cpp
2,566
intel
kballeda
@@ -372,22 +390,43 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, return triton_args.host_outbuffer; } +bool check_option_amoung_argv(int argc, char **argv, std::string option) {
I believe passing argc/argv to another function this way may not be a good idea. we could use a parsing library to avoid this manual processing of various options, just as an example something like this (my past work). https://github.com/Xilinx/Vitis_Libraries/blob/3c8a3d59fe76157ffa0b31fb267961bea2e148f5/data_comp...
intel-xpu-backend-for-triton
github_2023
cpp
2,566
intel
kballeda
@@ -372,22 +390,43 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, return triton_args.host_outbuffer; } +bool check_option_amoung_argv(int argc, char **argv, std::string option) { + bool res = false; + if (argc > 2) { + // optional parameters can be in any order + for (int i = 2; i < a...
as get_kernel_time is passed across launch(), sycl_launch_kernel() would it be possible to set it as part of constructor of struct ?
intel-xpu-backend-for-triton
github_2023
cpp
2,566
intel
kballeda
@@ -352,8 +364,14 @@ at::Tensor launchKernel(sycl::queue stream, sycl::kernel kernel, } } + if (!triton_args.host_outbuffer.defined()) { + std::string message = "Output tensor isn't configurated; \
message typo (NITS)
intel-xpu-backend-for-triton
github_2023
python
2,572
intel
pbchekin
@@ -125,11 +125,33 @@ def run(self): super().run() -setup(name="triton-kernels-benchmark", packages=[ - "triton_kernels_benchmark", -], package_dir={ - "triton_kernels_benchmark": "triton_kernels_benchmark", -}, package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]}, cmdclass={ - ...
Why `3.1.0`?
intel-xpu-backend-for-triton
github_2023
python
2,572
intel
pbchekin
@@ -125,11 +125,33 @@ def run(self): super().run() -setup(name="triton-kernels-benchmark", packages=[ - "triton_kernels_benchmark", -], package_dir={ - "triton_kernels_benchmark": "triton_kernels_benchmark", -}, package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]}, cmdclass={ - ...
Nit: the function is not required ```suggestion install_requires=["torch", "matplotlib", "pandas", "tabulate"], ```
intel-xpu-backend-for-triton
github_2023
python
2,572
intel
anmyachev
@@ -125,11 +125,37 @@ def run(self): super().run() -setup(name="triton-kernels-benchmark", packages=[ - "triton_kernels_benchmark", -], package_dir={ - "triton_kernels_benchmark": "triton_kernels_benchmark", -}, package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]}, cmdclass={ - ...
Why don't we have to use the version defined by the pin here: https://github.com/intel/intel-xpu-backend-for-triton/blob/main/.github/pins/ipex.txt?
intel-xpu-backend-for-triton
github_2023
others
2,538
intel
pbchekin
@@ -82,7 +82,7 @@ runs: uses: ./.github/actions/load env: # Increase this value to reset cache - CACHE_NUMBER: 12 + CACHE_NUMBER: 13
Not needed if scripts/patch-pytorch.sh is changed.
intel-xpu-backend-for-triton
github_2023
cpp
2,502
intel
whitneywhtsang
@@ -1,11 +1,10 @@ +#include "intel/include/Analysis/AxisInfo.h" #include "mlir/Analysis/DataFlowFramework.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" +#include "triton/Dialect/Triton/IR/Dialect.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "intel/include/Analysis/AxisInfo....
Why moving the includes? The previous way matches the common AxisInfo.cpp better.
intel-xpu-backend-for-triton
github_2023
cpp
2,502
intel
whitneywhtsang
@@ -1011,49 +1010,50 @@ class MakeTensorPtrOpAxisInfoVisitor final ArrayRef<const dataflow::Lattice<AxisInfo> *> operands) override { LDBG("MakeTensorPtrOpAxisInfoVisitor: " << *op); - // TODO: Extend to higher dimension tensor pointers. - if (op.getShape().size() != 2) + auto ptrTy = cas...
Why printing this and follow by nothing after?
intel-xpu-backend-for-triton
github_2023
cpp
2,502
intel
whitneywhtsang
@@ -20,18 +22,27 @@ namespace mlir::triton::gpu::intel { using namespace mlir; namespace tt = mlir::triton; +namespace ttg = mlir::triton::gpu; namespace ttgi = mlir::triton::gpu::intel; namespace { +RankedTensorType getRankedTensorType(Type ptrTy) {
can we use the one you added in utility?
intel-xpu-backend-for-triton
github_2023
cpp
2,502
intel
whitneywhtsang
@@ -102,61 +113,242 @@ struct CoalescePass SmallVector<unsigned> sizePerThread(refTensorType.getRank(), 1); sizePerThread[order[0]] = perThread; - auto CTALayout = triton::gpu::getCTALayout(refTensorType.getEncoding()); - layoutMap[op] = triton::gpu::BlockedEncodingAttr::get( + auto CTALayout = ttg...
Wonder if `scf::YieldOp` satisfy this check..do we need line 150-151?
intel-xpu-backend-for-triton
github_2023
others
2,521
intel
etiotto
@@ -0,0 +1,428 @@ +// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm | FileCheck %s + +// Basic 16x16 transpose test + +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> +#blocked1 = #triton_g...
Remove `triton_gpu.target = "xpu"` ?
intel-xpu-backend-for-triton
github_2023
others
2,521
intel
etiotto
@@ -0,0 +1,428 @@ +// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm | FileCheck %s + +// Basic 16x16 transpose test + +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> +#blocked1 = #triton_g...
Remove `triton_gpu.target = "xpu"` ? Same for the rest of the file
intel-xpu-backend-for-triton
github_2023
cpp
2,521
intel
etiotto
@@ -532,22 +581,227 @@ struct ConvertLayoutOpUsingLinearLayoutsConversion return success(); } + bool isSupportedSubGroupTranspose(ConvertLayoutOp op, + OpAdaptor adaptor) const { + auto srcType = cast<LLVM::LLVMStructType>(adaptor.getSrc().getType()); + ArrayRef<Type>...
Now is implemented, remove the comment?
intel-xpu-backend-for-triton
github_2023
others
2,531
intel
etiotto
@@ -0,0 +1,259 @@ +// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm | FileCheck %s + +// Basic 16x16 shuffle test + +#blocked = #triton_gpu.blocked<{sizePerThread = [1, 16], threadsPerWarp = [16, 1], warpsPerCTA = [1, 1], order = [0, 1]}> +#blocked1 = #triton_gpu...
remove unnecessary attributes pls
intel-xpu-backend-for-triton
github_2023
cpp
2,511
intel
chengjunlu
@@ -432,11 +434,45 @@ struct ConvertLayoutOpConversion struct ConvertLayoutOpUsingLinearLayoutsConversion : public ConvertOpToLLVMPattern<ConvertLayoutOp> { + constexpr static unsigned minSubGroupTransposeWidth = 8; + // Set benefit to 2 so that this pattern applies before other convert-layout // convers...
Not a bug in this case. Better to use `dstLayout` to `srcLayout` conversion to align others which are used to avoid surjective issue.
intel-xpu-backend-for-triton
github_2023
cpp
2,511
intel
chengjunlu
@@ -432,11 +434,45 @@ struct ConvertLayoutOpConversion struct ConvertLayoutOpUsingLinearLayoutsConversion : public ConvertOpToLLVMPattern<ConvertLayoutOp> { + constexpr static unsigned minSubGroupTransposeWidth = 8; + // Set benefit to 2 so that this pattern applies before other convert-layout // convers...
Can we use the size of the `register` and `lane` dim instead of hardcoding `{{0, 1}, {0, 2}, {0, 4}, {0, 8}}`?
intel-xpu-backend-for-triton
github_2023
cpp
2,511
intel
whitneywhtsang
@@ -432,11 +434,62 @@ struct ConvertLayoutOpConversion struct ConvertLayoutOpUsingLinearLayoutsConversion : public ConvertOpToLLVMPattern<ConvertLayoutOp> { + constexpr static unsigned minSubGroupTransposeWidth = 8; + // Set benefit to 2 so that this pattern applies before other convert-layout // convers...
Can we add TargetInfo more similar to how it is done in upstream? https://github.com/triton-lang/triton/blob/main/lib/Conversion/TritonGPUToLLVM/ConvertLayoutOpToLLVM.cpp#L237
intel-xpu-backend-for-triton
github_2023
others
2,511
intel
etiotto
@@ -0,0 +1,299 @@ +// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm | FileCheck %s + +// Basic 16x16 transpose test + +#blocked = #triton_gpu.blocked<{sizePerThread = [16, 1], threadsPerWarp = [1, 16], warpsPerCTA = [1, 1], order = [0, 1]}> +#blocked1 = #triton_g...
remove unnecessary attributes (e.g. xpu)
intel-xpu-backend-for-triton
github_2023
python
2,520
intel
chengjunlu
@@ -148,23 +149,36 @@ def benchmark(M, N, K, provider): quantiles = [0.5, 0.0, 1.0] if provider == 'onednn': - _, min_ms, max_ms, mean, cv = benchmark_suit.do_bench(lambda: torch.matmul(a, b), n_warmup=10, n_repeat=10, - quantiles=quantiles...
Can we enable the accuracy checking?
intel-xpu-backend-for-triton
github_2023
others
2,528
intel
etiotto
@@ -1,4 +1,4 @@ -// RUN: triton-opt %s -split-input-file -tritonintelgpu-distribute-to-warps | FileCheck %s +// RUN: env TRITON_INTEL_ADVANCED_PATH=1 triton-opt %s -split-input-file -tritonintelgpu-distribute-to-warps | FileCheck %s
Add //TODO: remove the env. variable once issue #2529 is fixed.
intel-xpu-backend-for-triton
github_2023
cpp
2,530
intel
etiotto
@@ -895,7 +895,7 @@ class ShLIOpAxisInfoVisitor final : public BinaryOpVisitorImpl<arith::ShLIOp> { lhsDivisibility = 1; } auto numBits = log2Int(lhsDivisibility); - return multiplyDivisor(lhsDivisibility, 1 << shift); + return multiplyDivisor(lhsDivisibility, static_cast<int64_t>(1) << shift);
This is ok. But have you tried the simpler `1ll << shift` ?
intel-xpu-backend-for-triton
github_2023
cpp
2,530
intel
etiotto
@@ -900,7 +900,7 @@ class ShLIOpAxisInfoVisitor final : public BinaryOpVisitorImpl<arith::ShLIOp> { lhsDivisibility = 1; } auto numBits = log2Int(lhsDivisibility); - return multiplyDivisor(lhsDivisibility, 1 << shift); + return multiplyDivisor(lhsDivisibility, static_cast<int64_t>(1) << shift);
Try `1ll << shilft`
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
chengjunlu
@@ -0,0 +1,280 @@ +// RUN: triton-opt %s --split-input-file -tritonintelgpu-optimize-reduction-locality -canonicalize | FileCheck %s + +// Test reduction in a single warp (16x16->16). + +#mma = #triton_intel_gpu.dpas<{repeatCount = 8, systolicDepth = 8, executionSize = 16, opsPerChan = 1, threadsPerWarp = 16, warpsPerC...
Is the transpose efficient when lowering the `tt.reshape`? I suppose the LinearLayout is used for the reshaping and it should be efficient without spilling to SLM.
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -284,4 +284,72 @@ def TritonIntelGPUMaterializeBlockPointer : Pass<"tritonintelgpu-materialize-blo "mlir::arith::ArithDialect"]; } +def TritonIntelGPUOptimizeReductionLocality + : Pass<"tritonintelgpu-optimize-reduction-locality", "mlir::ModuleOp"> { + let summary = "Minimize numbe...
[nit]: I would remove the intel module attributes that aren't required for this transformation to work.
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -284,4 +284,72 @@ def TritonIntelGPUMaterializeBlockPointer : Pass<"tritonintelgpu-materialize-blo "mlir::arith::ArithDialect"]; } +def TritonIntelGPUOptimizeReductionLocality + : Pass<"tritonintelgpu-optimize-reduction-locality", "mlir::ModuleOp"> { + let summary = "Minimize numbe...
test_two_warps_twice -> test.work (as above) The modified function should also return the same type as the original function (dim = 0)
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -284,4 +284,72 @@ def TritonIntelGPUMaterializeBlockPointer : Pass<"tritonintelgpu-materialize-blo "mlir::arith::ArithDialect"]; } +def TritonIntelGPUOptimizeReductionLocality + : Pass<"tritonintelgpu-optimize-reduction-locality", "mlir::ModuleOp"> { + let summary = "Minimize numbe...
Should depend on the intel triton gpu dialect.
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -284,4 +284,72 @@ def TritonIntelGPUMaterializeBlockPointer : Pass<"tritonintelgpu-materialize-blo "mlir::arith::ArithDialect"]; } +def TritonIntelGPUOptimizeReductionLocality + : Pass<"tritonintelgpu-optimize-reduction-locality", "mlir::ModuleOp"> { + let summary = "Minimize numbe...
to prevent within the sub-group... -> within the sub-group ?
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
close the precious namespace before starting the anonymous namespace (this is the pattern used in other transformation currently).
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
std::size_t -> size_t ?
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
DPas -> Dpas
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -0,0 +1,292 @@ +// RUN: triton-opt %s --split-input-file -tritonintelgpu-optimize-reduction-locality -canonicalize | FileCheck %s + +// Test reduction in a single warp (16x16->16). + +#mma = #triton_intel_gpu.dpas<{repeatCount = 8, systolicDepth = 8, executionSize = 16, opsPerChan = 1, threadsPerWarp = 16, warpsPerC...
Can we remove the intel attributes that aren't strictly required (keep `triton_intel_gpu.support_dpas` only) ?
intel-xpu-backend-for-triton
github_2023
others
2,491
intel
etiotto
@@ -0,0 +1,292 @@ +// RUN: triton-opt %s --split-input-file -tritonintelgpu-optimize-reduction-locality -canonicalize | FileCheck %s
Can we drop -canonicalize (if it isn't easy to do I'm ok to keep it though) ?
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
Make it a private member function?
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
std::size_t and size_t are different ?
intel-xpu-backend-for-triton
github_2023
cpp
2,491
intel
etiotto
@@ -0,0 +1,356 @@ +//===- OptimizeReductionLocality.cpp ------------------------------------*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--...
assert axis is positive?
intel-xpu-backend-for-triton
github_2023
others
2,428
intel
pbchekin
@@ -136,6 +140,7 @@ jobs: test_mode: performance dtype: ${{ matrix.dtype }} models: ${{ inputs.models }} + test_all_subset_models: "${{ inputs.test_all_subset_models }}"
```suggestion test_all_subset_models: ${{ inputs.test_all_subset_models || false }} ```
intel-xpu-backend-for-triton
github_2023
others
2,428
intel
pbchekin
@@ -125,6 +129,7 @@ jobs: test_mode: accuracy dtype: ${{ matrix.dtype }} models: ${{ inputs.models }} + test_all_subset_models: "${{ inputs.test_all_subset_models }}"
```suggestion test_all_subset_models: ${{ inputs.test_all_subset_models || false }} ```
intel-xpu-backend-for-triton
github_2023
others
2,428
intel
pbchekin
@@ -225,7 +229,7 @@ jobs: bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 ${{ inputs.only_one_model }} elif [[ "${{ inputs.models }}" == "subset" ]]; then while read model; do ...
This won't work as expected, the script returns 0 even if some accuracy tests or performance runs failed. You need to check the report (csv file) and verify it has all items from a corresponding subset and every item has passed. See https://github.com/intel/intel-xpu-backend-for-triton/blob/main/.github/workflows/build...
intel-xpu-backend-for-triton
github_2023
others
2,428
intel
pbchekin
@@ -226,6 +230,7 @@ jobs: elif [[ "${{ inputs.models }}" == "subset" ]]; then while read model; do bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 $model + grep ...
This will work only for accuracy. Also for accuracy it is possible that CSV file does not exist (major failure with E2E) in this case the one liner above won't work. I think you need more sophisticated script to handle accuracy/performance and all corner cases. The idea is you need to check that every model from the su...
intel-xpu-backend-for-triton
github_2023
python
2,428
intel
pbchekin
@@ -0,0 +1,67 @@ +#!/usr/bin/env python +import argparse +from pathlib import Path +import csv +import sys + + +def check_report(suite, dtype, mode, test_mode, device, models_file): + inductor_log_dir = Path("torch_compile_debug") / suite / dtype
I think the right location is `inductor_log`. Anyways, it is better to pass it as a parameter.
intel-xpu-backend-for-triton
github_2023
python
2,428
intel
pbchekin
@@ -0,0 +1,67 @@ +#!/usr/bin/env python +import argparse +from pathlib import Path +import csv +import sys + + +def check_report(suite, dtype, mode, test_mode, device, models_file): + inductor_log_dir = Path("torch_compile_debug") / suite / dtype + inductor_report_filename = f"inductor_{suite}_{dtype}_{mode}_{dev...
The mode sting can be `inference-no-freezing` (see the workflow inputs). The location needs to be `inference` in this case.
intel-xpu-backend-for-triton
github_2023
python
2,428
intel
pbchekin
@@ -0,0 +1,67 @@ +#!/usr/bin/env python +import argparse +from pathlib import Path +import csv +import sys + + +def check_report(suite, dtype, mode, test_mode, device, models_file): + inductor_log_dir = Path("torch_compile_debug") / suite / dtype + inductor_report_filename = f"inductor_{suite}_{dtype}_{mode}_{dev...
Nit: use `readlines()`.
intel-xpu-backend-for-triton
github_2023
c
2,391
intel
victor-eds
@@ -26,25 +26,14 @@ static std::vector<ze_device_handle_t> g_devices; static std::vector<std::pair<sycl::device, ze_device_handle_t>> g_sycl_l0_device_list; -static inline void gpuAssert(ze_result_t code) { - if (code != ZE_RESULT_SUCCESS) { - auto str = parseZeResultCode(code); - char err[1024] = {0}; -...
```suggestion const auto code = std::get<1>(tuple); if (code != ZE_RESULT_SUCCESS) throw std::runtime_error(parseZeResultCode(code)); return std::get<0>(tuple); ``` Simpler
intel-xpu-backend-for-triton
github_2023
c
2,391
intel
victor-eds
@@ -113,14 +102,79 @@ void freeKernelBundle(PyObject *p) { PyCapsule_GetPointer(p, "kernel_bundle")); } +using Spills = int32_t; + +template <typename L0_DEVICE, typename L0_CONTEXT> +std::tuple<ze_module_handle_t, ze_kernel_handle_t, Spills> +compileLevelZeroObjects(uint8_t *binary_ptr, const size_t binary_s...
```suggestion const std::string LARGE_GRF_FLAG{"-cl-intel-256-GRF-per-thread"}; const std::string SMALL_GRF_FLAG{"-cl-intel-128-GRF-per-thread"}; const std::string AUTO_GRF_FLAG{"-cl-intel-enable-auto-large-GRF-mode"}; ``` I'd suggest having these as `const char *` or similar to avoid allocation (if that's c...
intel-xpu-backend-for-triton
github_2023
c
2,391
intel
etiotto
@@ -113,14 +102,79 @@ void freeKernelBundle(PyObject *p) { PyCapsule_GetPointer(p, "kernel_bundle")); } +using Spills = int32_t; + +template <typename L0_DEVICE, typename L0_CONTEXT> +std::tuple<ze_module_handle_t, ze_kernel_handle_t, Spills> +compileLevelZeroObjects(uint8_t *binary_ptr, const size_t binary_s...
```suggestion const bool hasGRFSizeFlag() const { ```
intel-xpu-backend-for-triton
github_2023
c
2,391
intel
etiotto
@@ -113,14 +102,79 @@ void freeKernelBundle(PyObject *p) { PyCapsule_GetPointer(p, "kernel_bundle")); } +using Spills = int32_t; + +template <typename L0_DEVICE, typename L0_CONTEXT> +std::tuple<ze_module_handle_t, ze_kernel_handle_t, Spills> +compileLevelZeroObjects(uint8_t *binary_ptr, const size_t binary_s...
```suggestion if (build_flags_str.find(LARGE_GRF_FLAG) != std::string::npos || build_flags_str.find(SMALL_GRF_FLAG) != std::string::npos || build_flags_str.find(AUTO_GRF_FLAG) != std::string::npos) return true; return false; ```
intel-xpu-backend-for-triton
github_2023
c
2,391
intel
etiotto
@@ -113,14 +102,79 @@ void freeKernelBundle(PyObject *p) { PyCapsule_GetPointer(p, "kernel_bundle")); } +using Spills = int32_t; + +template <typename L0_DEVICE, typename L0_CONTEXT> +std::tuple<ze_module_handle_t, ze_kernel_handle_t, Spills> +compileLevelZeroObjects(uint8_t *binary_ptr, const size_t binary_s...
```suggestion int32_t n_regs() const { ```
intel-xpu-backend-for-triton
github_2023
python
2,328
intel
whitneywhtsang
@@ -256,7 +252,13 @@ def benchmark(B, M, N, K, provider): _, min_ms, max_ms, mean_ms, cv = benchmark_suit.do_bench(lambda: torch.matmul(a, b), warmup=10, rep=10, quantiles=quantiles, fast_flush=False) elif provider == 'triton': - tri...
how about assert len(a.shape) == len(b.shape)?
intel-xpu-backend-for-triton
github_2023
python
2,328
intel
whitneywhtsang
@@ -256,7 +252,13 @@ def benchmark(B, M, N, K, provider): _, min_ms, max_ms, mean_ms, cv = benchmark_suit.do_bench(lambda: torch.matmul(a, b), warmup=10, rep=10, quantiles=quantiles, fast_flush=False) elif provider == 'triton': - tri...
```suggestion assert len(a.shape) == len(b.shape), 'Incompatible sizes' if len(a.shape) == 3: c = torch.empty((B, M, N), device='xpu', dtype=torch.float32) else: assert len(a.shape) == 2, 'Expecting shape of length 2' c = torch.empty((M, N), device='xpu'...
intel-xpu-backend-for-triton
github_2023
python
2,496
intel
anmyachev
@@ -309,6 +309,10 @@ def benchmark(B, M, N, K, provider): acc = torch.empty((B, M, N), device='xpu', dtype=torch.float32) cnt = torch.empty((B, M, N), device='xpu', dtype=torch.int32) name = f'gemm_shape_{B}_{M}_{K}_{N}' + # FIXME: Use gemm_streamk_benchmark.py when Triton stre...
@whitneywhtsang please also add the following kernel name to `kernels_name`: `'gemm_streamk_shape_3072_4096_3072': 'stream_k_gemm_run',`
intel-xpu-backend-for-triton
github_2023
others
2,415
intel
pbchekin
@@ -10,7 +10,8 @@ if(NOT WIN32) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") endif() -find_package(Python3 COMPONENTS Interpreter) +find_package(Python 3.9 REQUIRED
Why Python 3.9?
intel-xpu-backend-for-triton
github_2023
others
2,415
intel
anmyachev
@@ -10,9 +10,11 @@ if(NOT WIN32) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") endif() -find_package(Python3 COMPONENTS Interpreter) +find_package(Python3 REQUIRED + COMPONENTS Development.Module)
What is the reason for this change?
intel-xpu-backend-for-triton
github_2023
others
2,415
intel
anmyachev
@@ -26,8 +22,7 @@ else() set(XETLA_KERNEL_FLAGS ${XETLA_KERNEL_FLAGS} "${XETLA_OFFLINE_OPTIONS}") endif() -add_library(xetla_kernel SHARED python_main.cpp) -set_target_properties(xetla_kernel PROPERTIES PREFIX "") +Python3_add_library(xetla_kernel MODULE WITH_SOABI python_main.cpp)
Does this function automatically include python libraries?
intel-xpu-backend-for-triton
github_2023
others
2,415
intel
anmyachev
@@ -3,13 +3,15 @@ include(FetchContent) if (NOT XeTLALibrary_FOUND) + # TODO: switch ot FetchContent_MakeAvailable once XeTLA supports it + cmake_policy(SET CMP0169 OLD) set(XeTLALibrary_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/XeTLALibrary") message(STATUS "XeTLALibrary is not specifi...
Why?
intel-xpu-backend-for-triton
github_2023
cpp
2,415
intel
anmyachev
@@ -16,6 +16,8 @@ #ifndef TRITONBENCHMARK_FMHA_FWD_V5_H #define TRITONBENCHMARK_FMHA_FWD_V5_H +#include <cmath>
Why?
intel-xpu-backend-for-triton
github_2023
python
2,415
intel
anmyachev
@@ -1,83 +1,135 @@ import os -import re import shutil import subprocess -import sysconfig import sys -from setuptools import setup +# TODO: update once there is replacement for clean: +# https://github.com/pypa/setuptools/discussions/2838 +from distutils import log # pylint: disable=[deprecated-module] +from di...
The name does not match the class naming style. CamelCase?
intel-xpu-backend-for-triton
github_2023
python
2,415
intel
anmyachev
@@ -1,83 +1,135 @@ import os -import re import shutil import subprocess -import sysconfig import sys -from setuptools import setup +# TODO: update once there is replacement for clean: +# https://github.com/pypa/setuptools/discussions/2838 +from distutils import log # pylint: disable=[deprecated-module] +from di...
The name does not match the class naming style. CamelCase?
intel-xpu-backend-for-triton
github_2023
python
2,415
intel
anmyachev
@@ -1,83 +1,135 @@ import os -import re import shutil import subprocess -import sysconfig import sys -from setuptools import setup +# TODO: update once there is replacement for clean: +# https://github.com/pypa/setuptools/discussions/2838 +from distutils import log # pylint: disable=[deprecated-module] +from di...
? ```suggestion f"-DUSE_IPEX={int(self.use_ipex)}", ```
intel-xpu-backend-for-triton
github_2023
python
2,415
intel
anmyachev
@@ -1,83 +1,135 @@ import os -import re import shutil import subprocess -import sysconfig import sys -from setuptools import setup +# TODO: update once there is replacement for clean: +# https://github.com/pypa/setuptools/discussions/2838 +from distutils import log # pylint: disable=[deprecated-module] +from di...
Should we use `log` instead of `print`?
intel-xpu-backend-for-triton
github_2023
python
2,415
intel
anmyachev
@@ -1,83 +1,135 @@ import os -import re import shutil import subprocess -import sysconfig import sys -from setuptools import setup +# TODO: update once there is replacement for clean: +# https://github.com/pypa/setuptools/discussions/2838
I read the discussion and it seems like it will never happen. Should we just switch to `pip install` command instead of `python setup.py install` here: https://github.com/intel/intel-xpu-backend-for-triton/blob/beffcd1982f6d957f89145432f6c58306ad37e16/.github/workflows/triton-benchmarks.yml#L107? The replacement ...
intel-xpu-backend-for-triton
github_2023
others
2,480
intel
FMarno
@@ -148,7 +148,6 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war scf.yield %98, %106, %110, %114, %118, %122, %126, %130, %321, %322, %323, %324, %325, %326, %327, %328, %329, %330, %331, %332, %333, %334, %335, %336 : tensor<8x16xf32>, tensor<8x16xf32>, tensor<8x16xf32>, tens...
Why is this change needed? I thought you were still applying fastmath?
intel-xpu-backend-for-triton
github_2023
cpp
2,480
intel
Dewei-Wang-sh
@@ -90,15 +90,6 @@ class ScheduleLoadPass op->moveAfter(def); } }); - - // HoHo, add fastmath for all - // may do this after llvm ir according to user fmath flag
can you keep my comments?
intel-xpu-backend-for-triton
github_2023
python
2,466
intel
alexbaden
@@ -140,12 +140,33 @@ def parse_target(self, tgt_prop) -> dict: dev_prop['max_num_sub_groups'] = tgt_prop.get('max_num_sub_groups', None) dev_prop['sub_group_sizes'] = tgt_prop.get('sub_group_sizes', None) dev_prop['has_fp64'] = tgt_prop.get('has_fp64', None) - dev_prop['has_subgroup_m...
Is there some way we could fall back to the `else` case if we got an exception here?
intel-xpu-backend-for-triton
github_2023
python
2,466
intel
etiotto
@@ -140,12 +140,30 @@ def parse_target(self, tgt_prop) -> dict: dev_prop['max_num_sub_groups'] = tgt_prop.get('max_num_sub_groups', None) dev_prop['sub_group_sizes'] = tgt_prop.get('sub_group_sizes', None) dev_prop['has_fp64'] = tgt_prop.get('has_fp64', None) - dev_prop['has_subgroup_m...
Add `TRITON_INTEL_QUERY_DEVICE_EXTENSIONS` to the GetEnv.hpp under `CACHE_NEUTRAL_ENV_VARS` ?
intel-xpu-backend-for-triton
github_2023
python
2,256
intel
etiotto
@@ -234,10 +234,11 @@ def benchmark(Z, H, N_CTX, D_HEAD, CAUSAL, provider): v = torch.randn((Z, H, N_CTX, D_HEAD), device='xpu', dtype=dtype) sm_scale = 0.125 quantiles = [0.5, 0.0, 1.0] + warmup, rep = 10, 600
From 10 to 600 times? Way too many repetitions. It is going to slow down the time it takes to run the benchmarks too much.
intel-xpu-backend-for-triton
github_2023
others
2,448
intel
whitneywhtsang
@@ -1,4 +1,5 @@ add_triton_library(TritonAnalysis + intel/TestAxisInfo.cpp
not needed?
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
whitneywhtsang
@@ -409,7 +409,12 @@ class DivOpAxisInfoVisitor final : public BinaryOpVisitorImpl<OpTy> { int64_t getConstancy(OpTy op, const AxisInfo &lhs, const AxisInfo &rhs, int dim) override { - auto resTy = dyn_cast<RankedTensorType>(op.getType()); + Type ptrTy = op.getType(); + auto resTy ...
can we have a utility to do this? something like `getTensorType`?
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
victor-eds
@@ -647,7 +661,11 @@ class CmpOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> { AxisInfo getAxisInfo(OpTy op, ArrayRef<const dataflow::Lattice<AxisInfo> *> operands) override { - auto resTy = dyn_cast<RankedTensorType>(op.getType()); + Type ty = op.getType(); + auto resTy = + ...
Can we have a helper function for this construct appearing several times in the code?
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
victor-eds
@@ -995,6 +1013,68 @@ class MaxMinOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> { } }; +class MakeTensorPtrOpAxisInfoVisitor final + : public AxisInfoVisitorImpl<triton::MakeTensorPtrOp> { +public: + using AxisInfoVisitorImpl<triton::MakeTensorPtrOp>::AxisInfoVisitorImpl; + + AxisInfo + getAxis...
I think: ```c++ isOne(x) == (x == 1); ``` See https://en.cppreference.com/w/cpp/utility/optional/operator_cmp (comparing optional with a value signatures)
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
victor-eds
@@ -995,6 +1013,68 @@ class MaxMinOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> { } }; +class MakeTensorPtrOpAxisInfoVisitor final + : public AxisInfoVisitorImpl<triton::MakeTensorPtrOp> { +public: + using AxisInfoVisitorImpl<triton::MakeTensorPtrOp>::AxisInfoVisitorImpl; + + AxisInfo + getAxis...
Does this work?
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
victor-eds
@@ -995,6 +1013,68 @@ class MaxMinOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> { } }; +class MakeTensorPtrOpAxisInfoVisitor final + : public AxisInfoVisitorImpl<triton::MakeTensorPtrOp> { +public: + using AxisInfoVisitorImpl<triton::MakeTensorPtrOp>::AxisInfoVisitorImpl; + + AxisInfo + getAxis...
I don't think this works as `shape`, `stride`, and `offsets` are variadic [see](https://triton-lang.org/main/dialects/TritonOps.html#tt-make-tensor-ptr-triton-maketensorptrop).
intel-xpu-backend-for-triton
github_2023
cpp
2,448
intel
victor-eds
@@ -995,6 +1001,55 @@ class MaxMinOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> { } }; +class MakeTensorPtrOpAxisInfoVisitor final + : public AxisInfoVisitorImpl<triton::MakeTensorPtrOp> { +public: + using AxisInfoVisitorImpl<triton::MakeTensorPtrOp>::AxisInfoVisitorImpl; + + AxisInfo + getAxis...
Can we exit early returning `{1, 1, 1, std::nullopt}` instead of asserting?
intel-xpu-backend-for-triton
github_2023
python
2,258
intel
alexbaden
@@ -434,6 +437,61 @@ def format_of(ty): """ return src +# TODO: Add it as part of debug/verbose macro +def kernel_meta_extractor(kmeta_str, args_dict): + num_ctas = re.search(r'num_ctas=(\d+)', kmeta_str).group(1) + num_stages = re.search(r'num_stages=(\d+)', kmeta_str).group(1) + kernel_name = re....
Why do we need to serialize the args dictionary object as a string and then use regex to parse?
intel-xpu-backend-for-triton
github_2023
cpp
2,258
intel
alexbaden
@@ -7,8 +7,152 @@ #include <iostream> #include <string> #include <vector> +#include <regex> +#include <algorithm> #include "sycl_functions.h" +#include "json.hpp"
Please work with @vlad-penkin to ensure this library has an acceptable license for us to use. Another option is simdjson, which is Apache 2 and can be automatically pulled in with cmake as opposed to vendoring: https://github.com/simdjson/simdjson/blob/master/doc/basics.md#using-simdjson-as-a-cmake-dependency
intel-xpu-backend-for-triton
github_2023
cpp
2,258
intel
alexbaden
@@ -7,8 +7,152 @@ #include <iostream> #include <string> #include <vector> +#include <regex> +#include <algorithm> #include "sycl_functions.h" +#include "json.hpp" + +using json = nlohmann::json; +using ordered_json = nlohmann::ordered_json; + +// Structure that contains Triton kernel arguments +struct argsDict { ...
I think we should just throw here, and we can catch all exceptions in `main`.
intel-xpu-backend-for-triton
github_2023
cpp
2,258
intel
alexbaden
@@ -7,8 +7,152 @@ #include <iostream> #include <string> #include <vector> +#include <regex> +#include <algorithm> #include "sycl_functions.h" +#include "json.hpp" + +using json = nlohmann::json; +using ordered_json = nlohmann::ordered_json; + +// Structure that contains Triton kernel arguments +struct argsDict {
suggest rename: `KernelArguments`