@smth Where does the rest of the memory live?  I have an example where walking the gc objects as above gives me a number less than half of the value returned by torch.cuda.memory_allocated().  In my case, the gc object approach gives me about 1.1GB and torch.cuda.memory_allocated() returned 2.8GB.
Where is the rest hiding?  This doesn’t seem like it would be simple pytorch bookkeeping overhead.