This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
forked from kaldi-asr/kaldi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[src] Fix leaking CudaFst object's device memory (kaldi-asr#4548)
BatchedThreadedNnet3CudaOnlinePipeline never freed a CudaFst object it initialized. Freeing it caused an error returned from cudaFree (with our allocator disabled). The root cause of this problem was copying of the CudaFst in CudaDecoder's constructor. The code has been changed so that CudaDecoder only stores a reference to CudaFst, and the object itself is uniquely owned by the pipeline. This allowed folding of separate CudaFst::Initialize and CudaFst::Finalize methods into its respective constructor and destructor. There is also a proof-of-concept unique_device_ptr, a specialization of std::unique_ptr for device-allocated memory. The type is declared privately in, and only used by CudaFst. The Finalize method had been removed entirely, and the memory is freed in the object's destructor, as the members are destroyed.
- Loading branch information
Showing
8 changed files
with
190 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.