cbalint13 commented on code in PR #13642:
URL: https://github.com/apache/tvm/pull/13642#discussion_r1058190629


##########
python/tvm/topi/x86/tensor_intrin.py:
##########
@@ -348,3 +348,227 @@ def _instr(index):
         binds={data: a_buffer, kernel: b_buffer},
         default_buffer_params=buffer_params,
     )
+
+
+def dot_32x128x32_u8s8s32_sapphirerapids(LDA):
+    """
+    Int8 dot product by every 16x64 elements using AMX-TMUL Sapphire Rapids 
instructions.
+    The tdpxxd instruction takes two tile of uint8 and int8 datatype -- 
data[16][64] and
+    kernel[1][16][16][4] -- and computes a dot product of data[16][16] in 
int32 datatype.
+
+    (Physically, to efficiently leveraging the tile register, we constructing 
a 2x2 tiles
+    matmul which performs 32x128x32 in total)
+
+    The pseudo code is as follows:
+        for(k=0; k<2; k++){
+            for(n=0; n<2; n++){
+                tileload64(tmm_b, B)
+                for(m=0; m<2; m++){
+                    if(n==0)
+                        tileload64(tmm_a, A)

Review Comment:
   @masahi ,
   
   I have a question related to your proposed here:
   
   * Is there a TIR ```*_desc()``` equivalent for ```TOPI``` body, reset, 
update ?
        topi intrin decl:  
https://github.com/apache/tvm/blob/main/python/tvm/topi/x86/tensor_intrin.py#L140
   * How (TIR)  ```accum``` steps (very inner) can be succeeded by ```update``` 
(outer) or preceded by ```reset``` ?
   
   I am looking for any TVM reference (code, example) for this, trying even 
finer granularity control of autotensorization with TIR.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to