pytorch / torcharrow

High performance model preprocessing library on PyTorch
https://pytorch.org/torcharrow/beta/index.html
BSD 3-Clause "New" or "Revised" License
642 stars 78 forks source link

Use rootMemoryPool to construct execContext #480

Closed wenleix closed 2 years ago

wenleix commented 2 years ago

Summary: It originally use memory::getDefaultScopedMemoryPool() since ExecCtx constructor expects unique_ptr<MemoryPool>.

Since https://github.com/facebookincubator/velox/commit/15eeddb8e7d50de39afdbde4049f9a1310edf5e5, ExecCtx now expects MemoryPool*, so we can use &velox::memory::getProcessDefaultMemoryManager().getRoot() returned by TorchArrowGlobalStatic::rootMemoryPool.

This makes TorchArrow always use this process default root memory pool.

Differential Revision: D39010989

facebook-github-bot commented 2 years ago

This pull request was exported from Phabricator. Differential Revision: D39010989