c10::CUDAOutOfMemoryError

Error locating to dgl.node_subgraph with Heterogeneous graph.
Specific code:dgl.node_subgraph(g, {‘mention’: xxx, ‘entity’: xxx})
Error description:what(): CUDA out of memory. Tried to allocate 1109057167.77 GiB (GPU 0; 23.70 GiB total capacity; 55.85 MiB already allocated; 21.73 GiB free; 70.00 MiB reserved in total by PyTorch)

I don’t know why generating subgraphs causes so many memory overflows.

maybe can you post the full code that caused the above error?
It’s hard to see where the mistake happened in these cases unless one can look at the implementation.

The sample has about 50 nodes and 200 edges. During the process of creating the subgraph, I expressed the same ID for a certain type of nodes, such as dgl.node_ subgraph(g, {‘mention’: [1,1],'entity ': xxx}).This is indeed my problem. After I change it to [1,2], it is no problem. However, I go to test other samples and still enter two identical node IDs without any error.

node_subgraph does not support duplicated node IDs. We’ll think of how to add a sanity check.

Thank you for your reply