feat: add cached CUDA graph inference - #37
Conversation
|
@freeman94 Could you please review this PR when convenient? It implements the CUDA Graph support requested in #14. Local formatting checks pass; the remaining validation requires the CUDA/TensorRT environment. |
Hello, thank you for the PR! I will be on vacation until the start of August, so please bear with the delay in reviewing. |
|
Looks like you'll run into two issues that I encountered when I previously investigated implementing this feature. Both issues occur when using TensorRT in multithreaded contexts. First, you'll get illegal access errors due to the default setting of global graph capture. See here. Second, TensorRT seems to use synchronous aux streams by default. The fix there seems to be creating new streams manually and passing via Note, I've not tried any of these remediations and the nvidia docs read scattered and unclear about graph usage in heavily concurrent contexts, so not sure what will end up fixing it. |
Summary
--cuda-graphCloses #14
Verification
cargo fmt --checkgit diff --checkcargo check --all-targetscould not run locally because CUDA/TensorRT and the requiredTENSORRT_LIBRARIESenvironment variable are unavailable on the development machine.