inducer / sumpy

Symbolic code generators for multipole and local expansions and translations
31 stars 13 forks source link

Memory leaks? #178

Open isuruf opened 1 year ago

isuruf commented 1 year ago

Running an FMM with,

for _ in range(2):
    timing_data = {}
    drive_fmm(sumpy_wrangler, (charge_device,), timing_data=timing_data)
    queue.finish()
    gc.collect()

leads to a memory allocation failure with cuda in the second loop.

inducer commented 1 year ago

When you say "memory allocation", what precisely do you mean? How do you measure that?

inducer commented 1 year ago

Possibly related: https://github.com/inducer/pymbolic/pull/125#issuecomment-1583262618

inducer commented 1 year ago

Running

 pycl test_fmm.py 'test_sumpy_fmm(_acf, LaplaceKernel(3), LinearPDEConformingVolumeTaylorLocalExpansion, LinearPDEConformingVolumeTaylorMultipoleExpansion, False, False, False, None)'

with this patch applied leads to no appreciable memory growth. :thinking:

Could you provide a reproducer?

inducer commented 1 year ago

Similarly, no appreciable memory growth when run using mprof:

grafik