Rockchip · AI & Linux Hub

AI 推論

RKNN2 V2.5.0 · RV1103/RV1106:再現在のネットワーク、算術およびプール

RKNN2 V2.5.0 · RV1103/RV1106:再現在のネットワーク、算術およびプール ·完全なオペレータ変数およびV2.5.0の源からの制約。

このRKNN2 V2.5.0プラットフォームリファレンスは、ArmSoM開発者がモデルを選択および適応するのに役立ちます。 すべてのArmSoMボードでのサポートを確立しません。ボードSOC、実際のツールキット2、ランタイム、NPUドライバ、BSPバージョンを確認します。 ソースは、ユニバーサルLinuxカーネルバージョンを指すものではありません。 ArmSoM ハードウェア検証は行いません。

出典:中国と英語のRKNN2サポートオペレータとコントレイント参照V2.5.0、374および384ページそれぞれ。 中国語は中国語版に続いています。英語、ロシア語、ドイツ語は英語版に従います。 プラットフォームの制約は分離されず、 英語PDF自体には中国語I/O図と出力テーブルが含まれており、その実証は編集可能なローカライズされたテーブルで保持されます。 ConvTranpose や元の LSTM/GRU などのソースのスペルが保存されます。これらの式は SDK 実装に修正されません。

出典ページ:CN 184–198;EN 189–204。

RockchipRKNN2

オペレータ参照シリーズ

RKNN2 V2.5.0・RK3566/RK3568:基本と進化

RKNN2 V2.5.0・RK3566/RK3568:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RK3566/RK3568:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RK3566/RK3568:活性化、正規化、拡張機能

RKNN2 V2.5.0・RK3588:基本と進化

RKNN2 V2.5.0・RK3588:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RK3588:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RK3588:アクティベーション、正規化、拡張機能

RKNN2 V2.5.0・RK3562:基本と進化

RKNN2 V2.5.0・RK3562:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RK3562:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RK3562:アクティベーション、正規化、拡張機能

RKNN2 V2.5.0・RV1103/RV1106:基本と進化

RKNN2 V2.5.0 · RV1103/RV1106:再流ネットワーク、算術およびプール

RKNN2 V2.5.0・RV1103/RV1106:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RV1103/RV1106:活性化、正規化、拡張機能

RKNN2 V2.5.0・RK3576/RV1126B:基本と進化

RKNN2 V2.5.0・RK3576/RV1126B:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RK3576/RV1126B:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RK3576/RV1126B:活性化、正規化、拡張機能

RKNN2 V2.5.0・RK2118:基本と進化

RKNN2 V2.5.0・RK2118:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RK2118:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RK2118:アクティベーション、正規化、拡張機能

RKNN2 V2.5.0・RV1103B/RV1106B:基本と進化

RKNN2 V2.5.0・RV1103B/RV1106B:再発ネットワーク、算術およびプール

RKNN2 V2.5.0・RV1103B/RV1106B:形状、スライシング、トランスポーズ

RKNN2 V2.5.0・RV1103B/RV1106B:活性化、正規化、拡張機能

RKNN2 V2.5.0・CPU オペレータサポートと制約

RKNN2 V2.5.0・GPU オペレータサポートと制約

RKNN2 V2.5.0・モデルI/O、アライメント、コンボリューション制限

ダイバーシティ

多方向性NumPyスタイルの放送をサポートする、要素単位のバイナリ分割(C=A/B)を実行

導入事例

  • A:T1,T2
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator
  • B:T1,T2
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator

出力

  • C:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer

データ型制約

  • T1:float16(センサー)
  • T2:float(constTensor)

拡大する

特定の形状や放送ルールに応じて入力テンソルをブロードキャストします。 放送ルールはnumpy.array(入力)* numpy.ones(形状):寸法は右揃えです。2つの対応する寸法は同じ値、または1つが同じ値でなければなりません

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
  • 形状:T2
    • shape:[batch,channel,height,width]

出力

  • 出力:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer

データ型制約

  • T1:int8(センサー)
  • T2:int64(センサー)

放送制約

  • [b,c,1,w]->[b,c,h,w],h∈[1,8192]
  • [b,1,1,w]->[b,c,h,w],h∈[1,8192]
  • [b,c,h,1]->[b,c,h,w],w ∈[1,8192]
  • [b,1,h,1]->[b,c,h,w],w ∈[1,8192]
  • [b,c,1,1]->[b,c,h,w],h∈[1,8192],w ∈[1,8192]

ハードウェア

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
      • channel∗height∗width<=8192
      • axis=1, height∗width<16384 and height∗width equal to 1 or greater than 8;
      • axis=3/-1, channel ∗ height < 16384, and channel ∗ height equal to 1 or greater than 8, and subject to the transpose specification constraints

