[Feature request] Add profiler to modelkit model
llin17 opened this issue · 2 comments
llin17 commented
I would like to propose a simple feature that can analyze resource consumption for model prediction. The usage is described as follows:
model = modelkit.load_model(...)
profiler = Profiler(model) # Profiler could be customized
result = model(item)
profiler.summary() # output a DataFrame or str
# if there is no profiler, everything works as usual.
The output profile.summary()
contains also the profiling result of each sub-models (defined in self.model_dependencies
recursively). This requires only a few lines changes in modelkit/core/model.py
.
CyrilLeMat commented
+1
llin17 commented
The PR has been merged.