foss-for-synopsys-dwc-arc-processors/embarc_mli

How to transform the pre-trained model into that coefficient files for machine learning inference applications on ARC iotdk?

CWLiang opened this issue · 4 comments

Issue Summary

I want to use ARC iotdk to do some machine learning inference application.
So I reference the example that provided in embarc_osp/example/baremetal/embarc_mli/cifar10_caffe.
There are two files "cifar10_coefficients_chw_big.c" and "cifar10_coefficients_chw_small.c" that list all the coefficients of the convolution layers.
I wonder how to transform the pre-trained model into that coefficient files.
Is there any automation tool or flow could support the transformation?


Development Environment

  • HOST OS
    Win10 64 bit

  • TOOLCHAIN
    gnu toolchain

  • BOARD
    ARC IoTDK

  • ARC CORE
    arcem9d


Question

I wonder how to transform the pre-trained model into that coefficient files.
Is there any automation tool or flow could support the transformation?

Hi @CWLiang
For now automated model mapping tool is not available. Model deployment and coefficients transformation for MLI should be done manually with the help of customized scripts. The process itself is described in the slide set which is available to participants or ARC Design Contest (I will provide a link if I find it). This information will be merged into MLI documentation soon and example of such mapping together with all helper scripts will also appear in the repo. I’ll close this issue once the documentation is updated.

For now, I will just leave it here:
depl_process

And the following link should help with arithmetic details and definition of Q format: https://embarc.org/embarc_mli/doc/build/html/MLI_FP_data_format/MLI_FP_data_format.html

Hi @dzakhar , thanks for your tips.
The example of the mapping process and helper scripts will help a lot.
Will these examples and scripts release recently?

Yes, the work is in progress and expected to be done soon.

Documentation has been updated with model deployment tutorial for CIFAR10 example. It’s available on embarc.org.
Related scripts have also been added into the repo.

Closing the issue