Skip to content

Commit

Permalink
[fix] fix plain_device mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-syr committed May 24, 2024
1 parent 2cfd14c commit 6631b8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ppl/nn/engines/llm_cuda/plain_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ RetCode PlainDevice::DoInit() {
return RC_SUCCESS;
}

PlainDevice::~PlainDevice() {
DoDestroy();
}

void PlainDevice::DoDestroy() {
delete allocator_;
}
Expand Down
1 change: 1 addition & 0 deletions src/ppl/nn/engines/llm_cuda/plain_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace ppl { namespace nn { namespace llm { namespace cuda {
class PlainDevice final : public LlmCudaDevice {
public:
PlainDevice(bool async) : async_(async) {}
~PlainDevice();
using LlmCudaDevice::Realloc;
ppl::common::RetCode Realloc(uint64_t bytes, BufferDesc*) override;
void Free(BufferDesc*) override;
Expand Down

0 comments on commit 6631b8f

Please sign in to comment.