@@ -436,8 +436,8 @@ std::string ConvertBlockToEngine(const torch::jit::Block* b, ConversionInfo buil
436
436
return engine;
437
437
}
438
438
439
- std::set< std::string> GetUnsupportedOpsInBlock (const torch::jit::Block* b) {
440
- std::set< std::string> unsupported_ops;
439
+ std::unordered_map<c10::OperatorName, std::string> GetUnsupportedOpsInBlock (const torch::jit::Block* b) {
440
+ std::unordered_map<c10::OperatorName, std::string> unsupported_ops;
441
441
for (const auto n : b->nodes ()) {
442
442
if (n->kind () != torch::jit::prim::Loop && n->kind () != torch::jit::prim::If && !OpSupported (n)) {
443
443
auto schema = n->maybeSchema ();
@@ -446,7 +446,7 @@ std::set<std::string> GetUnsupportedOpsInBlock(const torch::jit::Block* b) {
446
446
" Unable to get schema for Node " << util::node_info (n) << " (conversion.VerifyCoverterSupportForBlock)" );
447
447
std::stringstream ss;
448
448
ss << *schema;
449
- unsupported_ops. insert ( ss.str () );
449
+ unsupported_ops[schema-> operator_name ()] = ss.str ();
450
450
}
451
451
for (const auto sub_b : n->blocks ()) {
452
452
auto sub_b_unsupported_ops = GetUnsupportedOpsInBlock (sub_b);
@@ -488,12 +488,27 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b) {
488
488
unsupported_msg << " Method requested cannot be compiled by TRTorch.\n Unsupported operators listed below:"
489
489
<< std::endl;
490
490
for (auto s : unsupported_ops) {
491
- unsupported_msg << " - " << s << std::endl;
491
+ unsupported_msg << " - " << s. second << std::endl;
492
492
}
493
493
unsupported_msg << " You can either implement converters for these ops in your application or request implementation"
494
494
<< std::endl;
495
495
unsupported_msg << " https://www.github.com/nvidia/TRTorch/issues" << std::endl;
496
+ unsupported_msg << std::endl << " In Module:" << std::endl;
497
+
496
498
LOG_ERROR (unsupported_msg.str ());
499
+
500
+ for (const auto n : b->nodes ()) {
501
+ auto schema = n->maybeSchema ();
502
+ if (schema) {
503
+ for (const auto & x : unsupported_ops) {
504
+ if (x.first == schema->operator_name ()) {
505
+ LOG_ERROR (
506
+ " Unsupported operator: " << *schema << std::endl
507
+ << trtorch::core::util::GetPyTorchSourceCode (n) << std::endl);
508
+ }
509
+ }
510
+ }
511
+ }
497
512
return false ;
498
513
}
499
514
0 commit comments