tranqkhue / damn_3dlidar

for Thắng
0 stars 0 forks source link

Very high CPU consumption #3

Closed tranqkhue closed 2 years ago

tranqkhue commented 2 years ago

Adding scipy.signal.savgol_filter consumes a lot of CPU usage Screenshot from 2022-06-16 17-12-44 The problem trace to https://github.com/scipy/scipy/blob/4cf21e753cf937d1c6c2d2a0e372fbc1dbbeea81/scipy/signal/_savitzky_golay.py#L193

However, if we modify https://github.com/tranqkhue/damn_3dlidar/blob/f97604663e67618e0ecbf9a7fb85227c03bdb6ea/test2.py#L48 from axis=1 to axis=0, the issue is gone. This is weird as number of calculations, as divided by a fixed-length window, are the same

tranqkhue commented 2 years ago

This problem still resists even trying:

tranqkhue commented 2 years ago

The problem is fixed by limiting the number of threads OpenBLAS export OPENBLAS_NUM_THREADS=1 Ref: https://github.com/numpy/numpy/issues/19057#issuecomment-845835734