出力

  • 出力:T1
    • shape:[batch,channel,height,width]

データ型制約

  • T1:int8(センサー)、float16(センサー)

属性

  • 軸線:int
    • The axis for hardmax: 1,3/-1, i.e., channel and width directions

その他のサポート

  • マルチコア:未対応

LSTM

長期短期記憶(LSTM) LSTM 拡張とバリアントは、exLSTM 演算子にちなんで名付けられます。 パラメータ項目は、exLSTM専用のパラメーターです。 計算式は以下の通りです。

Equations(Default:f=Sigmoid,g=Tanh,h=Tanh):
i_t = f(x_t · W_i + h_{t−1} · R_i + Wb_i + Rb_i)
f_t = f(x_t · W_f + h_{t−1} · R_f + Wb_f + Rb_f)
c_t = f(x_t · W_c + h_{t−1} · R_c + Wb_c + Rb_c)
o_t = f(x_t · W_o + h_{t−1} · R_o + Wb_o + Rb_o)
C_t = f_t ⊙ C_{t−1} + i_t ⊙ c_t
h_t = o_t ⊙ h(C_t)

導入事例

  • X:T1
    • shape:[seq_length,batch_size,input_size]
      • seqlength∈(0,8192]
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • inputsize∈(0,8192]
    • Quantization support
      • per-layer
  • W:T1
    • shape:[num_directions,4*hidden_size,input_size]
      • inputsize∈(0,8192]
      • hiddensize∈(0,8192]
      • numdirections:1or2
    • Quantization support
      • per-layer
      • per-channel
  • R:T1
    • shape:[num_directions,4*hidden_size,hidden_size]
      • hiddensize∈(0,8192]
      • numdirections:1or2
    • Quantization support
      • per-layer
      • per-channel
  • B:T2
    • shape:[num_directions,8*hidden_size]
      • hiddensize∈(0,8192]
      • numdirections:1or2
    • Quantization support
      • per-layer
      • per-channel
  • シーケンス_lens:T3(オプション)
    • shape:[batch_size]
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
  • 初期_h:T1(オプション)
    • shape:[num_directions,batch_size,hidden_size]
      • numdirections:1or2
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • hiddensize∈(0,8192]
    • Quantization support
      • per-layer
  • 初期_c:T3(オプション)
    • shape:[num_directions,batch_size,hidden_size]
      • numdirections:1or2
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • hiddensize∈(0,8192]
    • Quantization support
      • per-layer

出力

  • Y:T1
    • shape:[seq_length,num_directions,batch_size,hidden_size]
      • seqlength∈(0,8192]
      • numdirections:1or2
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • hiddensize∈(0,8192]
    • Quantization support
      • per-layer
  • Y_h:T1(オプション)
    • shape:[num_directions,batch_size,hidden_size]
      • numdirections:1or2
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • hiddensize∈(0,8192]
    • Quantization support
      • per-layer
  • Y_c:T1(オプション)
    • shape:[num_directions,batch_size,hidden_size]
      • numdirections:1or2
      • batchsize∈(0,8192], when greater than 1, only multiples of 4 are supported
      • hiddensize∈(0,8192]
    • Quantization support
      • per-layer

属性

  • 方向(外部):ひも
    • Specifies the computation direction of the LSTM
    • forward: specifies the computation direction of the LSTM as forward
    • reverse: specifies the computation direction of the LSTM as reverse
    • bidirectional: specifies the computation direction of the LSTM as bidirectional
  • シーケンス_size(外部):int
    • The seqsize of the LSTM input, no limitation, 4-alignment recommended
  • hidden_size(外部):int
    • The hiddensize in the LSTM cell, no limitation, 8-alignment recommended
  • proj_size(外部):int
    • The proj_size for projection, projsize∈[0,hiddensize]
    • Currently limited to 0, i.e. projection is not yet supported
  • 入出力_forget(外部):int
    • cifgvariant selection: 1(T) or 0(F), currently limited to 0, i.e. not yet supported
  • has_projection(外部):int
    • projection variant: 1(T) or 0(F), currently limited to 0, i.e. not yet supported
  • 入出力(外部):int
    • Specifies the layout consistent with the meaning of the corresponding input shape
    • Requires filling in the specified layout, and also requires filling in the batch_size, sequence_size, hidden_size。
    • snc: specifies the input shape corresponding to the layout as [seqs,batches,input_size]
    • (sn)c: specifies the input shape corresponding to the layout as [seqs*batches,input_size,1,1]
  • output_layout(外部):int
    • Specifies the layout consistent with the meaning of the corresponding output shape
    • Requires filling in the specified layout, and also requires filling in the batch_size, sequence_size, hidden_size、directions。
    • sbnc: specifies the output shape corresponding to the layout as [seqs,directions,batches,hidden_size]
    • (sn)c: specifies the output shape corresponding to the layout as [seqsbatches,directionsinput_size,1,1]

