Logo
Explore Help
Sign In
gaspersic/triton
1
0
Fork 0
You've already forked triton
Code Issues Pull Requests Packages Projects Releases Wiki Activity
Files
keren/v100-perf-regression
triton/lib/Dialect/TritonGPU/IR/Traits.cpp

15 lines
420 B
C++
Raw Permalink Normal View History

[Triton-MLIR] Replace triton.extract_slice with tensor.extract_slice and support more general tensor slicing (#837) ## Features - Allow taking a block of tensor slice, as long as each dimension is contiguous (unit stride). - Fix some problems in `insert_slice_async`'s semantic. - More general verification for ops that return shared layout encoding. ## Known Limitations - `insert_slice_async` still uses the old semantic. May submit another PR later to support similar semantic like `tensor.extract_slice`. - No encoding verification for `tensor.extract_slice`. - 3d tensor ops are broken. - Strided accesses are not allowed. - May cause a little performance slowdown since we are passing strides as values but not constants (e.g., int). It would be difficult to pass strides as attributes when we have control flows. A block argument is possible to accept tensors with different strides.
2022-11-06 22:59:03 -08:00
#include "triton/Dialect/TritonGPU/IR/Traits.h"
#include "triton/Analysis/Utility.h"
mlir::LogicalResult
mlir::OpTrait::impl::verifyResultsAreSharedEncoding(Operation *op) {
if (failed(verifyAtLeastNResults(op, 1)))
return failure();
for (auto result : op->getResults())
if (!isSharedEncoding(result))
return op->emitOpError() << "requires all results to be shared encoding";
return success();
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.3 Page: 110ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API