Cette référence de plate-forme RKNN2 V2.5.0 aide les développeurs ArmSoM à sélectionner et adapter les modèles. Il n’établit pas de support sur chaque carte ArmSoM: vérifier la carte SoC, Toolkit2, Runtime, pilote NPU et versions BSP. La source ne spécifie aucune version universelle du noyau Linux. Aucune validation matérielle ArmSoM n’a été effectuée.
Source: RKNN2 chinois et anglais, respectivement, pour les opérateurs et les contraintes. Le chinois suit l’édition chinoise; l’anglais, le russe et l’allemand suivent l’édition anglaise. Les contraintes liées à la plate-forme demeurent distinctes. Le PDF anglais contient des chiffres d’entrées-sorties et des tableaux de sortie chinois; leur provenance est conservée avec des tableaux localisés modifiables. Les orthographes sources comme ConvTranpose et les équations LSTM/GRU originales sont conservées; ces équations ne sont pas des corrections aux implémentations SDK.
Pages sources: CN 211–220; EN 217–227.
Série de référence de l'opérateur
RKNN2 V2.5.0 · RK3566/RK3568: Bases et convolution
RKNN2 V2.5.0 · RK3566/RK3568:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RK3566/RK3568: Formes, slices et transposes
RKNN2 V2.5.0 · RK3566/RK3568:Activités, normalisation et extensions
RKNN2 V2.5.0 · RK3588: Bases et convolution
RKNN2 V2.5.0 · RK3588:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RK3588: Formes, slices et transposes
RKNN2 V2.5.0 · RK3588:Activités, normalisation et extensions
RKNN2 V2.5.0 · RK3562: Bases et convolution
RKNN2 V2.5.0 · RK3562:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RK3562: Formes, slices et transposes
RKNN2 V2.5.0 · RK3562:Activités, normalisation et extensions
RKNN2 V2.5.0 · RV1103/RV1106: Bases et convolution
RKNN2 V2.5.0 · RV1103/RV1106:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RV1103/RV1106: Formes, slices et transposes
RKNN2 V2.5.0 · RV1103/RV1106:Activités, normalisation et extensions
RKNN2 V2.5.0 · RK3576/RV1126B: Bases et convolution
RKNN2 V2.5.0 · RK3576/RV1126B:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RK3576/RV1126B: Formes, slices et transposes
RKNN2 V2.5.0 · RK3576/RV1126B:Activités, normalisation et extensions
RKNN2 V2.5.0 · RK2118: Bases et convolution
RKNN2 V2.5.0 · RK2118:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RK2118: Formes, slices et transposes
RKNN2 V2.5.0 · RK2118:Activités, normalisation et extensions
RKNN2 V2.5.0 · RV1103B/RV1106B: Bases et convolution
RKNN2 V2.5.0 · RV1103B/RV1106B:Réseaux renouvelables, arithmétiques et mise en commun
RKNN2 V2.5.0 · RV1103B/RV1106B: Formes, slices et transposes
RKNN2 V2.5.0 · RV1103B/RV1106B:Activités, normalisation et extensions
RKNN2 V2.5.0 · Prise en charge et contraintes de l’opérateur CPU
RKNN2 V2.5.0 · Support et contraintes de l’opérateur GPU
RKNN2 V2.5.0 · Modèle I/O, limites d’alignement et de convolution
Sigmoïde
Compte tenu d’un tenseur d’entrée, la fonction y=1/(1+exp(-x)) est appliquée par élément au tenseur d’entrée pour produire le tenseur de sortie.
Entrées
- entrée:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Tanh
Calcule la tangente hyperbolique de l’élément tenseur d’entrée donné-sise
Entrées
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Produits
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Plus doux
Applique l’élément de fonction Softplus dans le sens y=ln(exp(x)+1)
Entrées
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Produits
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Sigmoïde dur
Étant donné un tenseur d’entrée, la fonction y=max(0,min(1,alpha*x+beta)) est appliquée par élément au tenseur d’entrée pour produire le tenseur de sortie, où alpha=1/6, beta=0,5
Entrées
- entrée:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Swish dur
Applique l’élément de fonction HardSwish dans le sens y = x * max(0, min(1, alpha * x + bêta)) = x * HardSigmoid(x), où alpha=1/6, beta=0,5
Entrées
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Produits
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Élu
Étant donné un tenseur d’entrée, la fonction f(x)=alpha*(exp(x)-1.) pour x<0, f(x)=x pour x>=0 est appliquée en sens de l’élément au tenseur d’entrée pour produire le tenseur de sortie, où alpha=1
Entrées
- entrée:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
exSwish
Applique l’élément de fonction de l’unité linéaire Sigmoïde. La fonction Swish est aussi connue sous le nom de fonction SiLU, y=x*sigmoid(x)
Entrées
- X:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Produits
- Y:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
exMish
Compte tenu d’un tenseur d’entrée, la fonction mish(x)=xtanh(softplus(x))=xtanh(ln(1+e^{x}) est appliquée par élément au tenseur d’entrée pour produire le tenseur de sortie.
Entrées
- entrée:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
exGelu
Étant donné qu’il s’agit d’un tenseur d’entrée, y=x*Φ(x) est appliqué par élément pour produire le tenseur de sortie. Lorsque Φ(x) est réglé à tân: y=0,5*x*(1+Tanh(sqrt(2/π)*(x+0,044715*x^3))
Entrées
- entrée:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
où
Obtient des valeurs à partir de x_tensor ou y_tensor selon mask_tensor. Lorsque la position de mask_tensor est True, la valeur de x_tensor à la position correspondante est prise; sinon, la valeur de y_tensor est prise.
Entrées
- masque_tenseur: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_tenseur:*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
- _tenseur : 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
Produits
- sortie:T2
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:bool(Teneur)
- T2:int8(Tensor), flocons16(Tensor)
exGlu
Fonction de l’unité linéaire graduée, où a est la première moitié de la matrice d’entrée et b est la seconde moitié GLU(a,b)=a-
Entrées
- Entrée:T1
- shape:[batch,channel,height,width]
- Quantization support:per-layer
Produits
- Produit:T1
- shape:[batch,channel/2,height,width]
- Quantization support:per-layer
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Attributs
- axe: int (valeur par défaut = 1)
- The dimension to split the input
- Constraint: only 1 is supported
exMatMul
Opération de multiplication des matrices
Y = A·B + C if c_type = "add"
Y = A·B * C if c_type = "mul"
Entrées
- 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(facultatif):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
Produits
- Y:T1
- shape:[b,n,1,m]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Teneur)
- T2:flux(Teneur)
Attributs
- c_type : chaînes (par défaut “add”)
- add and mul are optional, indicating whether C is added or multiplied
exSDPAttention
Calcule l’attention à l’échelle du produit point (SDPA) entre la requête, la clé et la valeur
Entrées
- requête :T1
- shape:[batch,channel,height,width]
- channel∈(0,8192]
- Quantization support
- per-layer
- shape:[batch,channel,height,width]
- clé:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
- valeur:T1
- shape:[batch,channel,height,width]
- channel∈(0,8192]
- Quantization support
- per-layer
- shape:[batch,channel,height,width]
- masque(facultatif):T1,T2
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
- Broadcasting support
- By default, supports broadcasting along arbitrary dimensions
- Échelle(facultative):T3
Produits
- sortie:T1
- shape:[batch,channel,height,width]
- Quantization support
- per-layer
Type de données Contraintes
- T1:int8(Teneur)
- T2:flux(Teneur)
- T3:Flotte (Écalier)
exWindow
exWindow provient des opérations window_partition et window_revers de swin_transformer. Dans le papier original, les fonctions d’entrée sont divisées en plusieurs fenêtres non-overlaping, chacune de la taille window_size × window_size. Les caractéristiques d’entrée et de sortie doivent être des formes à 4 dimensions, séparées dans les directions de hauteur et de largeur. La mise en œuvre du système pytorch est la suivante :
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
Entrées
- X:T1
- shape:[batch,channel,height,width]
Produits
- Y:T1
- shape:[batch,channel,height,width]
Type de données Contraintes
- T1:int8(Tensor), flocons16(Tensor)
Attributs
- mode:chaîne
- 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.
Autres services d ‘ appui
- Multi-core : Pas encore pris en charge