データ型制約

  • T1:int8(センサー)
  • T2:int32(センサー)
  • T3:int(スカラー)

その他のサポート

  • マルチコア:未対応

マックス

入力テンソルの要素単位の最大値を計算します。

導入事例

  • A:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator
  • B:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator

出力

  • C:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer/per-channel

データ型制約

  • T1:int8(センサー)、float16(センサー)

その他のサポート

  • マルチコア:未対応

分

入力テンソルの要素単位の最小値を計算します。

導入事例

  • A:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator
  • B:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator

出力

  • C:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer/per-channel

データ型制約

  • T1:int8(センサー)、float16(センサー)

その他のサポート

  • マルチコア:未対応

マル

複数の方向性NumPyスタイルの放送をサポートする、要素単位のバイナリ乗算(C=A*B)を実行します

導入事例

  • A:T1,T2
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator
  • B:T1,T2
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
    • Broadcasting support
      • Supports broadcasting along arbitrary dimensions
      • Broadcasting constraints are the same as the Expand operator

出力

  • C:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer

データ型制約

  • T1:int8(センサー)
  • T2:float(constTensor)

マルレル

溶融焼結、C=Relu(A*B)

導入事例

  • 同じようにMul

出力

  • 同じようにMul

その他のサポート

  • 多中心: 支えられる

パッド

それぞれの軸、モード(モード)、定数値(constant_value)の開始と終了のパディング値を含む、データを含むテンソル(データ)を、パッドを入れられたテンソル(出力)を生成し、

導入事例

  • データ:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
  • パッド:T2
    • shape : [batch_begin, channel_begin, height_begin, width_begin, batch_end, channel_end,height_end,width_end]
  • 定数_value(オプション):T3
    • shape:[1]
    • Quantization support
      • per-layer

出力

  • 出力:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer

データ型制約

  • T1:int8(センサー)
  • T2:int64(センサー)
  • T3:float(スカラー)、int8(スカラー)、float16(スカラー)

属性

  • モード: 文字列 (デフォルト値定数)
    • Supported modes: constant, reflect
      • constantNo limitation
      • reflectchannel∈(0,8192],height∈(0,8192],width∈(0,8176]

その他のサポート

  • マルチコア:未対応

マックスプール

MaxPool は入力テンソル X を消費し、カーネルのサイズ、ストライトサイズ、パディング長さに応じてテンソルに最大プールを適用します。 マックス・プールは、カーネルのサイズに応じて入力テンソルのサブセットのすべての値で最大を計算し、データを出力テンソルYにダウンサンプリングして、さらなる処理を行います。 出力空間形状の計算は、明示的なパディング(パッド使用時)か自動パディング(オート_pad使用時)が使用されるかによって異なります。 明示的なパディングのみが使用されます

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
      • channel∈(0,8192]
      • height∈(0,8192]
      • width∈(0,8192]

出力

  • 出力:T1
    • shape:[batch,channel,height,width]

属性

  • カーネル_shape:int64(kernel_h,kernel_w)
    • kernel_h∈(0,7]
    • kernel_w∈(0,7]
  • auto_pad:string の
    • Padding mode: only NOTSET is supported
  • ceil_mode:int64 の使い方
    • Whether to use ceil or floor to compute the output shape: not supported
  • ストライド:int64(strides_h,strides_w)
    • strides_h∈(0,8]
    • strides_w∈(0,8]
  • count_include_pad:int64[] の指定は行いません。
    • count_include_pad, whether to include pad values in computation: 1
  • パッド:int64(パッド_top、パッド_left、パッド_bottom、パッド_right)
    • pad_top∈[0,7]
    • pad_left∈[0,7]
    • pad_bottom∈[0,7]
    • pad_right∈[0,7]
  • ストレージ_order:int64[]
    • The preferred storage mode: 0

データ型制約

  • T1:int8(センサー)、float16(センサー)
  • T2:フロート(センサー)
  • T3:float(スカラー)

グローバルマックスプール

GlobalMaxPool は入力テンソル X を消費し、同じチャネルの値を上回る最大プールを適用します。 これは、入力の空間次元に等しいカーネル_shape と MaxPool に等しいです。

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
      • channel∈(0,8192]
      • height∈(0,7]
      • width∈(0,7]

出力

  • 出力:T1
    • shape:[batch,channel,height,width]

