Skip to content

Commit e38056b

Browse files
authored
Merge pull request #932 from NVIDIA/log_fix
Suppress code location errors by default and in debug mode, show the list of unsupported ops in debug mode for better readability.
2 parents 207b1b1 + 780fd4f commit e38056b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

core/compiler.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,18 +417,16 @@ torch::jit::Module CompileGraph(const torch::jit::Module& mod, CompileSpec cfg)
417417
auto first_use_types = ir::get_block_first_calc_dtypes_opt(g->block());
418418

419419
MapInputsAndDetermineDTypes(cfg, g, static_params, first_use_types);
420-
420+
auto isBlockConvertible = conversion::VerifyConverterSupportForBlock(g->block(), true);
421421
if (cfg.partition_info.enabled &&
422422
(cfg.lower_info.forced_fallback_modules.size() == 0 &&
423-
cfg.partition_info.forced_fallback_operators.size() == 0 &&
424-
conversion::VerifyConverterSupportForBlock(g->block(), true))) {
423+
cfg.partition_info.forced_fallback_operators.size() == 0 && isBlockConvertible)) {
425424
LOG_INFO("Skipping partitioning since model is fully supported");
426425
}
427426

428427
if (cfg.partition_info.enabled &&
429428
!(cfg.lower_info.forced_fallback_modules.size() == 0 &&
430-
cfg.partition_info.forced_fallback_operators.size() == 0 &&
431-
conversion::VerifyConverterSupportForBlock(g->block(), true))) {
429+
cfg.partition_info.forced_fallback_operators.size() == 0 && isBlockConvertible)) {
432430
auto input_ivalues_map = partitioning::generateRandomInputs(cfg.convert_info.inputs, first_use_types);
433431
auto graph_and_mapping = ConstructFallbackGraph(new_mod, g->block(), input_ivalues_map, cfg, static_params);
434432
new_g = graph_and_mapping.first;

core/conversion/conversion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b, bool suppress_er
576576
for (const auto& str : type.second) {
577577
traceback << str;
578578
}
579+
579580
auto tb_str = traceback.str();
580581
if (!suppress_errors) {
581582
LOG_ERROR(tb_str);

0 commit comments

Comments
 (0)