dali_backend icon indicating copy to clipboard operation
dali_backend copied to clipboard

Dali backend support feature to handle init function

Open farzanehnakhaee70 opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. Currently dali_backend just works with post and preprocessing for the functions which do not requires initialization. What if when the init part takes longer time? Is there any solution for this?

farzanehnakhaee70 avatar Apr 23 '22 17:04 farzanehnakhaee70

cc @szalpal @jantonguirao

Tabrizian avatar Apr 25 '22 14:04 Tabrizian

Hi @farzanehnakhaee70,

Could you tell us more about what do you mean by:

Currently dali_backend just works with post and preprocessing for the functions which do not require initialization

In the case of DALI if you load the processing model all the necessary operators' initialization happens. In most cases, it is just the memory allocation. Do you have any particular operation in mind which may require extended initialization?

JanuszL avatar Apr 25 '22 16:04 JanuszL

Hi @JanuszL , Thanks a lot for your answer. The problem for my side is I'm wondering if I can use dali backend for transformer like models and import the tokenizer in the initialization part and afterward use the initialized tokenizer during the processing (as it takes time for initializing the tokenizers during each execution). Is it possible?

farzanehnakhaee70 avatar Apr 26 '22 08:04 farzanehnakhaee70

Hi @farzanehnakhaee70,

DALI is initialized once when the model is loaded. Then when the inference request is processed the pipeline is just run, However I'm not sure if DALI is capable of tokenization. You may consider writing a custom plugin for DALI https://github.com/triton-inference-server/dali_backend/blob/main/docs/examples/dali_plugin/README.md.

JanuszL avatar Apr 26 '22 10:04 JanuszL