Tudyx / ai-dataloader

A rust port of pytorch dataloader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pin memory for tch-rs

AzHicham opened this issue · comments

Hello,
I think it could be great to pass a variable (pin_memory) to the dataloader to allow pin memory for the TorchCollate case. Wdyt ?

commented

Hi, totally agree, we should provide a similar functionality as the one described in PyTorch doc.
I think we could inspire from rustacuda, but ideally we can find a solution which is GPU agnostics, as pinning (page locked) doesn't require to be bound to cuda.

Yeah!
Btw for tch-rs there is already a method than can be used after collating tensors

commented

Interesting, do you have any link to this method? I couldn't find it in there repo