Daniel Falbel
Daniel Falbel
@egillax I'll take a look at the code more closely later but in general the reason for this is the difference between R garbage collector and python's. The R garbage...
I'll look more closely at the code now. `nvidia-smi` is not really reliable to tell how much memory it's actually using because LibTorch uses a Caching Allocator, so the memory...
Comparing both implementations based on `cuda_memory_stats()`, I see the following: Peak memory usage with torch for R is larger but adding a `gc(full = TRUE)` right before `batch scales::number_bytes(torch::cuda_memory_stats()$allocated_bytes$all$current, units...
@egillax Still not ideal but I made a few changes to how we call the garbage collector from backward. That should make it better at handling those situations where un-collected...
Yes, the first epoch is slower because PyTorch will ask memory from the OS more often, and thus triggering a `gc` call. Later, the memory should be already in 'reserved'...
Sure, no worries @egillax ! It's really great that you are bringing those points. Yes: ``` torch::cuda_memory_stats()$allocation$all$current ``` Should be the same as the value in a clean session when...
Yeah, I think `TORCH_HOME` is the right option if you want to build LibTorch from source. We currently don't provide any helpers for building it in this repo. One thing...
I haven't tried yet, sorry. But you might be able to install by setting `TORCH_HOME` env var to a directory containing the non-abi version of libtorch and copying the liblantern...
OK, I can try providing a non ABI compiled version of liblantern.so What I would try doing is adding an entry here: https://github.com/mlverse/torch/blob/master/.github/workflows/lantern.yaml so we also have a non abi...
Hi @zia1138 You can find a build artifact here: https://github.com/mlverse/torch/actions/runs/796163101 Let me know if that works for you. I am not sure how to test exactly, but I think adding...