shtinsa commented on PR #11341:
URL: https://github.com/apache/tvm/pull/11341#issuecomment-1131277017

   > 
   The reason of this implementation is based on DLRM model performance 
measurements where the concatenation layer takes about 20-25% of time budget. 
The problem is connected with 27 concatenating objects. The bottleneck is 
related to source tensor search and current TE implementation requires O(N) 
operations to define source for copying. The resulting TIR source search script 
has following form (this is and internal part of the loop):   
   @tir.if_then_else((((((((((((((((((((((((((((ax1: int32 - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0: int32, ((((((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else(((((((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
(((((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64)], @tir.if_then_else((((((((((((((((((((((((((ax1 - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) 
 - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
((((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64)], @tir.if_then_else(((((((((((((((((((((((((ax1 - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
(((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64)], @tir.if_then_else((((((((((((((((((((((((ax1 - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else((((((((((((((((
 (((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, (((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64)], @tir.if_then_else((((((((((((((((((((((ax1 - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) >= 0), placeholder[ax0, ((((((((((((((((((((ax1 - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64)], @tir.if_then_else(((((((((((((((((((((ax1 - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, (((((((((((((((((((ax1 - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64)], @tir.if_then_else((((((((((((((
 ((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else(((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, (((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else((((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, ((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else(((((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, (((
 ((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64)], @tir.if_then_else((((((((((((((((ax1 - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, ((((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64)], @tir.if_then_else(((((((((((((((ax1 - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 
0), placeholder[ax0, (((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64) - 64) - 64) - 64)], @tir.if_then_else((((((((((((((ax1 - 64) 
- 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, ((((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64)], @tir.if_then_else(((((((((((((ax1 - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, 
(((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 6
 4) - 64) - 64) - 64)], @tir.if_then_else((((((((((((ax1 - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, ((((((((((ax1 - 
64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else(((((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) >= 0), placeholder[ax0, (((((((((ax1 - 64) - 64) - 64) - 64) - 64) - 64) 
- 64) - 64) - 64)], @tir.if_then_else((((((((((ax1 - 64) - 64) - 64) - 64) - 
64) - 64) - 64) - 64) >= 0), placeholder[ax0, ((((((((ax1 - 64) - 64) - 64) - 
64) - 64) - 64) - 64) - 64)], @tir.if_then_else(((((((((ax1 - 64) - 64) - 64) - 
64) - 64) - 64) - 64) >= 0), placeholder[ax0, (((((((ax1 - 64) - 64) - 64) - 
64) - 64) - 64) - 64)], @tir.if_then_else((((((((ax1 - 64) - 64) - 64) - 64) - 
64) - 64) >= 0), placeholder[ax0, ((((((ax1 - 64) - 64) - 64) - 64) - 64) - 
64)], @tir.if_then_else(((((((ax1 - 64) - 64) - 64) - 64) - 64) >= 0), 
placeholder[ax0, (((((ax1 - 64) - 64) - 64) - 64) - 64)], 
@tir.if_then_else((((((ax1
  - 64) - 64) - 64) - 64) >= 0), placeholder[ax0, ((((ax1 - 64) - 64) - 64) - 
64)], @tir.if_then_else(((((ax1 - 64) - 64) - 64) >= 0), placeholder[ax0, 
(((ax1 - 64) - 64) - 64)], @tir.if_then_else((((ax1 - 64) - 64) >= 0), 
placeholder[ax0, ((ax1 - 64) - 64)], @tir.if_then_else(((ax1 - 64) >= 0), 
placeholder[ax0, (ax1 - 64)], placeholder[ax0, ax1], dtype=float32), 
dtype=float32), dtype=float32), dtype=float32), dtype=float32), dtype=float32), 
dtype=float32), dtype=float32), dtype=float32), dtype=float32), dtype=float32), 
dtype=float32), dtype=float32), dtype=float32), dtype=float32), dtype=float32), 
dtype=float32), dtype=float32), dtype=float32), dtype=float32), dtype=float32), 
dtype=float32), dtype=float32), dtype=float32), dtype=float32), dtype=float32)  
   
   The comparison of DLRM concatenation performance timings can be found in the 
sheet "some details" in the following document: 
https://docs.google.com/spreadsheets/d/1lYob-9J3-EUqFnaC3551zP56TAiQ7iyhzDwXvLyZh90/edit?usp=sharing


-- 
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