Open suryajasper opened 2 days ago
mentioning @AWoloszyn - don't have permissions to assign
Could suppress leaks from the driver:
We used to have a sanitizer_suppressions.txt
in the repo containing:
leak:libGLX_nvidia.so
(when we ran GPU tests with ASan on CI, now we just run CPU tests with ASan)
some of these may be legit - before suppressing do some due diligence (the iree_hal_rocm_descriptor_set_layout_create for example is definitely a leak on our side, and may indicate a place we are hanging on to resources we shouldn't be)
What happened?
I am seeing memory leaks due to the ROCm & HIP runtime backends in IREE. These issues can be reproduced simply by initializing and releasing a hip / rocm HAL device:
@AWoloszyn has produced a more detailed callstack
Steps to reproduce your issue
Following MRE induces memory leaks before dispatching buffers or running any workloads. Note that replacing the device uri with local-sync, local-task, cuda, or any other device aside from rocm or hip works without memory leaks.
================================================================= ==1536727==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 3096 byte(s) in 43 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 144 byte(s) in 2 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 72 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 56 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 56 byte(s) in 1 object(s) allocated from:
0 0x558cc63f1e68 in __interceptor_calloc (/home/surya/iree/build/tools/iree-run-module+0xefe68) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 56 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 56 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Direct leak of 56 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 2464 byte(s) in 7 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 2464 byte(s) in 7 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 2016 byte(s) in 42 object(s) allocated from:
0 0x558cc63f1e68 in __interceptor_calloc (/home/surya/iree/build/tools/iree-run-module+0xefe68) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 1680 byte(s) in 7 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 592 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 560 byte(s) in 14 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 192 byte(s) in 8 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 176 byte(s) in 1 object(s) allocated from:
0 0x558cc63f1c7e in malloc (/home/surya/iree/build/tools/iree-run-module+0xefc7e) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 104 byte(s) in 1 object(s) allocated from:
0 0x558cc642ca4d in operator new(unsigned long) (/home/surya/iree/build/tools/iree-run-module+0x12aa4d) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
0 0x558cc63f1e68 in __interceptor_calloc (/home/surya/iree/build/tools/iree-run-module+0xefe68) (BuildId: b8a67ead7be48d93a3641264913c9551ee6f65bc)
SUMMARY: AddressSanitizer: 13872 byte(s) leaked in 140 allocation(s).