Previous commit was broken in this one 9ms vs 7ms for vgg8 Arch-A

This commit is contained in:
ilgeco
2026-07-28 12:09:59 +02:00
parent 87bd7b726d
commit 2b899b62a8
8 changed files with 518 additions and 210 deletions
@@ -169,7 +169,10 @@ struct LowerSpatialPlansPass final : PassWrapper<LowerSpatialPlansPass, Operatio
/*emitRowStripLayout=*/true,
rewriter);
if (failed(lowered)) {
planOp.emitOpError("failed to lower selected row-strip Spatial Conv plan");
auto diagnostic = planOp.emitOpError("failed to lower selected row-strip Spatial Conv plan with input ");
diagnostic << planOp.getInput().getType() << " and output " << planOp.getResult().getType();
if (physicalInput)
diagnostic << " from physical storage " << physicalInput->getType();
signalPassFailure();
return;
}
@@ -336,6 +339,21 @@ struct LowerSpatialPlansPass final : PassWrapper<LowerSpatialPlansPass, Operatio
rewriter.replaceOp(planOp, computeOp.getResults());
continue;
}
if (auto flattenOp = dyn_cast<spatial::SpatGraphCompute>(&op)) {
if (flattenOp.getInputs().size() == 1) {
FailureOr<RowStripPhysicalValue> input =
getRowStripValue(rowStripValues, flattenOp.getInputs().front());
if (succeeded(input) && succeeded(canLowerFlattenFromRowStrip(flattenOp))) {
rewriter.setInsertionPoint(flattenOp);
if (failed(lowerFlattenFromRowStrip(*input, flattenOp, rewriter))) {
flattenOp.emitOpError("failed to preserve row-strip layout through Flatten");
signalPassFailure();
return;
}
continue;
}
}
}
if (auto materializeOp = dyn_cast<spatial::SpatMaterializeLayoutOp>(&op)) {
if (materializeOp.getSourcePhysicalLayout() == kDenseLayout
&& materializeOp.getTargetPhysicalLayout() == kDenseLayout) {