CTranslate2
CTranslate2 copied to clipboard
Implement python bindings for profiler
Overview
Related to: https://github.com/OpenNMT/CTranslate2/issues/1736 ,will also resolve: https://github.com/OpenNMT/CTranslate2/issues/1734
Expose profiler functionality - ctranslate2::init_profiling()
& ctranslate2::dump_profiling()
to python level.
Example usage:
import ctranslate2
# Initialize the profiler on CPU
ctranslate2.init_profiler(device = ctranslate2.Device.cpu, 1)
Load model, generate/translate...
# Dump profiling to stdout
ctranslate2.dump_profiler()