Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tensorrt_llm/llmapi/rlhf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def update_weights(self, ipc_handles: Optional[dict] = None):
self.engine.model_engine.model, weights, allow_partial_loading=True
)
del weights
# ipc_collect only reclaims mappings whose Python refs are
# already gone; force GC so cudaIpcOpenMemHandle storages are
# released before the sweep, or the IPC handle table saturates
# across repeated RPCs.
gc.collect()
torch.cuda.ipc_collect()
else:
logger.info("Finalize update weights")
Expand Down
Loading