Vengineerの妄想(準備期間)

人生は短いけど、長いです。人生を楽しみましょう!

TensorFlow Lite に、CoreML Delegate が登場

@Vengineerの戯言 : Twitter
SystemVerilogの世界へようこそすべては、SystemC v0.9公開から始まった 
TensorFlow Lite Core ML Delegate enables running TensorFlow Lite models on Core ML framework, which results in faster model inference on iOS devices.

github.com

サポートするiOSとプロセッサは、

  • iOS 12以降、それより前だと、CPUで実行される
  • iPhone Xs以降だと、Neural Engine が使えるようになるだろう

とありますね。

AppleのCoreML APIの中で勝手にNeural Engineが使われているんでしょうね。

 

Core ML delegate C++ APIもあるようですね。

typedef struct {
    // We have dummy for now as we can't have empty struct in C.
    char dummy;
} TfLiteCoreMlDelegateOptions;

// Return a delegate that uses CoreML for ops execution.
// Must outlive the interpreter.
TfLiteDelegate* TfLiteCoreMlDelegateCreate(
   const TfLiteCoreMlDelegateOptions* options);

// Do any needed cleanup and delete 'delegate'.
void TfLiteCoreMlDelegateDelete(TfLiteDelegate* delegate);

 これは、他のDelegate と同じ API ですね。

Neural Engine を使うには、ここに解説がありますね。

heartbeat.fritz.ai

 

freedomtan さんのベンチマーク

github.com