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 | 188 | intel | etiotto | @@ -0,0 +1,74 @@
+/*========================== begin_copyright_notice ============================
+
+Copyright (C) 2017-2021 Intel Corporation
+
+SPDX-License-Identifier: MIT
+
+============================= end_copyright_notice ===========================*/
+#pragma once
+
+#include "GenIntrinsicEnum.h"
+
+// #includ... | Remove all commented out code. |
intel-xpu-backend-for-triton | github_2023 | cpp | 180 | intel | etiotto | @@ -585,7 +585,9 @@ class ConvertTritonGPUOpToLLVMPatternBase {
auto warpsPerCTA = triton::gpu::getWarpsPerCTA(layout);
auto order = triton::gpu::getOrder(layout);
auto shapePerCTATile = triton::gpu::getShapePerCTATile(layout, shape);
- Value warpSize = i32_val(32); | I'd like to keep the code as close as possible to the upstream code to reduce merge conflicts. Can we do this change upstream ?
If we want to do this change downstream then we should split it into a different PR to (a) keep unrelated changes separate and (b) we can mark the PR as something we need to upstream. |
intel-xpu-backend-for-triton | github_2023 | cpp | 180 | intel | etiotto | @@ -857,7 +859,9 @@ class ConvertTritonGPUOpToLLVMPatternBase {
const BlockedEncodingAttr &blockedLayout, RankedTensorType type) const {
auto shape = type.getShape();
Value threadId = getThreadId(rewriter, loc);
- Value warpSize = i32_val(32); | Same comment as at line 588. |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -0,0 +1,34 @@
+# - Try to find SPIRV-LLVM-Translator
+#
+include(FetchContent)
+
+if (NOT SPIRVToLLVMTranslator_FOUND)
+
+ set(SPIRVToLLVMTranslator_SOURCE_DIR
+ "${CMAKE_CURRENT_BINARY_DIR}/SPIRVToLLVMTranslator")
+ message(STATUS "SPIR-LLVM location is not specified. Will try to download | nit: SPIR-LLVM -> SPIRV-LLVM |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -0,0 +1,34 @@
+# - Try to find SPIRV-LLVM-Translator
+#
+include(FetchContent)
+
+if (NOT SPIRVToLLVMTranslator_FOUND)
+
+ set(SPIRVToLLVMTranslator_SOURCE_DIR
+ "${CMAKE_CURRENT_BINARY_DIR}/SPIRVToLLVMTranslator")
+ message(STATUS "SPIR-LLVM location is not specified. Will try to download
+ ... | Remove commented out code. |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -0,0 +1,34 @@
+# - Try to find SPIRV-LLVM-Translator | This change isn't necessary to create a plugin. Can you split it into a different PR? |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -1,3 +1,6 @@
+# SPIRV-LLVM Translator is required. | Are any of these changes required to make the code a Triton plugin ? Let's have a minimal PR to do just that, and separate everything else into their own self contained pull requests please. |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | whitneywhtsang | @@ -6,6 +6,59 @@ if(POLICY CMP0116)
cmake_policy(SET CMP0116 OLD)
endif()
+# Use the PYTHON_THIRD_PARTY_PATH var to detect whehter XPU backend is built as a plug-in | ```suggestion
# Use the PYTHON_THIRD_PARTY_PATH var to detect whether XPU backend is built as a plug-in
``` |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | whitneywhtsang | @@ -160,15 +213,27 @@ set(GenISAIntrinsics_LIBRARY
)
message(STATUS "GenISAIntrinsics_LDFLAGS: ${GenISAIntrinsics_LDFLAGS}")
+MESSAGE(STATUS "johnlu cmake TRITON_BUILD_PYTHON_MODULE ${TRITON_BUILD_PYTHON_MODULE}") | ```suggestion
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 180 | intel | etiotto | @@ -71,6 +72,12 @@ void init_triton_translation(py::module &&m) {
auto shared = mod->getAttrOfType<mlir::IntegerAttr>("triton_gpu.shared");
return shared.getInt();
});
+ m.def("get_threads_per_warp", [](mlir::ModuleOp mod) { | This change isn't necessary to make the XPU BE work as a 3rd party BE, correct ? |
intel-xpu-backend-for-triton | github_2023 | python | 180 | intel | whitneywhtsang | @@ -276,7 +290,8 @@ def run(self):
def build_extension(self, ext):
lit_dir = shutil.which('lit')
- ninja_dir = shutil.which('ninja')
+ # ninja_dir = shutil.which('ninja')
+ ninja_dir = "/home/chengjun/clion-2023.1.3/bin/ninja/linux/x64/ninja" | ```suggestion
ninja_dir = shutil.which('ninja')
``` |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -0,0 +1,33 @@
+add_triton_plugin(TritonXPU ${CMAKE_CURRENT_SOURCE_DIR}/triton_xpu.cc) | Upstream they names the third_party vendor directories simply nvidia/amd:

We should name our directory simply 'intel' |
intel-xpu-backend-for-triton | github_2023 | cpp | 180 | intel | etiotto | @@ -60,11 +60,12 @@ void init_triton_xpu_passes_ttnvgpuir(py::module &&m) {
});
}
-void init_triton_xpu(py::module &&m){
+void init_triton_intel_xpu_backend(py::module &&m){
auto passes = m.def_submodule("passes");
init_triton_xpu_passes_ttgpuir(passes.def_submodule("ttgpuir"));
init_triton_xpu_passes_tt... | Remove dead code please |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -447,7 +447,7 @@ def make_ttgir(mod, metadata, opt, capability):
xpu.passes.ttnvgpuir.add_wsfixup_missing_attrs(pm)
passes.common.add_canonicalizer(pm)
pm.run(mod)
- metadata["cluster_dims"] = (cluster_info.clusterDimX, cluster_info.clusterDimY, cluster_info.clusterDimZ)
+ me... | why is this hardcoded ? |
intel-xpu-backend-for-triton | github_2023 | others | 180 | intel | etiotto | @@ -387,21 +394,14 @@ def make_ttir(mod, metadata, opt):
@staticmethod
def make_ttgir(mod, metadata, opt, capability):
- cluster_info = xpu.ClusterInfo() | Can you explain why we do not need this info ? |
intel-xpu-backend-for-triton | github_2023 | python | 1,802 | intel | pbchekin | @@ -24,7 +24,10 @@ def _path_to_binary(binary: str):
for p in paths:
bin = p.split(" ")[0]
if os.path.exists(bin) and os.path.isfile(bin):
- result = subprocess.check_output([bin, "--version"], stderr=subprocess.STDOUT)
+ try:
+ result = subprocess.check_outpu... | The best practice is to avoid catch-all `except`. Instead, it is better to catch `subprocess.SubprocessError` or use `subprocess.run`, which does not raise an exception when the process exists with non-zero exit code. |
intel-xpu-backend-for-triton | github_2023 | python | 1,802 | intel | pbchekin | @@ -24,7 +24,10 @@ def _path_to_binary(binary: str):
for p in paths:
bin = p.split(" ")[0]
if os.path.exists(bin) and os.path.isfile(bin):
- result = subprocess.check_output([bin, "--version"], stderr=subprocess.STDOUT)
+ try:
+ result = subprocess.check_outpu... | When exception occurs `result` is not defined in line `if result is not None`:
```
NameError: name 'result' is not defined
```
Also it would be nice to have a unit test for that code. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,241 | intel | whitneywhtsang | @@ -40,9 +40,17 @@ void TritonGENDialect::initialize() {
}
int triton::TritonGEN::getSubgroupSize(Operation *op) {
- spirv::TargetEnvAttr attr = spirv::lookupTargetEnv(op);
- assert(attr && "Expecting valid target env attribute");
- return attr.getResourceLimits().getSubgroupSize();
+ spirv::TargetEnvAttr spvEn... | llvm/llvm-project#90972 also uses `spirv.target_env`. In order to remove the fallback code, `spirv.target_env` needs to be added in Triton.
```suggestion
// FIXME: Remove the fallback code when `spirv.target_env` is added in Triton pipeline.
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,241 | intel | whitneywhtsang | @@ -76,9 +76,10 @@ template <typename Op> static LogicalResult verifyInput(Op op) {
//===----------------------------------------------------------------------===//
LogicalResult TritonGEN::SubGroupReduceOp::verify() {
- spirv::TargetEnvAttr attr = spirv::lookupTargetEnv(*this);
- if (!attr)
- return this->emi... | Change this FIXME as well |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,241 | intel | victor-eds | @@ -76,9 +76,10 @@ template <typename Op> static LogicalResult verifyInput(Op op) {
//===----------------------------------------------------------------------===//
LogicalResult TritonGEN::SubGroupReduceOp::verify() {
- spirv::TargetEnvAttr attr = spirv::lookupTargetEnv(*this);
- if (!attr)
- return this->emi... | I think we can just drop the check. In fact, I think the check shouldn't be present as we will only be introducing the SPIR-V attribute in a later pipeline stage (conversion to LLVM dialect). |
intel-xpu-backend-for-triton | github_2023 | others | 2,088 | intel | pbchekin | @@ -84,7 +84,7 @@ jobs:
if: ${{ env.TARGET_PRID == null }}
run: |
env
- ./scripts/check_update_tranlator_cid.sh $CID_LATEST $CID_CURRENT
+ ./scripts/check-update-tranlator-cid.sh $CID_LATEST $CID_CURRENT | ```suggestion
./scripts/check-update-translator-cid.sh $CID_LATEST $CID_CURRENT
```
Also please rename the script accordingly. |
intel-xpu-backend-for-triton | github_2023 | others | 2,088 | intel | pbchekin | @@ -27,11 +27,17 @@ FOUND=false
for cid in $COMMIT_IDS; do
echo "$cid" > ./lib/Target/SPIRV/spirv-llvm-translator.conf
if ! ./scripts/compile-triton.sh --clean; then
- echo "Compile failed for translator commit $cid"
+ echo "Triton compile failed for translator commit $cid"
continue
... | ```suggestion
echo "Download failed for translator commit $cid"
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,088 | intel | pbchekin | @@ -27,11 +27,17 @@ FOUND=false
for cid in $COMMIT_IDS; do
echo "$cid" > ./lib/Target/SPIRV/spirv-llvm-translator.conf
if ! ./scripts/compile-triton.sh --clean; then
- echo "Compile failed for translator commit $cid"
+ echo "Triton compile failed for translator commit $cid"
continue
- ... | You already have "Setup PyTorch" step in the workflow, you need to choose one place where you install it: in the workflow or in the script. |
intel-xpu-backend-for-triton | github_2023 | others | 2,088 | intel | pbchekin | @@ -55,6 +55,11 @@ jobs:
with:
repository: pytorch/pytorch
+ # TODO: remove this step once ipex is deprecated for benchdmark | ```suggestion
# TODO: remove this step once ipex is deprecated for benchmarks
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,118 | intel | pbchekin | @@ -122,7 +122,11 @@ if [ "$TRITON_TEST_REPORTS" == true ]; then
capture_runtime_env
fi
-$SKIP_DEPS || $SCRIPTS_DIR/compile-pytorch-ipex.sh --upstream-pytorch --pinned $([ $VENV = true ] && echo "--venv")
+if [ "$TEST_BENCHMARK_SOFTMAX" = true ] || [ "$TEST_BENCHMARK_GEMM" = true ] || [ "$TEST_BENCHMARK_ATTENTI... | I think that combination was deprecated recently and no longer supported: #2050. |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,043 | intel | etiotto | @@ -1027,6 +1066,43 @@ void MatchTargetSizePass::transformBroadcastOp(tt::BroadcastOp op) {
return;
}
+void MatchTargetSizePass::transformMakeRangeOp(tt::MakeRangeOp op) {
+ constexpr unsigned subgroupSize = 16;
+ unsigned start = op.getStart();
+ unsigned end = op.getEnd();
+ assert(start == 0 && end % subgr... | [nit]: use static types rather than auto. |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,043 | intel | Dewei-Wang-sh | @@ -1027,6 +1066,43 @@ void MatchTargetSizePass::transformBroadcastOp(tt::BroadcastOp op) {
return;
}
+void MatchTargetSizePass::transformMakeRangeOp(tt::MakeRangeOp op) {
+ constexpr unsigned subgroupSize = 16;
+ unsigned start = op.getStart();
+ unsigned end = op.getEnd();
+ assert(start == 0 && end % subgr... | heart! |
intel-xpu-backend-for-triton | github_2023 | others | 2,013 | intel | etiotto | @@ -184,3 +188,153 @@ module {
tt.return
}
}
+
+// -----
+
+// COM: FlashAttention with causal masking
+// COM: - two loops with workload=attention (=4) are detected
+// COM: - encodings are propagated to the operations that correspond to the causal mask computation
+
+// CHECK1: #triton_gpu.blocked<{sizePerTh... | Remove unnecessary attributes (like the `noinline` one). |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,013 | intel | etiotto | @@ -383,6 +385,51 @@ class ConvertTritonToTritonGPUWarp
}
return WalkResult::advance();
});
+
+ if (loops.size() == 2 && workloads.front() == Workload::Attention && | why the loop size has to be 2 ? |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,013 | intel | etiotto | @@ -383,6 +385,51 @@ class ConvertTritonToTritonGPUWarp
}
return WalkResult::advance();
});
+
+ if (loops.size() == 2 && workloads.front() == Workload::Attention &&
+ workloads.back() == Workload::Attention) {
+ // match attention with causal masking
+ Attribute bloc... | Add a msg to the assert stmt |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,013 | intel | etiotto | @@ -414,9 +461,12 @@ class ConvertTritonToTritonGPUWarp
result.setType(newType);
} else if (auto expand = dyn_cast<tt::ExpandDimsOp>(op)) {
auto src = expand.getSrc();
- auto attr = cast<ttg::SliceEncodingAttr>(src.getType().getEncoding());
- Type newType = addAttrToType(result.getType(), a... | Add a FIXME so it is easy to "grep" |
intel-xpu-backend-for-triton | github_2023 | others | 2,013 | intel | Dewei-Wang-sh | @@ -1,5 +1,9 @@
-// RUN: triton-opt %s -split-input-file --convert-triton-to-tritongpu-warp="num-warps=32" | FileCheck %s --check-prefix=CHECK
-// RUN: triton-opt %s -split-input-file --convert-triton-to-tritongpu-warp="num-warps=8" | FileCheck %s --check-prefix=CHECK1
+// RUN: triton-opt %s -split-input-file --conve... | not used before, amazing. |
intel-xpu-backend-for-triton | github_2023 | others | 2,013 | intel | Dewei-Wang-sh | @@ -184,3 +188,153 @@ module {
tt.return
}
}
+
+// -----
+
+// COM: FlashAttention with causal masking
+// COM: - two loops with workload=attention (=4) are detected
+// COM: - encodings are propagated to the operations that correspond to the causal mask computation
+
+// CHECK1: #triton_gpu.blocked<{sizePerTh... | we may change the magic number later. |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,013 | intel | Dewei-Wang-sh | @@ -383,6 +385,51 @@ class ConvertTritonToTritonGPUWarp
}
return WalkResult::advance();
});
+
+ if (loops.size() == 2 && workloads.front() == Workload::Attention &&
+ workloads.back() == Workload::Attention) {
+ // match attention with causal masking
+ Attribute bloc... | here just assume the type w/o encoding has blockLayout, right?
I have a local change that aims to cover the full propagation, making most of the case go to L405 early return. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | etiotto | @@ -657,6 +668,120 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | [nit]: After `return` the else if can be changed to `if` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | etiotto | @@ -657,6 +668,120 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | else if -> if |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | etiotto | @@ -657,6 +668,120 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | auto -> Operation * |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | etiotto | @@ -657,6 +668,120 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | You guys love to use auto everywhere. Suggest we use this code guildeline https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable which states:
```
Use auto if and only if it makes the code more readable or easier to maintain. Don’t “almost always” use auto,
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,969 | intel | etiotto | @@ -645,6 +645,110 @@ module {
}
}
+// CHECK: tt.func @matmul_kernel
+// CHECK-COUNT-4: tt.make_tensor_ptr
+module {
+ tt.func @matmul_kernel(%arg0: !tt.ptr<f16>, %arg1: !tt.ptr<f16> , %arg2: !tt.ptr<f16>, %arg3: i32, %arg4: i32, %arg5: i32, %arg6: i32, %arg7: i32, %arg8: i32) attributes {noinline = false}... | remove things like attribute noinline that aren't strictly required by the test please |
intel-xpu-backend-for-triton | github_2023 | others | 1,969 | intel | etiotto | @@ -645,6 +645,110 @@ module {
}
}
+// CHECK: tt.func @matmul_kernel
+// CHECK-COUNT-4: tt.make_tensor_ptr
+module {
+ tt.func @matmul_kernel(%arg0: !tt.ptr<f16>, %arg1: !tt.ptr<f16> , %arg2: !tt.ptr<f16>, %arg3: i32, %arg4: i32, %arg5: i32, %arg6: i32, %arg7: i32, %arg8: i32) attributes {noinline = false}... | Very large test, Reduce it so that it is as small as strictly required please. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | etiotto | @@ -657,6 +668,120 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | `else if` -> `if`
This pattern appears in several places so you can change them all. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | victor-eds | @@ -739,6 +862,41 @@ struct TritonRaiseBlockPointer
return failure();
}
+ // The axis to which the offset must be applied need to be known.
+ // However, in some cases, the pass fails to detect whether an offset should
+ // be applied to an axis other than the first. We, therefore, try to find
+ ... | ```suggestion
// if user code does not directly multiply the offset by the stride
// value identified by the pass, the analysis will fail.
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | victor-eds | @@ -739,6 +862,41 @@ struct TritonRaiseBlockPointer
return failure();
}
+ // The axis to which the offset must be applied need to be known.
+ // However, in some cases, the pass fails to detect whether an offset should
+ // be applied to an axis other than the first. We, therefore, try to find
+ ... | ```suggestion
// - in theory, this correction support should fail if the analysis
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,969 | intel | victor-eds | @@ -657,6 +668,118 @@ struct TritonRaiseBlockPointer
return success();
}
+ Value getFinalValue(Value value) {
+ auto defOp = value.getDefiningOp();
+ if (!defOp) {
+ // look init values outside the loop
+ BlockArgument blockArg = dyn_cast<BlockArgument>(value);
+ Operation *parentOp = bl... | Wouldn't `true` be safer here? |
intel-xpu-backend-for-triton | github_2023 | others | 2,090 | intel | YarShev | @@ -1,6 +1,3 @@
-# These tests should not be called for Intel. | Can we now run these tests for Intel GPU? |
intel-xpu-backend-for-triton | github_2023 | others | 2,083 | intel | anmyachev | @@ -81,7 +81,7 @@ jobs:
- name: Install Python build dependencies
run: |
- pip install wheel
+ pip install wheel cmake | Maybe pin the minimum supported version to preserve knowledge about non-working versions? |
intel-xpu-backend-for-triton | github_2023 | others | 2,076 | intel | pbchekin | @@ -80,7 +80,7 @@ runs:
shell: bash
run: |
cd python
- pip install wheel
+ pip install wheel pybind11 | Yep, this is the right place. Potentially we need to install it also in scripts/compile-triton.sh. |
intel-xpu-backend-for-triton | github_2023 | others | 1,918 | intel | etiotto | @@ -179,10 +179,77 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war
// CHECK: %[[VAL_52:.*]] = llvm.insertelement %[[VAL_42]], %[[VAL_51]]{{\[}}%[[VAL_48]] : i32] : vector<2xi32>
%ptrB = tt.make_tensor_ptr %arg1, [%arg4, %arg3], [%arg7, %c1_i64], [%c0_i32, %c0_i32]... | #mma -> #dpas |
intel-xpu-backend-for-triton | github_2023 | others | 1,918 | intel | etiotto | @@ -179,10 +179,77 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war
// CHECK: %[[VAL_52:.*]] = llvm.insertelement %[[VAL_42]], %[[VAL_51]]{{\[}}%[[VAL_48]] : i32] : vector<2xi32>
%ptrB = tt.make_tensor_ptr %arg1, [%arg4, %arg3], [%arg7, %c1_i64], [%c0_i32, %c0_i32]... | can you remove any unnecessary attributes here ? I don't think `triton_gpu.target` is required. Is `triton_gpu.num-ctas` required ? |
intel-xpu-backend-for-triton | github_2023 | others | 1,918 | intel | etiotto | @@ -179,10 +179,77 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war
// CHECK: %[[VAL_52:.*]] = llvm.insertelement %[[VAL_42]], %[[VAL_51]]{{\[}}%[[VAL_48]] : i32] : vector<2xi32>
%ptrB = tt.make_tensor_ptr %arg1, [%arg4, %arg3], [%arg7, %c1_i64], [%c0_i32, %c0_i32]... | is `tt.divisibility ` required? |
intel-xpu-backend-for-triton | github_2023 | others | 1,918 | intel | etiotto | @@ -179,10 +179,77 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war
// CHECK: %[[VAL_52:.*]] = llvm.insertelement %[[VAL_42]], %[[VAL_51]]{{\[}}%[[VAL_48]] : i32] : vector<2xi32>
%ptrB = tt.make_tensor_ptr %arg1, [%arg4, %arg3], [%arg7, %c1_i64], [%c0_i32, %c0_i32]... | Comment I left above applies here as well |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,27 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr) {
+ return failure();
+ }
+
+ // Only support rand 2 dot layout. Either row ... | What is "rand" ? |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,27 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr) {
+ return failure();
+ }
+
+ // Only support rand 2 dot layout. Either row ... | Infor -> Info |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,27 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr) {
+ return failure();
+ }
+
+ // Only support rand 2 dot layout. Either row ... | The code assumes that the layout is row major is the attribute value is not "column_major". We should probably add an assert to ensure that `memoryLayoutInfor.getValue()` is either "row_major" or "column_major". |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,27 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr) {
+ return failure();
+ }
+
+ // Only support rand 2 dot layout. Either row ... | should assert that `dotOrder[0] == 1 && dotOrder[1] == 0)` when the condition at line 385 is false. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -445,48 +466,65 @@ struct LoadOpConversion
offsetBaseY] =
getValuesFromBlockPointerStruct(adaptor.getPtr(), rewriter);
- // Load the operand.
- unsigned numRepOuter = numReps[opIdx];
- unsigned numRepK = numReps[!opIdx];
-
- unsigned tileHeight;
- unsigned vBlocks;
+ unsigned ... | Remove the else after a return. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -445,48 +466,65 @@ struct LoadOpConversion
offsetBaseY] =
getValuesFromBlockPointerStruct(adaptor.getPtr(), rewriter);
- // Load the operand.
- unsigned numRepOuter = numReps[opIdx];
- unsigned numRepK = numReps[!opIdx];
-
- unsigned tileHeight;
- unsigned vBlocks;
+ unsigned ... | [nit]: we -> We |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -517,61 +564,84 @@ struct LoadOpConversion
offsetY = add(offsetY, offsetBaseY);
baseWidth = trunc(i32_ty, baseWidth);
baseHeight = trunc(i32_ty, baseHeight);
- rowStride = trunc(i32_ty, rowStride);
+ Value pitch = trunc(i32_ty, rowStride);
+ Value elemSizeI... | why not check `memoryColumnMajor` here ? |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,25 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr)
+ return failure();
+
+ // Only support rank 2 dot layout, either row major or ... | `bool` -> `const bool` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,25 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr)
+ return failure();
+
+ // Only support rank 2 dot layout, either row major or ... | `bool` -> `const bool` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,918 | intel | etiotto | @@ -366,7 +366,25 @@ struct LoadOpConversion
if (!hasDotDpasEncoding(tensorType))
return failure();
+ Attribute blockIOAttr =
+ op->getAttr(TritonIntelGPUDialect::getBlockIOAttrName());
+ if (!blockIOAttr)
+ return failure();
+
+ // Only support rank 2 dot layout, either row major or ... | here too |
intel-xpu-backend-for-triton | github_2023 | others | 2,044 | intel | pbchekin | @@ -0,0 +1,95 @@
+name: Try against upstream PyTorch
+run-name: ${{ inputs.run_name }}
+
+on:
+ workflow_dispatch:
+ inputs:
+ runner_label:
+ description: Runner label, keep empty for default
+ type: string
+ default: ""
+ pytorch_ref:
+ description: PyTorch ref
+ type:... | I think it will be `null` if triggered by cron. You can use `github.event_name == 'schedule'` to check, for example
```
${{ github.event_name == 'schedule' && 'default_value' || inputs.some_input }}
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,044 | intel | pbchekin | @@ -0,0 +1,95 @@
+name: Try against upstream PyTorch | Can be shorter
```suggestion
name: Try latest PyTorch
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,989 | intel | jopperm | @@ -0,0 +1,116 @@
+#include "intel/include/Analysis/Liveness.h"
+#include "mlir/IR/Operation.h"
+
+using namespace mlir;
+
+namespace mlir::triton::gpu::intel {
+
+raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
+ OpPrintingFlags flags;
+ flags.skipRegions();
+
+ auto printOp = [&](Operation *op) ... | Does this do the right thing for operations actually containing multiple blocks, or would we need proper DFA here? The test pass only covers `scf.for` which has one region and block. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,989 | intel | whitneywhtsang | @@ -0,0 +1,116 @@
+#include "intel/include/Analysis/Liveness.h"
+#include "mlir/IR/Operation.h"
+
+using namespace mlir;
+
+namespace mlir::triton::gpu::intel {
+
+raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
+ OpPrintingFlags flags;
+ flags.skipRegions();
+
+ auto printOp = [&](Operation *op) ... | Maybe better to just print the instruction, as name doesn''t uniquely identify an operation. WDYT? |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,989 | intel | whitneywhtsang | @@ -0,0 +1,116 @@
+#include "intel/include/Analysis/Liveness.h"
+#include "mlir/IR/Operation.h"
+
+using namespace mlir;
+
+namespace mlir::triton::gpu::intel {
+
+raw_ostream &operator<<(raw_ostream &OS, const LiveInterval &LI) {
+ OpPrintingFlags flags;
+ flags.skipRegions();
+
+ auto printOp = [&](Operation *op) ... | should we use `llvm::max_element` here? |
intel-xpu-backend-for-triton | github_2023 | python | 2,049 | intel | anmyachev | @@ -6,7 +6,6 @@ def test_xpu_backend(cmdopt):
has_ipex = False
try:
# Import IPEX to provide Intel GPU runtime | ```suggestion
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,051 | intel | YarShev | @@ -300,3 +300,7 @@ test/unit/language/test_core.py::test_dot[1-64-128-128-4-True-True-none-tf32-int
test/unit/language/test_core.py::test_dot[1-64-128-128-4-True-True-none-tf32-int8-int8-1_1]
test/unit/language/test_core.py::test_dot[1-64-128-128-4-False-True-none-tf32-int8-int8-1_0]
test/unit/language/test_core.py... | Is this the right issue? The issue refers to AlbertForMaskedLM test. |
intel-xpu-backend-for-triton | github_2023 | others | 2,026 | intel | victor-eds | @@ -189,3 +189,60 @@ module attributes {"triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-war
tt.return
}
}
+
+// -----
+
+#blocked = #triton_gpu.blocked<{sizePerThread = [16, 64], threadsPerWarp = [1, 1], warpsPerCTA = [8, 1], order = [1, 0]}>
+module attributes {"triton_gpu.num-ctas" = 1 : i32, "trit... | ```suggestion
module attributes {"triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-warp" = 16 : i32} {
``` |
intel-xpu-backend-for-triton | github_2023 | cpp | 2,026 | intel | whitneywhtsang | @@ -197,6 +197,50 @@ void distributeGenericOp(Operation *op) {
op->erase();
}
+void distributeMakeRangeOp(tt::MakeRangeOp op, Value warpId) {
+ assert(op.getStart() == 0 && "Non-zero-based ranges NYI"); | what does NYI mean? not yet implemented? |
intel-xpu-backend-for-triton | github_2023 | others | 2,050 | intel | anmyachev | @@ -219,8 +220,8 @@ if [ "$BUILD_FROM_SOURCE" = false ]; then
echo "**** Setup no-op IPEX ****"
python $SCRIPTS_DIR/create-noop-ipex.py
else | And remove this `else` clause? |
intel-xpu-backend-for-triton | github_2023 | others | 2,050 | intel | anmyachev | @@ -200,14 +200,15 @@ if [ "$BUILD_FROM_SOURCE" = false ]; then
fi
if [ "$BUILD_FROM_SOURCE" = false ]; then
+ if [ "$UPSTREAM_PYTORCH" = false ]; then | ```suggestion
if [ "$UPSTREAM_PYTORCH" = false ] || [ "$NO_OP_IPEX" = false ]; then
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,946 | intel | whitneywhtsang | @@ -0,0 +1,64 @@
+// RUN: env TRITON_INTEL_ADVANCED_PATH=1 \
+// RUN: triton-opt %s -split-input-file --convert-triton-intel-gpu-to-llvm | FileCheck %s
+
+module attributes {"triton_intel_gpu.support_sg_2d_block", "triton_intel_gpu.support_dpas", "triton_gpu.num-warps" = 4 : i32} {
+// CHECK-LABEL: llvm.func spir_ker... | does that mean when size is 1, 2, or 4, the code after LLVM opt are the same before and after this change? |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,946 | intel | Dewei-Wang-sh | @@ -388,43 +390,43 @@ class GlueOpConversion : public ConvertTritonGPUOpToLLVMPattern<GlueOp> {
SmallVector<Value> operands = adaptor.getOperands();
auto dstType =
cast<VectorType>(getTypeConverter()->convertType(op.getType()));
- unsigned numElts = dstType.getNumElements();
- SmallVector<int32... | each element needs a extract and insert.
this would be too much for common cases even if the later llvm passes can optimize it away.
cause we still need to check the llvm directly got from our side from time to time. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,946 | intel | etiotto | @@ -374,58 +376,82 @@ class DotOpConversion : public ConvertTritonGPUOpToLLVMPattern<DotOp> {
}
};
-/// %glue = ttgi.glue %a, %b : tensor<4xf16>, tensor<4xf16> : tensor<8xf16>
-/// is converted to:
-/// %glue = llvm.shufflevector %a, %b : [0, 1, 2, 3, 4, 5, 6, 7] : vector<8xf16>
class GlueOpConversion : public C... | [nit]: P -> pair to be consistent with line 428. |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,946 | intel | etiotto | @@ -374,58 +376,82 @@ class DotOpConversion : public ConvertTritonGPUOpToLLVMPattern<DotOp> {
}
};
-/// %glue = ttgi.glue %a, %b : tensor<4xf16>, tensor<4xf16> : tensor<8xf16>
-/// is converted to:
-/// %glue = llvm.shufflevector %a, %b : [0, 1, 2, 3, 4, 5, 6, 7] : vector<8xf16>
class GlueOpConversion : public C... | There are macros to create a ConstantOp which you might want to use (e.g. i32_val(...)). |
intel-xpu-backend-for-triton | github_2023 | cpp | 1,946 | intel | etiotto | @@ -374,58 +376,82 @@ class DotOpConversion : public ConvertTritonGPUOpToLLVMPattern<DotOp> {
}
};
-/// %glue = ttgi.glue %a, %b : tensor<4xf16>, tensor<4xf16> : tensor<8xf16>
-/// is converted to:
-/// %glue = llvm.shufflevector %a, %b : [0, 1, 2, 3, 4, 5, 6, 7] : vector<8xf16>
class GlueOpConversion : public C... | Can use macro `insert_element` |
intel-xpu-backend-for-triton | github_2023 | others | 1,946 | intel | whitneywhtsang | @@ -0,0 +1,37 @@
+// RUN: env TRITON_INTEL_ADVANCED_PATH=1 \
+// RUN: triton-opt %s -split-input-file --convert-triton-intel-gpu-to-llvm | FileCheck %s
+
+module attributes {"triton_intel_gpu.support_sg_2d_block", "triton_intel_gpu.support_dpas", "triton_gpu.num-warps" = 4 : i32} {
+// CHECK-LABEL: llvm.func spir_ker... | Why is this not just `llvm.shufflevector %arg0, %arg1 [0, 1, 2, 3, 4, 5, 6, 7]`? |
intel-xpu-backend-for-triton | github_2023 | python | 2,029 | intel | pbchekin | @@ -65,13 +64,41 @@ def find_sycl(include_dir: list[str]) -> tuple[list[str], list[str]]:
return include_dir, library_dir
-include_dir, library_dir = find_sycl(include_dir)
+class CompilationHelper:
+ library_dir: list[str]
+ include_dir: list[str] | ```suggestion
_library_dir: list[str]
_include_dir: list[str]
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,002 | intel | anmyachev | @@ -128,7 +128,7 @@ jobs:
with:
driver_version: ${{ matrix.driver }}
runner_label: ${{ inputs.runner_label }}
- install_ipex: ${{ inputs.install_ipex || github.event_name == 'pull_request' || github.event_name == 'push' }}
+ install_ipex: ${{ inputs.install_ipex || false }} | ```suggestion
install_ipex: ${{ inputs.install_ipex }}
``` |
intel-xpu-backend-for-triton | github_2023 | others | 2,025 | intel | whitneywhtsang | @@ -143,6 +143,22 @@ def TritonGEN_SubgroupIdOp : TritonGEN_Op<"subgroup.id", [Pure]> {
}];
}
+//===----------------------------------------------------------------------===//
+// Subgroup local index
+//===----------------------------------------------------------------------===//
+
+def TritonGEN_SubgroupLocalI... | ```suggestion
The `triton_gen.subgroup.local.id` operation returns the local invocation ID of the
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | anmyachev | @@ -171,6 +171,15 @@ if [ "$BUILD_PINNED" = false ]; then
fi
if [ "$BUILD_FROM_SOURCE" = false ]; then
+ # FIXME https://github.com/intel/intel-xpu-backend-for-triton/issues/1894
+ if [ "$UPSTREAM_PYTORCH" = true || "$NO_OP_IPEX" = true ]; then
+ echo "**** Installing upstream PyTorch and noop IPEX from the ni... | As far as I understand, it is implicitly assumed that the already assembled wheels are just for the pinned versions (just not for the upstream ones)
```suggestion
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | anmyachev | @@ -173,16 +184,28 @@ if [ "$BUILD_PINNED" = false ]; then
fi
if [ "$BUILD_FROM_SOURCE" = false ]; then
- echo "**** Install PyTorch and IPEX from nightly builds. ****"
+ echo "**** Download nightly builds. ****"
PYTHON_VERSION=$( python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}... | Is this the only difference between upstream and proxy pytorch wheels? |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | pbchekin | @@ -144,13 +144,24 @@ if [ "$BUILD_PINNED" = true ]; then
BUILD_IPEX=true
if pip show intel_extension_for_pytorch &>/dev/null; then
IPEX_CURRENT_COMMIT=`python -c "import torch;import intel_extension_for_pytorch as ipex;print(ipex.__version__)"`
- IPEX_CURRENT_COMMIT=${IPEX_CURRENT_COMMIT#*"git"}
- if ... | This does not work:
```
# prints nothing
IPEX_CURRENT_COMMIT="2.4.0+noop"
[[ "noop" = "$IPEX_CURRENT_COMMIT"* ]] && echo noop
```
This should work:
```
IPEX_CURRENT_COMMIT="2.4.0+noop"
[[ $IPEX_CURRENT_COMMIT = *noop ]] && echo noop
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | pbchekin | @@ -144,13 +144,24 @@ if [ "$BUILD_PINNED" = true ]; then
BUILD_IPEX=true
if pip show intel_extension_for_pytorch &>/dev/null; then
IPEX_CURRENT_COMMIT=`python -c "import torch;import intel_extension_for_pytorch as ipex;print(ipex.__version__)"`
- IPEX_CURRENT_COMMIT=${IPEX_CURRENT_COMMIT#*"git"}
- if ... | If you use double square brackets, then quotes are not needed:
```suggestion
if [[ $IPEX_PINNED_COMMIT = $IPEX_CURRENT_COMMIT* ]]; then
``` |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | pbchekin | @@ -173,16 +184,28 @@ if [ "$BUILD_PINNED" = false ]; then
fi
if [ "$BUILD_FROM_SOURCE" = false ]; then
- echo "**** Install PyTorch and IPEX from nightly builds. ****"
+ echo "**** Download nightly builds. ****"
PYTHON_VERSION=$( python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}... | Just to be on the safe side:
```suggestion
--pattern "$WHEEL_PATTERN" \
```
We don't want bash to interpolate WHEEL_PATTERN if there is a file or directory with the name that matches . |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | pbchekin | @@ -144,13 +144,24 @@ if [ "$BUILD_PINNED" = true ]; then
BUILD_IPEX=true
if pip show intel_extension_for_pytorch &>/dev/null; then
IPEX_CURRENT_COMMIT=`python -c "import torch;import intel_extension_for_pytorch as ipex;print(ipex.__version__)"`
- IPEX_CURRENT_COMMIT=${IPEX_CURRENT_COMMIT#*"git"}
- if ... | `IPEX_PINNED_COMMIT` is a full commit id, `IPEX_CURRENT_COMMIT` is a short commit id?
If this is the case then `[[ $IPEX_PINNED_COMMIT = $IPEX_CURRENT_COMMIT* ]]` won't work. |
intel-xpu-backend-for-triton | github_2023 | others | 1,950 | intel | anmyachev | @@ -122,7 +122,7 @@ if [ "$TRITON_TEST_REPORTS" == true ]; then
capture_runtime_env
fi
-$SKIP_DEPS || $SCRIPTS_DIR/compile-pytorch-ipex.sh --pinned $ARGS | @Retribution98 I believe we can remove `ARGS` from this script at all. |
intel-xpu-backend-for-triton | github_2023 | others | 2,022 | intel | anmyachev | @@ -68,6 +68,16 @@ if [ "$BUILD_PYTORCH" = true ] && [ "$UPSTREAM_PYTORCH" = true ]; then
exit 1
fi
+if [ "$BUILD_PYTORCH" = false ] && [ "$UPSTREAM_PYTORCH" = false ]; then
+ echo "***** Use upstream pytorch by the default *****"
+ UPSTREAM_PYTORCH=true
+fi
+
+if [ "$BUILD_PINNED" = false ] && [ "$BUILD_FROM_S... | Maybe to move to 95 line in order to not mix filtering bad cases with setting default values? |
intel-xpu-backend-for-triton | github_2023 | python | 2,019 | intel | anmyachev | @@ -68,10 +69,11 @@ def parse_report(report_path: pathlib.Path) -> ReportStats:
for _ in testsuite.iter('error'):
stats.failed += 1
try:
- with open(f"{report_path.parent}/{report_path.stem}-warnings.json") as testsuite_warnings_file:
+ warnings_file_name = f'{report... | doesn't pylint have an option to preserve "" instead of ''? |
intel-xpu-backend-for-triton | github_2023 | others | 2,015 | intel | pbchekin | @@ -239,6 +239,12 @@ build_pytorch() {
fi
fi
echo "****** Building $PYTORCH_PROJ ******"
+
+ if [ ! -v USE_XPU ]; then
+ echo "**** USE_XPU is not given *****"
+ export USE_XPU=1
+ echo "**** Default USE_XPU is set to $USE_XPU ****"
+ fi | Why not just
```suggestion
export USE_XPU=1
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | vlad-penkin | @@ -6,21 +6,30 @@
from triton.runtime.cache import get_cache_manager
from triton.backends.compiler import GPUTarget
from triton.backends.driver import DriverBase
+import pkg_resources
ze_root = os.getenv("ZE_PATH", default="/usr/local")
include_dir = [os.path.join(ze_root, "include")]
+library_dir = []
oneapi... | Please add sycl runtime version check `>= 2025.0.0` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -53,8 +53,9 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cxx = os.environ.get("CXX")
if cxx is None:
clangpp = shutil.which("clang++")
+ gxx = shutil.which("g++")
icpx = shutil.which("icpx")
- cxx = icpx if icpx is not None... | What about
```suggestion
cxx = icpx or clangpp or gxx
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -63,13 +64,19 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cc_cmd = [cxx]
if icpx is not None:
cc_cmd += ["-fsycl"]
+ else:
+ cc_cmd += ["--std=gnu++17"]
else:
cc_cmd = [cc, "-O3"]
cc_cmd += [src, "-shared", "-fPIC", "-... | What about `TRITON_XPU_VERBOSE` instead of `VERBOSE`?
Also
```suggestion
if os.getenv('VERBOSE'):
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -6,21 +6,30 @@
from triton.runtime.cache import get_cache_manager
from triton.backends.compiler import GPUTarget
from triton.backends.driver import DriverBase
+import pkg_resources | `pkg_resources` requires `setuptools` in runtime and this package is currently not in Triton dependencies (it is listed only as a build dependency). From the context I think it is possible to use a built-in `importlib.util` instead of `pkg_resources`. |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | etiotto | @@ -63,13 +64,19 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cc_cmd = [cxx]
if icpx is not None:
cc_cmd += ["-fsycl"]
+ else:
+ cc_cmd += ["--std=gnu++17"] | Do we really need `--std=gnu++17` or is `--std=c++17` sufficient ?
|
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -71,6 +74,10 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cc_cmd += [f'-l{lib}' for lib in libraries]
cc_cmd += [f"-L{dir}" for dir in library_dirs]
cc_cmd += [f"-I{dir}" for dir in include_dirs if dir is not None]
+
+ if os.getenv('VERBOSE'): | Nit: keep the quotes consistent with the rest of the file. UPD: looks like this file had mixed quotes already, but mostly double quotes.
```suggestion
if os.getenv("VERBOSE"):
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -10,17 +12,61 @@
ze_root = os.getenv("ZE_PATH", default="/usr/local")
include_dir = [os.path.join(ze_root, "include")]
-oneapi_root = os.getenv("ONEAPI_ROOT")
-if oneapi_root:
- include_dir += [
- os.path.join(oneapi_root, "compiler/latest/include"),
- os.path.join(oneapi_root, "compiler/latest/... | Nit:
```suggestion
sycl_rt = importlib.metadata.metadata("intel-sycl-rt")
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -10,17 +12,61 @@
ze_root = os.getenv("ZE_PATH", default="/usr/local")
include_dir = [os.path.join(ze_root, "include")]
-oneapi_root = os.getenv("ONEAPI_ROOT")
-if oneapi_root:
- include_dir += [
- os.path.join(oneapi_root, "compiler/latest/include"),
- os.path.join(oneapi_root, "compiler/latest/... | Method `locate()` returns the absolute path, no need to call `abspath()`
```suggestion
include_dir += [f.locate().parent.parent.as_posix()]
``` |
intel-xpu-backend-for-triton | github_2023 | python | 1,857 | intel | pbchekin | @@ -10,17 +12,61 @@
ze_root = os.getenv("ZE_PATH", default="/usr/local")
include_dir = [os.path.join(ze_root, "include")]
-oneapi_root = os.getenv("ONEAPI_ROOT")
-if oneapi_root:
- include_dir += [
- os.path.join(oneapi_root, "compiler/latest/include"),
- os.path.join(oneapi_root, "compiler/latest/... | Nit:
```suggestion
if f.name == "sycl.hpp":
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.