Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit d2e2460

Browse files
committed
memory promotion: ignore tensors with no rectangular approximation
If we cannot compute a rectangular approximation of a reference's footprint, do not introduce groups for any other references to this tensor and thus avoid promoting it.
1 parent 1ec2911 commit d2e2460

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/polyhedral/memory_promotion.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,21 @@ void addSingletonReferenceGroups(
321321
// access relations have a shape :: [D -> ref] -> O
322322
// use currying to isolate the D part before intersecting with the domain
323323
// Compute initial groups with single reference per group.
324+
std::unordered_set<isl::id, isl::IslIdIslHash> unapproximatable;
324325
for (auto a : isl::UnionAsVector<isl::union_map>(accesses)) {
325326
if (isl::union_map(a.curry()).intersect_domain(domain).is_empty()) {
326327
continue;
327328
}
328329

329330
auto tensorId = a.get_tuple_id(isl::dim_type::out);
330-
addSingletonReferenceGroup(tensorGroups, tensorId, schedule, a, type);
331+
if (unapproximatable.count(tensorId) != 0) {
332+
continue;
333+
}
334+
try {
335+
addSingletonReferenceGroup(tensorGroups, tensorId, schedule, a, type);
336+
} catch (const promotion::GroupingError& err) {
337+
unapproximatable.insert(tensorId);
338+
}
331339
}
332340
}
333341
} // namespace

0 commit comments

Comments
 (0)