Solved by SimonW in post #9 
              
              
                You are right. Unfortunately we can’t know the exact size of the cuda context. The memory_allocated/cached methods report all memory allocated by pytorch. But if cuda context is out of our control. But, I think you can safely assume that cuda context is 100~250MB. 

I submitted a patch to add those…