@@ -56,8 +56,6 @@ LinearLayout identityND(StringAttr inDimName, ArrayRef<unsigned> shape,
5656 LinearLayout ret = LinearLayout::empty ();
5757 for (int i = 0 ; i < shape.size (); i++) {
5858 // Start with the most-minor dimension, which is order[0].
59- // std::cout << "i: " << i << " shape[i]: " << shape[i]
60- // << " order[i]: " << order[i] << std::endl;
6159 int dim = order[i];
6260 ret *= LinearLayout::identity1D (shape[dim], inDimName, outDimNames[dim]);
6361 }
@@ -291,16 +289,6 @@ LinearLayout ensureLayoutNotSmallerThan(
291289 assert (actualSize > desiredSize ||
292290 desiredSize % actualSize == 0 && " bad shape" );
293291 ret *= LinearLayout::identity1D (desiredSize / actualSize, kDim , outDimName);
294- // std::cout << "actualSize: " << actualSize << " desiredSize: " <<
295- // desiredSize
296- // << std::endl;
297- // std::cout << "outDimName: " << outDimName.str() << std::endl;
298- // std::cout << "identity1D: "
299- // << LinearLayout::identity1D(desiredSize / actualSize, kDim,
300- // outDimName)
301- // .toString()
302- // << std::endl;
303- // std::cout << "ret: " << ret.toString() << std::endl;
304292 assert (ret.getOutDimSize (outDimName) >= desiredSize && " bad grow" );
305293 }
306294 return ret;
@@ -324,12 +312,6 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
324312
325313 SmallVector<StringAttr> outDimNames = standardOutDimNames (ctx, rank);
326314
327- std::cout << " shape: " ;
328- for (auto s : shape) {
329- std::cout << s << " , " ;
330- }
331- std::cout << std::endl;
332-
333315 llvm::SmallDenseMap<StringAttr, int64_t > labeledShape;
334316 for (auto [dim, size] : llvm::zip (outDimNames, shape)) {
335317 labeledShape[dim] = size;
@@ -338,7 +320,6 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
338320 LinearLayout cgaLayout =
339321 ensureLayoutNotLargerThan (makeCgaLayout (cgaLayoutAttr), labeledShape)
340322 .transposeOuts (llvm::to_vector (ctaLayout.getOutDimNames ()));
341- // std::cout << "\ncgaLayout: " << cgaLayout.toString() << std::endl;
342323
343324 // Calculate the shape of the ctaLayout, which is `shape` divided by the
344325 // cgaLayout's size.
@@ -347,32 +328,19 @@ LinearLayout combineCtaCgaWithShape(LinearLayout ctaLayout,
347328 llvm::to_vector (cgaLayout.getOutDimNames ()) &&
348329 " bad layout" );
349330
350- // std::cout << "ctaShape: ";
351331 for (auto dim : ctaLayout.getOutDimNames ()) {
352332 ctaShape[dim] =
353333 std::max (int64_t {1 }, labeledShape[dim] / cgaLayout.getOutDimSize (dim));
354- // std::cout << ctaShape[dim] << ", ";
355334 }
356- // std::cout << std::endl;
357335
358- std::cout << " ensureLayoutNotSmallerThan start" << std::endl;
359336 ctaLayout = ensureLayoutNotSmallerThan (ctaLayout, ctaShape);
360- // std::cout << "\nctaLayout not smaller than: " << ctaLayout.toString()
361- // << std::endl;
362- std::cout << " ensureLayoutNotLargerThan start" << std::endl;
363337 ctaLayout = ensureLayoutNotLargerThan (ctaLayout, ctaShape);
364- // std::cout << "\nctaLayout not larger than: " << ctaLayout.toString()
365- // << std::endl;
366338
367- // std::cout << "\ncta * cga: " << (ctaLayout * cgaLayout).toString()
368- // << std::endl;
369339 LinearLayout ret =
370340 (std::move (ctaLayout) * std::move (cgaLayout)).transposeOuts (outDimNames);
371341 for (auto dim : ret.getOutDimNames ()) {
372342 assert (ret.getOutDimSize (dim) == labeledShape[dim] && " bad shape" );
373343 }
374- // std::cout << "\ncombineCtaCgaWithShape: " << ret.toString() << std::endl;
375- std::cout << " combineCtaCgaWithShape end" << std::endl;
376344 return ret;
377345}
378346
@@ -569,7 +537,6 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
569537 LinearLayout::identity1D (warpsPerCTA[0 ], kWarp , outDimNames[0 ]);
570538
571539 } else if (opIdx == 1 ) { // Operand B
572- std::cout << " \n Operand B" << std::endl;
573540 auto regBasesB = DPASRegBasesB (opsPerChannel, executionSize, threadsPerWarp,
574541 systolicDepth);
575542 auto laneBasesB =
@@ -591,32 +558,20 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
591558 tileLayout *=
592559 LinearLayout::identity1D (warpsPerCTA[0 ], kWarp , outDimNames[0 ]);
593560 } else { // opIdx=2 -> Operand C
594- std::cout << " \n Operand C" << std::endl;
595561 auto regBasesC = DPASRegBasesC (repeatCount, executionSize, threadsPerWarp);
596562 auto laneBasesC =
597563 DPASLaneBasesC (repeatCount, executionSize, threadsPerWarp);
598564 tileLayout = LinearLayout ({{kRegister , regBasesC}, {kLane , laneBasesC}},
599565 ArrayRef (outDimNames).take_back (2 ));
600- // std::cout << tileLayout.toString() << std::endl;
601566 // The per-inst layout is repeated at each repCluster.
602567 // Hence, multiply with the identity layouts starting from the
603568 // least significant dimension.
604569 dimNonK = rank - 2 ;
605570 dimK = rank - 1 ;
606571 tileLayout *= LinearLayout::identity1D (repCluster[dimK], kRegister ,
607572 outDimNames[dimK]);
608- // std::cout << (LinearLayout::identity1D(repCluster[dimK], kRegister,
609- // outDimNames[dimK])
610- // .toString())
611- // << std::endl;
612- // std::cout << (tileLayout.toString()) << std::endl;
613573 tileLayout *= LinearLayout::identity1D (repCluster[dimNonK], kRegister ,
614574 outDimNames[dimNonK]);
615- // std::cout << (LinearLayout::identity1D(repCluster[dimNonK], kRegister,
616- // outDimNames[dimNonK])
617- // .toString())
618- // << std::endl;
619- // std::cout << (tileLayout.toString()) << std::endl;
620575
621576 // // The identical layout is repeated among warps
622577 tileLayout *=
@@ -626,7 +581,6 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
626581 if (rank == 3 )
627582 tileLayout *=
628583 LinearLayout::identity1D (warpsPerCTA[0 ], kWarp , outDimNames[0 ]);
629- // std::cout << (tileLayout.toString()) << std::endl;
630584 }
631585
632586 // Lastly, the layout repeats to match the shape.
@@ -651,9 +605,6 @@ LinearLayout DPAStoLinearLayout(ArrayRef<int64_t> shape, Attribute layout,
651605 if (rank == 3 )
652606 tileLayout *=
653607 LinearLayout::identity1D (numReps[0 ], kRegister , outDimNames[0 ]);
654- // std::cout << "\ntileLayout with DPASRepetition: " <<
655- // (tileLayout.toString())
656- // << std::endl;
657608
658609 return combineCtaCgaWithShape (std::move (tileLayout),
659610 CTALayoutAttr::getDefault (ctx, rank), shape);
0 commit comments