onnxruntime
aa5e3645 - [TRT EP] Fix multithreading bug of getting the corrupted trt engine instance (#17507)

Commit
2 years ago
[TRT EP] Fix multithreading bug of getting the corrupted trt engine instance (#17507) Revert to the old TRT EP behavior of securing the whole compute_function by lock_guard. Current TRT EP which only puts lock_guard around a critical section (obvious wrong) inside compute_function. The issue can happen where one thread is updating the engine in compute_function whereas another thread still accesses the stale/corrupted engine instance in compute_function, for example, the code outside the critical section, `int total_bindings = trt_engine->getNbBindings()`. So, make the whole compute_function the critical section should be okay.
Author
Parents
Loading