Store an empty engine in the case that dynamic engine creation fails. The next time the same input shape appears, we will retrieve the empty engine which tells us to not rebuild the same failing engine again.

This commit is contained in:
Trevor Morris 2019-03-11 14:50:02 -07:00
parent df3a9e555f
commit fe020fccbb

View File

@ -633,6 +633,9 @@ EngineContext* TRTEngineOp::GetEngine(
}
LOG(WARNING) << "Engine creation for batch size " << batch_size
<< " failed " << status;
// Store an empty engine here so we don't try to build the same engine
// again.
cache.emplace(engine_input_shapes, empty_context);
return &empty_context;
}
VLOG(1) << "Conversion is done";