Open RocaVincent opened 3 years ago
Thanks for reporting and especially for the reproducer.
I think the two memory allocations with INVALID data type are real and actually consume memory. They may be caused by the implementation of Conv2D, and for some unknown reason, their (region type, data type, shape) cannot be inferred. I have filed a bug internally to further investigate.
Hi RocaVincent,
In your code to reproduce this issue, you have
imagesA = tf.random.uniform([BATCH_SIZE]+IMAGE_SHAPE)
but imagesA is not used by any code later.
I think the invalid data type in memory breakdown table is related to this unused code. This unused code causes tf unable to infer the data type. when I remove this line, the memory allocation table looks normal:
Op Name | Allocation Size (GiBs) | Requested Size (GiBs) | Occurrences | Region type | Data type | Shape |
---|---|---|---|---|---|---|
sequential_2/conv2d_1/Conv2D | 0.125 | 0.105 | 1 | temp | uint8 | [113247504] |
sequential_2/conv2d_1/Conv2D | 0.031 | 0.023 | 1 | output | float | [32,3,256,256] |
sequential_2/conv2d_1/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer | 0.031 | 0.023 | 1 | output | float | [32,3,256,256] |
preallocated/unknown | 0.002 | 0.002 | 1 | persist/dynamic | INVALID | unknown |
Hi @Terranlee Thank you for the answer
When I remove this line, I get the exact same memory breakdown table than the first I show. In addition, the bug concerns convolutions operations which are not linked with this tensor creation. What surprises me also is that you have a uint8 data type for your first operation.
Hi @Terranlee Thank you for the answer
When I remove this line, I get the exact same memory breakdown table than the first I show. In addition, the bug concerns convolutions operations which are not linked with this tensor creation. What surprises me also is that you have a uint8 data type for your first operation.
I'm a user, not a contributor, but if you end up needing more memory, my current workaround is to explicitly limit the memory usage to a precalculated model size estimate
Hi @parkournerd This solution doesn't increase your GPU capacity and doesn't explain the strange results given by the Profiler.
Hi,
I use the profiler with Tensorflow 2 and a NVIDIA Quadrio RTX 6000 GPU and when I inspect the memory usage with my model, I get some operations in the memory breakdown table in the memory profile tab with invalid data type, no shape and no region type. I'm wondering if it's normal or if I have to care about this for my model. Above I put a simple code which reproduces this kind of error.
With this code, I get the following results in the memory profile tab :
Do you know why I get this kind of strange results ?