cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[QST] Row major for int8 matrix multiplications?

Open hychiang-git opened this issue 1 year ago • 2 comments

What is your question? As I read the document and the examples, the configurations I found for int8 x int8=int8 matrix multiplication is either RowMajor x ColumnMajor = ColumnMajor (gemm_s8t_s8n_s8n) or RowMajor x ColumnMajor = RowMajor (gemm_s8t_s8n_s8t).

Is there any work around for the use case for RowMajor x RowMajor= RowMajor? Suppose I have matrices shapes: [M K] x [K N] = [M N] and I hope not to perform transpose that involves memory copy.

  using ElementInputA = int8_t; // <- data type of elements in matrix A
  using ElementInputB = int8_t; // <- data type of elements in matrix B
  using ElementAccumulator = int32_t;
  using ElementOutput = int8_t;

  using LayoutInputA = cutlass::layout::RowMajor; //  A [M K]
  using LayoutInputB = cutlass::layout::RowMajor; //  B [K N]
  using LayoutOutput = cutlass::layout::RowMajor; // C [M N]

hychiang-git avatar May 10 '24 19:05 hychiang-git

It's possible to do Row x Row - but not as performant, since we need to transpose in the fly. @hwu36

IonThruster avatar May 14 '24 15:05 IonThruster

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Jun 13 '24 16:06 github-actions[bot]