Skip to content

Commit

Permalink
fix: Getting unsupported ops will now bypass non-schema ops avoiding …
Browse files Browse the repository at this point in the history
…redundant failures

Signed-off-by: Dheeraj Peri <[email protected]>
  • Loading branch information
peri044 committed Apr 5, 2022
1 parent 01d98c7 commit d7d1511
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/conversion/conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,10 @@ std::string ConvertBlockToEngine(
std::unordered_map<c10::OperatorName, std::string> GetUnsupportedOpsInBlock(const torch::jit::Block* b) {
std::unordered_map<c10::OperatorName, std::string> unsupported_ops;
for (const auto n : b->nodes()) {
if (n->kind() != torch::jit::prim::Loop && n->kind() != torch::jit::prim::If && !OpSupported(n) &&
n->kind() != torch::jit::prim::DictConstruct) {
auto schema = n->maybeSchema();
TORCHTRT_CHECK(
schema,
"Unable to get schema for Node " << util::node_info(n) << " (conversion.VerifyCoverterSupportForBlock)");
auto schema = n->maybeSchema();
// Some ops like torch::jit::prim::Loop, torch::jit::prim::If, torch::jit::prim::DictConstruct don't have a schema but they are supported.
// torch::jit::prim::DictConstruct is supported via fallback only
if (schema && !OpSupported(n)) {
std::stringstream ss;
ss << *schema;
unsupported_ops[schema->operator_name()] = ss.str();
Expand Down

0 comments on commit d7d1511

Please sign in to comment.