diff --git a/ethosu/regor/architecture/ethosu55/ethos_u55_constraints.cpp b/ethosu/regor/architecture/ethosu55/ethos_u55_constraints.cpp index 03fd3d7b918d175f5accf79ca9e611f742f8fe9a..37933d51b22b5b22cadac856e4411adba3711e95 100644 --- a/ethosu/regor/architecture/ethosu55/ethos_u55_constraints.cpp +++ b/ethosu/regor/architecture/ethosu55/ethos_u55_constraints.cpp @@ -279,13 +279,23 @@ Flags EthosU55Constraints::OperatorQuery(OpType opType, const ArchO { if ( req ) { - req->req = ArchRequirement::OpSubstitution; + req->req.Set(ArchRequirement::OpSubstitution); req->substitution = OpType::LUT; } result.Set(QueryResult::HasRequirements); } } + // TransposeConv2D and Conv3D are legalized during decomposition + if ( opType == OpType::TransposeConv2D || opType == OpType::Conv3D ) + { + if ( req ) + { + req->req.Set(ArchRequirement::Decompose); + } + return QueryResult::NativeConstrainedHasReq; + } + // Check direct native support of the opType auto npuOp = _arch->GetHWOp(opType); if ( npuOp == EthosU55NpuOp::None ) diff --git a/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp b/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp index 8a2ea87c076fe4331afe72f01a451dc8db5aad85..a7bc9315365867e80c5bf175d86e238d235d7273 100644 --- a/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp +++ b/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp @@ -262,12 +262,22 @@ Flags EthosU85Constraints::OperatorQuery(OpType opType, const ArchO { if ( req ) { - req->req = ArchRequirement::OpSubstitution; + req->req.Set(ArchRequirement::OpSubstitution); req->substitution = OpType::LUT; } result.Set(QueryResult::HasRequirements); } + // TransposeConv2D and Conv3D are legalized during decomposition + if ( opType == OpType::TransposeConv2D || opType == OpType::Conv3D ) + { + if ( req ) + { + req->req.Set(ArchRequirement::Decompose); + } + return QueryResult::NativeConstrainedHasReq; + } + // Check direct native support of the opType auto npuOp = _arch->GetHWOp(opType); if ( npuOp == EthosU85NpuOp::None ) diff --git a/ethosu/regor/compiler/scheduler_decompose.cpp b/ethosu/regor/compiler/scheduler_decompose.cpp index 836f590deaed73b5763abf8a46037a202b662353..a5b91100695ce09e565c6cf65a0d682c9222fee5 100644 --- a/ethosu/regor/compiler/scheduler_decompose.cpp +++ b/ethosu/regor/compiler/scheduler_decompose.cpp @@ -211,7 +211,6 @@ bool NeedsDecompose(Architecture *arch, const SchedulerOperation *schedOp) ArchRequirements req{}; Flags result = OperatorQuery(arch, schedOp, &req); // Assert complete query - assert(result.Any(QueryResult::Constrained) == false && "Constrained result from complete OperatorQuery"); if ( result.Any(QueryResult::Unsupported) ) { // Operations completely unsupported by HW should not be decomposed