Commits


Chi Lo authored and GitHub committed 86c5c07ea41
TRT EP race condition fix during ep compile time (#13356) ### Description TRT EP has the chance to encounter race condition when multiple threads are doing engine serialization/deserialization during EP compile time. Let's say one thread is serializing the engine and has not yet completely written all the data to file, and at this moment, another thread finds the engine file is existed and begins to deserialize the engine, it will end up deserialize the corrupt file. The fix is to put a lock around engine deserialization/serialization, engine build and context build. ### Motivation and Context The TensorRT EP Windows CI sometimes fails because of `TensorrtExecutionProviderTest.MultiThreadsTestWithOneSessionSingleThreadInference` unit test fails (This PR changes the name to SessionCreationWithMultiThreadsAndInferenceWithMultiThreads). It's highly possible due to race condition. The TensorRT CI failure also been reported [here](https://github.com/microsoft/onnxruntime/issues/13030)