CTranslate2 icon indicating copy to clipboard operation
CTranslate2 copied to clipboard

Implement python bindings for profiler

Open yehudaorel opened this issue 7 months ago • 1 comments

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()

yehudaorel avatar Jul 08 '24 17:07 yehudaorel