Cambricon / triton-linalg

Development repository for the Triton-Linalg conversion
Apache License 2.0
120 stars 10 forks source link

[question] whats the different with `triton-linalg` and `triton-shared`? #8

Closed lordrebel closed 1 month ago

lordrebel commented 1 month ago

hi!
Im a newbee in triton community and try to found some infos for triton IR transforms to mlir built-in ir. I found two project about this work: triton-linalgandtriton-shared`, what's the difference?

thanks

sethbrin commented 1 month ago

Our differences from the Triton-Shared solution mainly consist of the following three points:

  1. The handling of pointers and tensors:
    • We expand the official AxisInfoAnalysis to analyze the continuity of pointers and then use the aux.view operator to bind pointer information. In contrast, Triton-Shared uses ptrAnalysis to track pointer offsets/sizes/strides.
    • For pointers, we do not change the function signatures; use tt.ptr is directly converted to llvm.ptr, while Triton-Shared solution converts it to an unranked memref.
  2. Lowering to linalg principles:
    • To facilitate DSA optimization, there are subtle differences in our principles for handling Linalg operators. We strive to use structured operators whenever possible and avoid using generic operators, preserving the coarse-grained semantics of the operators as much as possible.
  3. completeness:
    • We fully support all Triton official operators (except for inline_asm), including discrete memory access, libdevice, and atomic operations etc.
    • We still have some gaps in our end-to-end workflow, whereas Triton-Shared provides end-to-end examples on the CPU.
lordrebel commented 1 month ago

thanks for your response!