apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.41k stars 3.4k forks source link

[CudaGraph] Handle exceptions thrown while capturing cuda graph #17113

Closed Lunderberg closed 1 week ago

Lunderberg commented 1 week ago

Prior to this commit, an exception thrown during the capture of a cuda graph would result in std::terminate being called. This commit updates the implementation of "vm.builtin.cuda_graph.run_or_capture" such that a thrown exception can be recovered from, and does not cause any changes to the state of TVM's cuda graph cache.