属性

  • カーネル_shape:int64(kernel_h,kernel_w)
    • kernel_h∈(0,7]
    • kernel_w∈(0,7]
  • auto_pad:string の
    • Padding mode: only NOTSET is supported
  • ceil_mode:int64 の使い方
    • Whether to use ceil or floor to compute the output shape: not supported
  • ストライド:int64(strides_h,strides_w)
    • strides_h∈(0,8]
    • strides_w∈(0,8]
  • count_include_pad:int64[] の指定は行いません。
    • count_include_pad, whether to include pad values in computation: 1
  • パッド:int64(パッド_top、パッド_left、パッド_bottom、パッド_right)
    • pad_top∈[0,7]
    • pad_left∈[0,7]
    • pad_bottom∈[0,7]
    • pad_right∈[0,7]

データ型制約

  • T1:int8(センサー)、float16(センサー)
  • T2:フロート(センサー)
  • T3:float(スカラー)

平均プール

平均プールは入力テンソルXを消費し、カーネルサイズ、ストライトサイズ、およびパディング長さに応じてテンソルに平均プールを適用します。 平均プールは、カーネルサイズに応じて入力テンソルのサブセットのすべての値の平均値よりも平均を計算し、データを出力テンソルYにダウンサンプリングして、さらなる処理を行います。 出力空間形状の計算は、明示的なパディング(パッド使用時)か自動パディング(オート_pad使用時)が使用されるかによって異なります。 明示的なパディングのみが使用されます

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
      • channel∈(0,8192]
      • height∈(0,8192]
      • width∈(0,8192]

出力

  • 出力:T1
    • shape:[batch,channel,height,width]

属性

  • カーネル_shape:int64(kernel_h,kernel_w)
    • kernel_h∈(0,7]
    • kernel_w∈(0,7]
  • auto_pad:string の
    • Padding mode: only NOTSET is supported
  • ceil_mode:int64 の使い方
    • Whether to use ceil or floor to compute the output shape: not supported
  • ストライド:int64(strides_h,strides_w)
    • strides_h∈(0,8]
    • strides_w∈(0,8]
  • count_include_pad:int64[] の指定は行いません。
    • count_include_pad, whether to include pad values in computation: 1
  • パッド:int64(パッド_top、パッド_left、パッド_bottom、パッド_right)
    • pad_top∈[0,7]
    • pad_left∈[0,7]
    • pad_bottom∈[0,7]
    • pad_right∈[0,7]

データ型制約

  • T1:int8(センサー)、float16(センサー)
  • T2:フロート(センサー)
  • T3:float(スカラー)

GlobalAveragePool(グローバルアヴァージプール)

GlobalAveragePool は入力テンソル X を消費し、同じチャネルの値を平均プールします。 これは、入力テンソルの空間寸法に等しいカーネル_shapeとAveragePoolと等しいです。

導入事例

  • 入力:T1
    • shape:[batch,channel,height,width]
      • channel∈(0,8192]
      • height∈(0,7]
      • width∈(0,7]

出力

  • 出力:T1
    • shape:[batch,channel,height,width]

属性

  • カーネル_shape:int64(kernel_h,kernel_w)
    • kernel_h∈(0,7]
    • kernel_w∈(0,7]
  • auto_pad:string の
    • Padding mode: only NOTSET is supported
  • ceil_mode:int64 の使い方
    • Whether to use ceil or floor to compute the output shape: not supported
  • ストライド:int64(strides_h,strides_w)
    • strides_h∈(0,8]
    • strides_w∈(0,8]
  • count_include_pad:int64[] の指定は行いません。
    • count_include_pad, whether to include pad values in computation: 1
  • パッド:int64(パッド_top、パッド_left、パッド_bottom、パッド_right)
    • pad_top∈[0,7]
    • pad_left∈[0,7]
    • pad_bottom∈[0,7]
    • pad_right∈[0,7]

データ型制約

  • T1:int8(センサー)、float16(センサー)
  • T2:フロート(センサー)
  • T3:float(スカラー)

プッフ

Z = X^Y の応答操作、入力データ(センサー)および指数関数をとり、1 つの出力データ(センサー)を作り出します

導入事例

  • X:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer
  • Y:T2
    • shape:[1]
      • Currently only 0, 1, 2, 3, 0.5, -0.5 are supported

出力

  • Z:T1
    • shape:[batch,channel,height,width]
    • Quantization support
      • per-layer

データ型制約

  • T1:int8(センサー)、float16(センサー)
  • T2:int8(センサー)、int32(センサー)、int64(センサー)、float16(センサー)、float(センサー)

その他のサポート

  • マルチコア:未対応

このトピックを詳しく見る → · 学習ガイド →