From 951757dffeea4c41ca158edd24ab76ebc0b01411 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 10 Dec 2024 15:27:53 -0500 Subject: [PATCH] Add comment about the traversal --- csrc/scheduler/tools/inlining.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csrc/scheduler/tools/inlining.cpp b/csrc/scheduler/tools/inlining.cpp index a81483edb13..6064f4e6e7c 100644 --- a/csrc/scheduler/tools/inlining.cpp +++ b/csrc/scheduler/tools/inlining.cpp @@ -205,6 +205,14 @@ size_t MaxPosCalculator::getMaxProducerPosFromConsumer( // Get ValGroups in loop domains of producer and consumer that are // connected to _mapped_ IterDomains in the pairwise map. + // + // Note that for MmaOp, it would be sufficient to traverse from the + // producer loop to the consumer loop and identify when _either_ the + // consumer or producer ID is not mapped. Here we are instead traversing + // from mapped domains to both roots so that we can check that _both_ + // consumer and producer ID is not mapped. This is slightly safer and this + // symmetry might be handy in handling new ops that use this feature in + // the future. std::vector pairwise_mapped_groups; for (auto [c_id, p_id] : PairwiseLogicalDomainMap(producer, consumer) .mapConsumerToProducer()) {