この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 307–317;EN 316–326。
オペレータ参照シリーズ
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・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・RV1103B/RV1106B:基本と進化
RKNN2 V2.5.0・RV1103B/RV1106B:再発ネットワーク、算術およびプール
RKNN2 V2.5.0・RV1103B/RV1106B:形状、スライシング、トランスポーズ
シグモイド
入力テンソルを与えられた、関数 y=1/(1+exp(-x) は出力テンソルを生成するために入力テンソルに要素単位で加えられます
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
タン
指定した入力テンソル要素のハイパーボリックな形を計算します。
導入事例
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
出力
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
データ型制約
- T1:float16(センサー)
ソフトプラス
Softplus 関数要素を y=ln(exp(x)+1) に指定します。
導入事例
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
出力
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
データ型制約
- T1:float16(センサー)
硬いシグミノイド
入力テンソルを与えられた、関数 y=max(0,min(1,alpha*x+beta)) は、出力テンソルを生成するために入力テンソルに要素単位で適用されます。
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
硬いスウェーデン
HardSwish 関数要素を賢く、y = x * max(0, min(1, alpha * x + beta)) = x * HardSigmoid(x), alpha=1/6, beta=0.5
導入事例
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
出力
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
データ型制約
- T1:float16(センサー)
ソリューション
入力テンソルを、x<0、f(x)=xのx>=0のための機能f(x)=alpha*(exp(x)-1.)は出力テンソルを作り出すために入力テンソルに要素単位で加えられます、 alpha=1
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
exSwish
ジグモイドリニアユニット関数要素を同様に適用します。 Swish 関数は SiLU 関数、y=x*sigmoid(x) とも呼ばれます
導入事例
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
出力
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
データ型制約
- T1:float16(センサー)
exMish
入力テンソル、関数のimh(x)=xtanh(softplus(x))=xtanh(ln(1+e^{x}))を、出力テンソルを生成するために入力テンソルに要素単位で加えられます
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
exGelu
入力テンソルを与えられたy=x*Φ(x)は出力テンソルを生成するために要素単位で加えられます。 Φ(x) が tanh に設定されるとき: y=0.5*x*(1+Tanh(sqrt(2/π)*(x+0.044715*x^3)))))。
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
どこまでも
マスク_tensor の x_tensor や y_tensor の値を取得します。 マスク_tensor のポジションが真の場合、対応する位置の x_tensor の値が取られます。そうしないと、y_tensor の値が取り込まれます。
導入事例
- マスク_tensor:T1
- shape:[batch,channel,height,width]
- Broadcasting support
- Supports broadcasting along arbitrary dimensions
- Broadcasting constraints
- Broadcasting constraints are the same as the Expand operator
- x_tensor:*T2 の
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
- Broadcasting support
- Supports broadcasting along arbitrary dimensions
- Broadcasting constraints
- Broadcasting constraints are the same as the Expand operator
- y_tensor:T1 の
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
- Broadcasting support
- Supports broadcasting along arbitrary dimensions
- Broadcasting constraints
- Broadcasting constraints are the same as the Expand operator
出力
- 出力:T2
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
データ型制約
- T1:bool (センサー)
- T2:float16(センサー)
exConvStreaming
スピーチモデルの遅延を抑えるために、元のコンボリューションの入力は、複数の時間枠のスライスに分けられます。 各タイムフレームのスライスは、コンボリューションを計算するために入力として使用され、結果はその後の時間枠のためにキャッシュされ、それによってストリーミングオーディオ処理を実現します。
導入事例
- 入出力_tensor:T1
- shape:[batch,channel,height,width]
- width: currently width=1 is supported.
- Quantization support
- per-layer
- shape:[batch,channel,height,width]
- 体重:T1
- shape:[output_channel,input_channel,kernel_h,kernel_w]
- kernel_h∈[1,31]
- kernel_w∈[1,31]
- Quantization support
- per-layer
- per-channel
- shape:[output_channel,input_channel,kernel_h,kernel_w]
出力
- 出力:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
属性
- strides:int(strides_h,strides_w) の文字列を生成します。
- stride_h∈[1,7]
- stride_w∈[1,7]
- パッド:int(pads_top、pads_left、pads_bottom、pads_right)
- pads_top∈[0,15]
- pads_left∈[0,15]
- pads_bottom∈[0,15]
- pads_right∈[0,15]
- グループ:int
- 関係:int(dilations_h、dilations_w)
- dilations_h∈[1,32]
- dilations_w∈[1,32]
データ型制約
- T1:float16(センサー)
その他のサポート
- マルチコア:未対応
exConvStreamingPRelu/LeakyRelu(リーキール)
exConvStreamingおよびPRelu/LeakyReluの溶断された計算、出力= PRelu (exConvStreaming (入力)またはOutput= LeakyRelu (exConvStreaming (入力))。 記述および指定の制約はexConvStreamingと同じです
exGlu
出力された線形単位機能、入力行列の先頭半分であり、bは2番目の半分のGLU(a,b)=aσ(b)です
導入事例
- 入力:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
出力
- 出力:T1
- shape:[batch,channel/2,height,width]
- Quantization support:per-layer
データ型制約
- T1:float16(センサー)
属性
- axis: int (デフォルト値 = 1)
- The dimension to split the input
- Constraint: only 1 is supported
exMatMul
マトリックスの乗算操作
Y = A·B + C if c_type = "add"
Y = A·B * C if c_type = "mul"
導入事例
- A:T1
- shape:[b,k,1,n]
- k ∈(0,8192]
- Quantization support
- per-layer
- shape:[b,k,1,n]
- B:T1
- shape:[b,k,1,m]
- Quantization support
- per-layer
- C (任意):T1、T2
- shape:[b,n,1,m]
- Quantization support
- per-layer
- Broadcasting support
- Supports broadcasting along arbitrary dimensions
- Broadcasting constraints are the same as the Expand operator
出力
- Y:T1
- shape:[b,n,1,m]
- Quantization support
- per-layer
データ型制約
- T1:float16(センサー)
- T2:フロート(センサー)
属性
- c_type: 文字列 (デフォルト “add”)
- add and mul are optional, indicating whether C is added or multiplied
exWindow
exWindowは、swin_transformerのwindow_partitionとwindow_reverse操作から始まります。 オリジナルの紙では、入力機能は複数の非重複ウィンドウに分割され、各サイズのウィンドウ_size×window_size。 入出力機能と出力機能は、高さと幅のどちらの方向でも4次元形状で分割する必要があります。 pytorch の実装は以下のとおりです。
def window_partition(x, window_size):
"""
Args:
x: (B, C, H, W)
window_size (int): window size
Returns:
windows: (B, C, num_windows * num_windows, window_size * window_size)
"""
B, C, H, W = x.shape
x = x.view(B, C, H // window_size, window_size, W // window_size, window_size)
windows = x.permute(0, 1, 2, 4, 3, 5).contiguous().view(B, C, -1, window_size * window_size)
return windows
def window_reverse(windows, window_size, H, W):
"""
Args:
windows: (B, C, num_windows * num_windows, window_size * window_size)
window_size (int): Window size
H (int): Height of image
W (int): Width of image
Returns:
x: (B, C, H, W)
"""
B, C, _, _ = windows.shape
x = windows.view(B, C, H // window_size, W // window_size, window_size, window_size)
x = x.permute(0, 1, 2, 4, 3, 5).contiguous().view(B, C, H, W)
return x
導入事例
- X:T1
- shape:[batch,channel,height,width]
出力
- Y:T1
- shape:[batch,channel,height,width]
データ型制約
- T1:float16(センサー)
属性
- モード:string
- Supported modes: partition, reverse, partition_num_first
- partition: implemented with reference to window_partition;
- reverse: implemented with reference to window_reverse;
- partition_num_first: the difference from partition is that the H,W of partition_num_first are divided according to num_windows, while the H,W of partition are divided according to window_sizes.
- Supported modes: partition, reverse, partition_num_first
- window_sizes:listofints の一覧
- A 2-dimensional vector, the window size. Defines the height and width of each window. Attention computation and feature extraction within the window are based on this size.
- num_windows:listofints(リストフォート)
- A 2-dimensional vector, the number of windows. Defines how many windows the height and width of the input feature are divided into.
その他のサポート
- マルチコア:未対応
