Commit Graph

6 Commits

Author SHA1 Message Date
Kwabena W. Agyeman
77950f03e1 modules/py_ml: Optimize threshold using Helium.
The majority of the time spent processing the model is during
the max, threshold, and nonzero operation. Combing these togheter
in C using Helium provides a massive speedup for larger arrays.
2025-07-25 21:05:24 -07:00
Kwabena W. Agyeman
57c7fc5374 modules/py_ml: Return tensor references for post-processors.
Converting the output tensors into floats for the prost-processors
causes memory exhaustion when models become very large. Additionally,
it wastes processing time converting values which may not be used. By
moving the conversion step into the post-processors we avoid this issue.

If no callback is passed for post-processing the converted output to
a floating point ndarray is returned still.
2025-07-25 21:00:08 -07:00
Kwabena W. Agyeman
ec33fd865b modules/py_ml: Add profiling for post-processing. 2025-07-24 13:23:46 -07:00
iabdalkader
678be91f39 modules: Use common alignment macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-16 11:18:56 +02:00
iabdalkader
4ded9fba91 common: Remove xalloc.
Originally meant to abstract gc_collect but we could just use
m_alloc and friends. Also was meant to provide functions like
alloc0, alloc_maybe etc.. which are all available in MP anyway.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-27 14:50:16 +02:00
iabdalkader
daf2bb30da misc: Restructure repo.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-13 08:28:34 +02:00