Merged
feat: vector算子适配ascend960pr(DV122)平台(1/4) #14184
feat: vector算子适配ascend960pr(DV122)平台(1/4) #14184
Merged
biabuAdd on 10 days ago
Total: 122 files changed+230863-559
@@ -10,7 +10,7 @@
10# ----------------------------------------------------------------------------10# ----------------------------------------------------------------------------
11 11 
12# 设置算子定义时支持的芯片类型12# 设置算子定义时支持的芯片类型
13-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")13+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
15-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")15+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE elu_grad_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE elu_grad_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,191 @@
1+{
2+ "op_type": "EluGradV2",
3+ "op_list": [
4+ {
5+ "bin_filename": "EluGradV2_bca8d7b97fd48624e0f393b4822421a3",
6+ "inputs": [
7+ {
8+ "name": "grads",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "activations",
20+ "index": 1,
21+ "dtype": "bfloat16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ }
29+ ],
30+ "outputs": [
31+ {
32+ "name": "y",
33+ "index": 0,
34+ "dtype": "bfloat16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ],
43+ "attrs": [
44+ {
45+ "name": "alpha",
46+ "dtype": "float",
47+ "value": null
48+ },
49+ {
50+ "name": "scale",
51+ "dtype": "float",
52+ "value": null
53+ },
54+ {
55+ "name": "input_scale",
56+ "dtype": "float",
57+ "value": null
58+ },
59+ {
60+ "name": "is_result",
61+ "dtype": "bool",
62+ "value": null
63+ }
64+ ]
65+ },
66+ {
67+ "bin_filename": "EluGradV2_1c2d311a52d715e2d830e5c82c5ce2a7",
68+ "inputs": [
69+ {
70+ "name": "grads",
71+ "index": 0,
72+ "dtype": "float16",
73+ "format": "ND",
74+ "paramType": "required",
75+ "shape": [
76+ -2
77+ ],
78+ "format_match_mode": "FormatAgnostic"
79+ },
80+ {
81+ "name": "activations",
82+ "index": 1,
83+ "dtype": "float16",
84+ "format": "ND",
85+ "paramType": "required",
86+ "shape": [
87+ -2
88+ ],
89+ "format_match_mode": "FormatAgnostic"
90+ }
91+ ],
92+ "outputs": [
93+ {
94+ "name": "y",
95+ "index": 0,
96+ "dtype": "float16",
97+ "format": "ND",
98+ "paramType": "required",
99+ "shape": [
100+ -2
101+ ],
102+ "format_match_mode": "FormatAgnostic"
103+ }
104+ ],
105+ "attrs": [
106+ {
107+ "name": "alpha",
108+ "dtype": "float",
109+ "value": null
110+ },
111+ {
112+ "name": "scale",
113+ "dtype": "float",
114+ "value": null
115+ },
116+ {
117+ "name": "input_scale",
118+ "dtype": "float",
119+ "value": null
120+ },
121+ {
122+ "name": "is_result",
123+ "dtype": "bool",
124+ "value": null
125+ }
126+ ]
127+ },
128+ {
129+ "bin_filename": "EluGradV2_b10fb8d3846dab1d7af1173889aff103",
130+ "inputs": [
131+ {
132+ "name": "grads",
133+ "index": 0,
134+ "dtype": "float32",
135+ "format": "ND",
136+ "paramType": "required",
137+ "shape": [
138+ -2
139+ ],
140+ "format_match_mode": "FormatAgnostic"
141+ },
142+ {
143+ "name": "activations",
144+ "index": 1,
145+ "dtype": "float32",
146+ "format": "ND",
147+ "paramType": "required",
148+ "shape": [
149+ -2
150+ ],
151+ "format_match_mode": "FormatAgnostic"
152+ }
153+ ],
154+ "outputs": [
155+ {
156+ "name": "y",
157+ "index": 0,
158+ "dtype": "float32",
159+ "format": "ND",
160+ "paramType": "required",
161+ "shape": [
162+ -2
163+ ],
164+ "format_match_mode": "FormatAgnostic"
165+ }
166+ ],
167+ "attrs": [
168+ {
169+ "name": "alpha",
170+ "dtype": "float",
171+ "value": null
172+ },
173+ {
174+ "name": "scale",
175+ "dtype": "float",
176+ "value": null
177+ },
178+ {
179+ "name": "input_scale",
180+ "dtype": "float",
181+ "value": null
182+ },
183+ {
184+ "name": "is_result",
185+ "dtype": "bool",
186+ "value": null
187+ }
188+ ]
189+ }
190+ ]
191+ }
@@ -48,6 +48,7 @@ public:
48 this->AICore().AddConfig("ascend950", aicoreConfig);48 this->AICore().AddConfig("ascend950", aicoreConfig);
49 this->AICore().AddConfig("ascend350", aicoreConfig);49 this->AICore().AddConfig("ascend350", aicoreConfig);
50 this->AICore().AddConfig("ascend960dt", aicoreConfig);50 this->AICore().AddConfig("ascend960dt", aicoreConfig);
51+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
51 }52 }
52};53};
53 54 
@@ -9,8 +9,8 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE fast_gelu ACLNNTYPE aclnn_exclude15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE fast_gelu ACLNNTYPE aclnn_exclude
16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,92 @@
1+{
2+ "op_type": "FastGelu",
3+ "op_list": [
4+ {
5+ "bin_filename": "FastGelu_bf16",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ }
18+ ],
19+ "outputs": [
20+ {
21+ "name": "y",
22+ "index": 0,
23+ "dtype": "bfloat16",
24+ "format": "ND",
25+ "paramType": "required",
26+ "shape": [
27+ -2
28+ ],
29+ "format_match_mode": "FormatAgnostic"
30+ }
31+ ]
32+ },
33+ {
34+ "bin_filename": "FastGelu_fp16",
35+ "inputs": [
36+ {
37+ "name": "x",
38+ "index": 0,
39+ "dtype": "float16",
40+ "format": "ND",
41+ "paramType": "required",
42+ "shape": [
43+ -2
44+ ],
45+ "format_match_mode": "FormatAgnostic"
46+ }
47+ ],
48+ "outputs": [
49+ {
50+ "name": "y",
51+ "index": 0,
52+ "dtype": "float16",
53+ "format": "ND",
54+ "paramType": "required",
55+ "shape": [
56+ -2
57+ ],
58+ "format_match_mode": "FormatAgnostic"
59+ }
60+ ]
61+ },
62+ {
63+ "bin_filename": "FastGelu_fp32",
64+ "inputs": [
65+ {
66+ "name": "x",
67+ "index": 0,
68+ "dtype": "float32",
69+ "format": "ND",
70+ "paramType": "required",
71+ "shape": [
72+ -2
73+ ],
74+ "format_match_mode": "FormatAgnostic"
75+ }
76+ ],
77+ "outputs": [
78+ {
79+ "name": "y",
80+ "index": 0,
81+ "dtype": "float32",
82+ "format": "ND",
83+ "paramType": "required",
84+ "shape": [
85+ -2
86+ ],
87+ "format_match_mode": "FormatAgnostic"
88+ }
89+ ]
90+ }
91+ ]
92+}
@@ -35,6 +35,7 @@ public:
35 this->AICore().AddConfig("ascend950", aicoreConfig);35 this->AICore().AddConfig("ascend950", aicoreConfig);
36 this->AICore().AddConfig("ascend350", aicoreConfig);36 this->AICore().AddConfig("ascend350", aicoreConfig);
37 this->AICore().AddConfig("ascend960dt", aicoreConfig);37 this->AICore().AddConfig("ascend960dt", aicoreConfig);
38+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
38 }39 }
39};40};
40 41 
@@ -9,8 +9,8 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE fast_gelu_grad ACLNNTYPE aclnn_exclude15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE fast_gelu_grad ACLNNTYPE aclnn_exclude
16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,125 @@
1+{
2+ "op_type": "FastGeluGrad",
3+ "op_list": [
4+ {
5+ "bin_filename": "FastGeluGrad_bf16",
6+ "inputs": [
7+ {
8+ "name": "dy",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "x",
20+ "index": 1,
21+ "dtype": "bfloat16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ }
29+ ],
30+ "outputs": [
31+ {
32+ "name": "z",
33+ "index": 0,
34+ "dtype": "bfloat16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ]
43+ },
44+ {
45+ "bin_filename": "FastGeluGrad_fp16",
46+ "inputs": [
47+ {
48+ "name": "dy",
49+ "index": 0,
50+ "dtype": "float16",
51+ "format": "ND",
52+ "paramType": "required",
53+ "shape": [
54+ -2
55+ ],
56+ "format_match_mode": "FormatAgnostic"
57+ },
58+ {
59+ "name": "x",
60+ "index": 1,
61+ "dtype": "float16",
62+ "format": "ND",
63+ "paramType": "required",
64+ "shape": [
65+ -2
66+ ],
67+ "format_match_mode": "FormatAgnostic"
68+ }
69+ ],
70+ "outputs": [
71+ {
72+ "name": "z",
73+ "index": 0,
74+ "dtype": "float16",
75+ "format": "ND",
76+ "paramType": "required",
77+ "shape": [
78+ -2
79+ ],
80+ "format_match_mode": "FormatAgnostic"
81+ }
82+ ]
83+ },
84+ {
85+ "bin_filename": "FastGeluGrad_fp32",
86+ "inputs": [
87+ {
88+ "name": "dy",
89+ "index": 0,
90+ "dtype": "float32",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ],
96+ "format_match_mode": "FormatAgnostic"
97+ },
98+ {
99+ "name": "x",
100+ "index": 1,
101+ "dtype": "float32",
102+ "format": "ND",
103+ "paramType": "required",
104+ "shape": [
105+ -2
106+ ],
107+ "format_match_mode": "FormatAgnostic"
108+ }
109+ ],
110+ "outputs": [
111+ {
112+ "name": "z",
113+ "index": 0,
114+ "dtype": "float32",
115+ "format": "ND",
116+ "paramType": "required",
117+ "shape": [
118+ -2
119+ ],
120+ "format_match_mode": "FormatAgnostic"
121+ }
122+ ]
123+ }
124+ ]
125+}
@@ -40,6 +40,7 @@ public:
40 this->AICore().AddConfig("ascend950", aicoreConfig);40 this->AICore().AddConfig("ascend950", aicoreConfig);
41 this->AICore().AddConfig("ascend350", aicoreConfig);41 this->AICore().AddConfig("ascend350", aicoreConfig);
42 this->AICore().AddConfig("ascend960dt", aicoreConfig);42 this->AICore().AddConfig("ascend960dt", aicoreConfig);
43+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
43 }44 }
44};45};
45 46 
@@ -0,0 +1,209 @@
1+{
2+ "op_type": "GeGluGradV2",
3+ "op_list": [
4+ {
5+ "bin_filename": "GeGluGradV2_4b782442344783deb28f0e5df6fc4ae2",
6+ "inputs": [
7+ {
8+ "name": "dy",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "x",
20+ "index": 1,
21+ "dtype": "float16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ },
29+ {
30+ "name": "gelu",
31+ "index": 2,
32+ "dtype": "float16",
33+ "format": "ND",
34+ "paramType": "required",
35+ "shape": [
36+ -2
37+ ],
38+ "format_match_mode": "FormatAgnostic"
39+ }
40+ ],
41+ "outputs": [
42+ {
43+ "name": "dx",
44+ "index": 0,
45+ "dtype": "float16",
46+ "format": "ND",
47+ "paramType": "required",
48+ "shape": [
49+ -2
50+ ],
51+ "format_match_mode": "FormatAgnostic"
52+ }
53+ ],
54+ "attrs": [
55+ {
56+ "name": "dim",
57+ "dtype": "int",
58+ "value": null
59+ },
60+ {
61+ "name": "approximate",
62+ "dtype": "int",
63+ "value": null
64+ },
65+ {
66+ "name": "activate_left",
67+ "dtype": "bool",
68+ "value": null
69+ }
70+ ]
71+ },
72+ {
73+ "bin_filename": "GeGluGradV2_7bbd4899266f1a61e83c8bcb3ffa10f7",
74+ "inputs": [
75+ {
76+ "name": "dy",
77+ "index": 0,
78+ "dtype": "float32",
79+ "format": "ND",
80+ "paramType": "required",
81+ "shape": [
82+ -2
83+ ],
84+ "format_match_mode": "FormatAgnostic"
85+ },
86+ {
87+ "name": "x",
88+ "index": 1,
89+ "dtype": "float32",
90+ "format": "ND",
91+ "paramType": "required",
92+ "shape": [
93+ -2
94+ ],
95+ "format_match_mode": "FormatAgnostic"
96+ },
97+ {
98+ "name": "gelu",
99+ "index": 2,
100+ "dtype": "float32",
101+ "format": "ND",
102+ "paramType": "required",
103+ "shape": [
104+ -2
105+ ],
106+ "format_match_mode": "FormatAgnostic"
107+ }
108+ ],
109+ "outputs": [
110+ {
111+ "name": "dx",
112+ "index": 0,
113+ "dtype": "float32",
114+ "format": "ND",
115+ "paramType": "required",
116+ "shape": [
117+ -2
118+ ],
119+ "format_match_mode": "FormatAgnostic"
120+ }
121+ ],
122+ "attrs": [
123+ {
124+ "name": "dim",
125+ "dtype": "int",
126+ "value": null
127+ },
128+ {
129+ "name": "approximate",
130+ "dtype": "int",
131+ "value": null
132+ },
133+ {
134+ "name": "activate_left",
135+ "dtype": "bool",
136+ "value": null
137+ }
138+ ]
139+ },
140+ {
141+ "bin_filename": "GeGluGradV2_147d752bf646786400e51ae41943cce7",
142+ "inputs": [
143+ {
144+ "name": "dy",
145+ "index": 0,
146+ "dtype": "bfloat16",
147+ "format": "ND",
148+ "paramType": "required",
149+ "shape": [
150+ -2
151+ ],
152+ "format_match_mode": "FormatAgnostic"
153+ },
154+ {
155+ "name": "x",
156+ "index": 1,
157+ "dtype": "bfloat16",
158+ "format": "ND",
159+ "paramType": "required",
160+ "shape": [
161+ -2
162+ ],
163+ "format_match_mode": "FormatAgnostic"
164+ },
165+ {
166+ "name": "gelu",
167+ "index": 2,
168+ "dtype": "bfloat16",
169+ "format": "ND",
170+ "paramType": "required",
171+ "shape": [
172+ -2
173+ ],
174+ "format_match_mode": "FormatAgnostic"
175+ }
176+ ],
177+ "outputs": [
178+ {
179+ "name": "dx",
180+ "index": 0,
181+ "dtype": "bfloat16",
182+ "format": "ND",
183+ "paramType": "required",
184+ "shape": [
185+ -2
186+ ],
187+ "format_match_mode": "FormatAgnostic"
188+ }
189+ ],
190+ "attrs": [
191+ {
192+ "name": "dim",
193+ "dtype": "int",
194+ "value": null
195+ },
196+ {
197+ "name": "approximate",
198+ "dtype": "int",
199+ "value": null
200+ },
201+ {
202+ "name": "activate_left",
203+ "dtype": "bool",
204+ "value": null
205+ }
206+ ]
207+ }
208+ ]
209+ }
@@ -52,6 +52,7 @@ public:
52 this->AICore().AddConfig("ascend950", config91095);52 this->AICore().AddConfig("ascend950", config91095);
53 this->AICore().AddConfig("ascend350", config91095);53 this->AICore().AddConfig("ascend350", config91095);
54 this->AICore().AddConfig("ascend960dt", config91095);54 this->AICore().AddConfig("ascend960dt", config91095);
55+ this->AICore().AddConfig("ascend960pr", config91095);
55 56 
56 OpAICoreConfig config310p;57 OpAICoreConfig config310p;
57 config310p.DynamicCompileStaticFlag(true)58 config310p.DynamicCompileStaticFlag(true)
@@ -0,0 +1,176 @@
1+{
2+ "op_type": "GeGluV2",
3+ "op_list": [
4+ {
5+ "bin_filename": "GeGluV2_c629c03f5922badb3407bf2e66751e02",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ }
18+ ],
19+ "outputs": [
20+ {
21+ "name": "y",
22+ "index": 0,
23+ "dtype": "float16",
24+ "format": "ND",
25+ "paramType": "required",
26+ "shape": [
27+ -2
28+ ],
29+ "format_match_mode": "FormatAgnostic"
30+ },
31+ {
32+ "name": "gelu",
33+ "index": 1,
34+ "dtype": "float16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ],
43+ "attrs": [
44+ {
45+ "name": "dim",
46+ "dtype": "int",
47+ "value": null
48+ },
49+ {
50+ "name": "approximate",
51+ "dtype": "int",
52+ "value": null
53+ },
54+ {
55+ "name": "activate_left",
56+ "dtype": "bool",
57+ "value": null
58+ }
59+ ]
60+ },
61+ {
62+ "bin_filename": "GeGluV2_b629c03f5922badb3407bf2e66751e02",
63+ "inputs": [
64+ {
65+ "name": "x",
66+ "index": 0,
67+ "dtype": "float32",
68+ "format": "ND",
69+ "paramType": "required",
70+ "shape": [
71+ -2
72+ ],
73+ "format_match_mode": "FormatAgnostic"
74+ }
75+ ],
76+ "outputs": [
77+ {
78+ "name": "y",
79+ "index": 0,
80+ "dtype": "float32",
81+ "format": "ND",
82+ "paramType": "required",
83+ "shape": [
84+ -2
85+ ],
86+ "format_match_mode": "FormatAgnostic"
87+ },
88+ {
89+ "name": "gelu",
90+ "index": 1,
91+ "dtype": "float32",
92+ "format": "ND",
93+ "paramType": "required",
94+ "shape": [
95+ -2
96+ ],
97+ "format_match_mode": "FormatAgnostic"
98+ }
99+ ],
100+ "attrs": [
101+ {
102+ "name": "dim",
103+ "dtype": "int",
104+ "value": null
105+ },
106+ {
107+ "name": "approximate",
108+ "dtype": "int",
109+ "value": null
110+ },
111+ {
112+ "name": "activate_left",
113+ "dtype": "bool",
114+ "value": null
115+ }
116+ ]
117+ },
118+ {
119+ "bin_filename": "GeGluV2_a629c03f5922badb3407bf2e66751e02",
120+ "inputs": [
121+ {
122+ "name": "x",
123+ "index": 0,
124+ "dtype": "bfloat16",
125+ "format": "ND",
126+ "paramType": "required",
127+ "shape": [
128+ -2
129+ ],
130+ "format_match_mode": "FormatAgnostic"
131+ }
132+ ],
133+ "outputs": [
134+ {
135+ "name": "y",
136+ "index": 0,
137+ "dtype": "bfloat16",
138+ "format": "ND",
139+ "paramType": "required",
140+ "shape": [
141+ -2
142+ ],
143+ "format_match_mode": "FormatAgnostic"
144+ },
145+ {
146+ "name": "gelu",
147+ "index": 1,
148+ "dtype": "bfloat16",
149+ "format": "ND",
150+ "paramType": "required",
151+ "shape": [
152+ -2
153+ ],
154+ "format_match_mode": "FormatAgnostic"
155+ }
156+ ],
157+ "attrs": [
158+ {
159+ "name": "dim",
160+ "dtype": "int",
161+ "value": null
162+ },
163+ {
164+ "name": "approximate",
165+ "dtype": "int",
166+ "value": null
167+ },
168+ {
169+ "name": "activate_left",
170+ "dtype": "bool",
171+ "value": null
172+ }
173+ ]
174+ }
175+ ]
176+ }
@@ -49,6 +49,7 @@ public:
49 this->AICore().AddConfig("ascend950", config91095);49 this->AICore().AddConfig("ascend950", config91095);
50 this->AICore().AddConfig("ascend350", config91095);50 this->AICore().AddConfig("ascend350", config91095);
51 this->AICore().AddConfig("ascend960dt", config91095);51 this->AICore().AddConfig("ascend960dt", config91095);
52+ this->AICore().AddConfig("ascend960pr", config91095);
52 53 
53 OpAICoreConfig config310p;54 OpAICoreConfig config310p;
54 config310p.DynamicCompileStaticFlag(true)55 config310p.DynamicCompileStaticFlag(true)
@@ -9,7 +9,7 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gelu_grad ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE gelu_grad ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,158 @@
1+{
2+ "op_type": "GeluGrad",
3+ "op_list": [
4+ {
5+ "bin_filename": "GeluGrad_e87c9546cf2804355cf0d9445a2db01a",
6+ "inputs": [
7+ {
8+ "name": "dy",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "x",
20+ "index": 1,
21+ "dtype": "bfloat16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ },
29+ {
30+ "name": "y",
31+ "index": 2,
32+ "dtype": "bfloat16",
33+ "format": "ND",
34+ "paramType": "required",
35+ "shape": [
36+ -2
37+ ],
38+ "format_match_mode": "FormatAgnostic"
39+ }
40+ ],
41+ "outputs": [
42+ {
43+ "name": "z",
44+ "index": 0,
45+ "dtype": "bfloat16",
46+ "format": "ND",
47+ "paramType": "required",
48+ "shape": [
49+ -2
50+ ],
51+ "format_match_mode": "FormatAgnostic"
52+ }
53+ ]
54+ },
55+ {
56+ "bin_filename": "GeluGrad_1056052785b43db3ca4234fbf5e08c0e",
57+ "inputs": [
58+ {
59+ "name": "dy",
60+ "index": 0,
61+ "dtype": "float16",
62+ "format": "ND",
63+ "paramType": "required",
64+ "shape": [
65+ -2
66+ ],
67+ "format_match_mode": "FormatAgnostic"
68+ },
69+ {
70+ "name": "x",
71+ "index": 1,
72+ "dtype": "float16",
73+ "format": "ND",
74+ "paramType": "required",
75+ "shape": [
76+ -2
77+ ],
78+ "format_match_mode": "FormatAgnostic"
79+ },
80+ {
81+ "name": "y",
82+ "index": 2,
83+ "dtype": "float16",
84+ "format": "ND",
85+ "paramType": "required",
86+ "shape": [
87+ -2
88+ ],
89+ "format_match_mode": "FormatAgnostic"
90+ }
91+ ],
92+ "outputs": [
93+ {
94+ "name": "z",
95+ "index": 0,
96+ "dtype": "float16",
97+ "format": "ND",
98+ "paramType": "required",
99+ "shape": [
100+ -2
101+ ],
102+ "format_match_mode": "FormatAgnostic"
103+ }
104+ ]
105+ },
106+ {
107+ "bin_filename": "GeluGrad_54f1d1caf8fe36c496f699fefe98fbca",
108+ "inputs": [
109+ {
110+ "name": "dy",
111+ "index": 0,
112+ "dtype": "float32",
113+ "format": "ND",
114+ "paramType": "required",
115+ "shape": [
116+ -2
117+ ],
118+ "format_match_mode": "FormatAgnostic"
119+ },
120+ {
121+ "name": "x",
122+ "index": 1,
123+ "dtype": "float32",
124+ "format": "ND",
125+ "paramType": "required",
126+ "shape": [
127+ -2
128+ ],
129+ "format_match_mode": "FormatAgnostic"
130+ },
131+ {
132+ "name": "y",
133+ "index": 2,
134+ "dtype": "float32",
135+ "format": "ND",
136+ "paramType": "required",
137+ "shape": [
138+ -2
139+ ],
140+ "format_match_mode": "FormatAgnostic"
141+ }
142+ ],
143+ "outputs": [
144+ {
145+ "name": "z",
146+ "index": 0,
147+ "dtype": "float32",
148+ "format": "ND",
149+ "paramType": "required",
150+ "shape": [
151+ -2
152+ ],
153+ "format_match_mode": "FormatAgnostic"
154+ }
155+ ]
156+ }
157+ ]
158+}
@@ -52,6 +52,7 @@ public:
52 this->AICore().AddConfig("ascend950", aicoreConfig);52 this->AICore().AddConfig("ascend950", aicoreConfig);
53 this->AICore().AddConfig("ascend350", aicoreConfig);53 this->AICore().AddConfig("ascend350", aicoreConfig);
54 this->AICore().AddConfig("ascend960dt", aicoreConfig);54 this->AICore().AddConfig("ascend960dt", aicoreConfig);
55+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
55 }56 }
56};57};
57 58 
@@ -135,6 +135,7 @@ public:
135 this->AICore().AddConfig("ascend950", regbaseCfg);135 this->AICore().AddConfig("ascend950", regbaseCfg);
136 this->AICore().AddConfig("ascend350", regbaseCfg);136 this->AICore().AddConfig("ascend350", regbaseCfg);
137 this->AICore().AddConfig("ascend960dt", regbaseCfg);137 this->AICore().AddConfig("ascend960dt", regbaseCfg);
138+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
138 139 
139 OpAICoreConfig config_kirin = GetKirinCoreConfig();140 OpAICoreConfig config_kirin = GetKirinCoreConfig();
140 this->AICore().AddConfig("kirinx90", config_kirin);141 this->AICore().AddConfig("kirinx90", config_kirin);
@@ -9,8 +9,8 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE log_sigmoid ACLNNTYPE aclnn_exclude15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE log_sigmoid ACLNNTYPE aclnn_exclude
16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)16 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,92 @@
1+{
2+ "op_type": "LogSigmoid",
3+ "op_list": [
4+ {
5+ "bin_filename": "LogSigmoid_float16",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ }
18+ ],
19+ "outputs": [
20+ {
21+ "name": "y",
22+ "index": 0,
23+ "dtype": "float16",
24+ "format": "ND",
25+ "paramType": "required",
26+ "shape": [
27+ -2
28+ ],
29+ "format_match_mode": "FormatAgnostic"
30+ }
31+ ]
32+ },
33+ {
34+ "bin_filename": "LogSigmoid_float32",
35+ "inputs": [
36+ {
37+ "name": "x",
38+ "index": 0,
39+ "dtype": "float32",
40+ "format": "ND",
41+ "paramType": "required",
42+ "shape": [
43+ -2
44+ ],
45+ "format_match_mode": "FormatAgnostic"
46+ }
47+ ],
48+ "outputs": [
49+ {
50+ "name": "y",
51+ "index": 0,
52+ "dtype": "float32",
53+ "format": "ND",
54+ "paramType": "required",
55+ "shape": [
56+ -2
57+ ],
58+ "format_match_mode": "FormatAgnostic"
59+ }
60+ ]
61+ },
62+ {
63+ "bin_filename": "LogSigmoid_bfloat16",
64+ "inputs": [
65+ {
66+ "name": "x",
67+ "index": 0,
68+ "dtype": "bfloat16",
69+ "format": "ND",
70+ "paramType": "required",
71+ "shape": [
72+ -2
73+ ],
74+ "format_match_mode": "FormatAgnostic"
75+ }
76+ ],
77+ "outputs": [
78+ {
79+ "name": "y",
80+ "index": 0,
81+ "dtype": "bfloat16",
82+ "format": "ND",
83+ "paramType": "required",
84+ "shape": [
85+ -2
86+ ],
87+ "format_match_mode": "FormatAgnostic"
88+ }
89+ ]
90+ }
91+ ]
92+ }
@@ -42,6 +42,7 @@ public:
42 this->AICore().AddConfig("ascend950", aicoreConfig);42 this->AICore().AddConfig("ascend950", aicoreConfig);
43 this->AICore().AddConfig("ascend350", aicoreConfig);43 this->AICore().AddConfig("ascend350", aicoreConfig);
44 this->AICore().AddConfig("ascend960dt", aicoreConfig);44 this->AICore().AddConfig("ascend960dt", aicoreConfig);
45+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
45 }46 }
46};47};
47 48 
@@ -10,8 +10,8 @@
10 10 
11message(STATUS "=== Debug: start ops.activation.logsigmoid_grad.CMakeLists.txt ")11message(STATUS "=== Debug: start ops.activation.logsigmoid_grad.CMakeLists.txt ")
12# 设置算子定义时支持的芯片类型12# 设置算子定义时支持的芯片类型
13-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")13+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
15-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")15+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE logsigmoid_grad ACLNNTYPE aclnn_exclude16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE logsigmoid_grad ACLNNTYPE aclnn_exclude
17 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)17 COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,125 @@
1+{
2+ "op_type": "LogSigmoidGrad",
3+ "op_list": [
4+ {
5+ "bin_filename": "LogSigmoidGrad_float16",
6+ "inputs": [
7+ {
8+ "name": "grads",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "features",
20+ "index": 1,
21+ "dtype": "float16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ }
29+ ],
30+ "outputs": [
31+ {
32+ "name": "backprops",
33+ "index": 0,
34+ "dtype": "float16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ]
43+ },
44+ {
45+ "bin_filename": "LogSigmoidGrad_bfloat16",
46+ "inputs": [
47+ {
48+ "name": "grads",
49+ "index": 0,
50+ "dtype": "bfloat16",
51+ "format": "ND",
52+ "paramType": "required",
53+ "shape": [
54+ -2
55+ ],
56+ "format_match_mode": "FormatAgnostic"
57+ },
58+ {
59+ "name": "features",
60+ "index": 1,
61+ "dtype": "bfloat16",
62+ "format": "ND",
63+ "paramType": "required",
64+ "shape": [
65+ -2
66+ ],
67+ "format_match_mode": "FormatAgnostic"
68+ }
69+ ],
70+ "outputs": [
71+ {
72+ "name": "backprops",
73+ "index": 0,
74+ "dtype": "bfloat16",
75+ "format": "ND",
76+ "paramType": "required",
77+ "shape": [
78+ -2
79+ ],
80+ "format_match_mode": "FormatAgnostic"
81+ }
82+ ]
83+ },
84+ {
85+ "bin_filename": "LogSigmoidGrad_float32",
86+ "inputs": [
87+ {
88+ "name": "grads",
89+ "index": 0,
90+ "dtype": "float32",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ],
96+ "format_match_mode": "FormatAgnostic"
97+ },
98+ {
99+ "name": "features",
100+ "index": 1,
101+ "dtype": "float32",
102+ "format": "ND",
103+ "paramType": "required",
104+ "shape": [
105+ -2
106+ ],
107+ "format_match_mode": "FormatAgnostic"
108+ }
109+ ],
110+ "outputs": [
111+ {
112+ "name": "backprops",
113+ "index": 0,
114+ "dtype": "float32",
115+ "format": "ND",
116+ "paramType": "required",
117+ "shape": [
118+ -2
119+ ],
120+ "format_match_mode": "FormatAgnostic"
121+ }
122+ ]
123+ }
124+ ]
125+ }
@@ -42,6 +42,7 @@ public:
42 this->AICore().AddConfig("ascend950", aicoreConfig);42 this->AICore().AddConfig("ascend950", aicoreConfig);
43 this->AICore().AddConfig("ascend350", aicoreConfig);43 this->AICore().AddConfig("ascend350", aicoreConfig);
44 this->AICore().AddConfig("ascend960dt", aicoreConfig);44 this->AICore().AddConfig("ascend960dt", aicoreConfig);
45+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
45 }46 }
46};47};
47 48 
@@ -9,8 +9,8 @@
9# -----------------------------------------------------------------------------------------------------------9# -----------------------------------------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend5162")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr" "ascend5162")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35")
15 15 
16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE p_relu ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)16add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE p_relu ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,125 @@
1+{
2+ "op_type": "PRelu",
3+ "op_list": [
4+ {
5+ "bin_filename": "PRelu_93b3f8e9594b4018902b635fff3a83c5",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "weight",
20+ "index": 1,
21+ "dtype": "float16",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ }
29+ ],
30+ "outputs": [
31+ {
32+ "name": "y",
33+ "index": 0,
34+ "dtype": "float16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ]
43+ },
44+ {
45+ "bin_filename": "PRelu_9842884c99c006e21fc9d5d9260b1667",
46+ "inputs": [
47+ {
48+ "name": "x",
49+ "index": 0,
50+ "dtype": "bfloat16",
51+ "format": "ND",
52+ "paramType": "required",
53+ "shape": [
54+ -2
55+ ],
56+ "format_match_mode": "FormatAgnostic"
57+ },
58+ {
59+ "name": "weight",
60+ "index": 1,
61+ "dtype": "bfloat16",
62+ "format": "ND",
63+ "paramType": "required",
64+ "shape": [
65+ -2
66+ ],
67+ "format_match_mode": "FormatAgnostic"
68+ }
69+ ],
70+ "outputs": [
71+ {
72+ "name": "y",
73+ "index": 0,
74+ "dtype": "bfloat16",
75+ "format": "ND",
76+ "paramType": "required",
77+ "shape": [
78+ -2
79+ ],
80+ "format_match_mode": "FormatAgnostic"
81+ }
82+ ]
83+ },
84+ {
85+ "bin_filename": "PRelu_ee98c6628030785f610b924ab1557b31",
86+ "inputs": [
87+ {
88+ "name": "x",
89+ "index": 0,
90+ "dtype": "float32",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ],
96+ "format_match_mode": "FormatAgnostic"
97+ },
98+ {
99+ "name": "weight",
100+ "index": 1,
101+ "dtype": "float32",
102+ "format": "ND",
103+ "paramType": "required",
104+ "shape": [
105+ -2
106+ ],
107+ "format_match_mode": "FormatAgnostic"
108+ }
109+ ],
110+ "outputs": [
111+ {
112+ "name": "y",
113+ "index": 0,
114+ "dtype": "float32",
115+ "format": "ND",
116+ "paramType": "required",
117+ "shape": [
118+ -2
119+ ],
120+ "format_match_mode": "FormatAgnostic"
121+ }
122+ ]
123+ }
124+ ]
125+}
@@ -45,6 +45,7 @@ public:
45 this->AICore().AddConfig("ascend950", aicoreConfig);45 this->AICore().AddConfig("ascend950", aicoreConfig);
46 this->AICore().AddConfig("ascend350", aicoreConfig);46 this->AICore().AddConfig("ascend350", aicoreConfig);
47 this->AICore().AddConfig("ascend960dt", aicoreConfig);47 this->AICore().AddConfig("ascend960dt", aicoreConfig);
48+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
48 this->AICore().AddConfig("ascend5162", aicoreConfig);49 this->AICore().AddConfig("ascend5162", aicoreConfig);
49 }50 }
50};51};
@@ -9,7 +9,7 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend5162")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "mc62" "ascend350" "ascend960dt" "ascend960pr" "ascend5162")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE relu ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE relu ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -83,7 +83,8 @@ static bool CheckNotNull(const aclTensor* self, const aclTensor* other, const ac
83static inline const std::initializer_list<op::DataType>& GetDtypeSupportListBySocVersion()83static inline const std::initializer_list<op::DataType>& GetDtypeSupportListBySocVersion()
84{84{
85 auto curArch = GetCurrentPlatformInfo().GetCurNpuArch();85 auto curArch = GetCurrentPlatformInfo().GetCurNpuArch();
86- if (curArch == NpuArch::DAV_2201 || curArch == NpuArch::DAV_3510 || curArch == NpuArch::DAV_9201) {86+ if (curArch == NpuArch::DAV_2201 || curArch == NpuArch::DAV_3510 || curArch == NpuArch::DAV_9201 ||
87+ curArch == NpuArch::DAV_9202) {
87 return DTYPE_SUPPORT_LIST_WITH_BF16;88 return DTYPE_SUPPORT_LIST_WITH_BF16;
88 } else {89 } else {
89 return DTYPE_SUPPORT_LIST_WITHOUT_BF16;90 return DTYPE_SUPPORT_LIST_WITHOUT_BF16;
@@ -50,6 +50,7 @@ static bool CheckSocVersionIsSupportBf16(void)
50 switch (curArch) {50 switch (curArch) {
51 case NpuArch::DAV_2201:51 case NpuArch::DAV_2201:
52 case NpuArch::DAV_3510:52 case NpuArch::DAV_3510:
53+ case NpuArch::DAV_9202:
53 case NpuArch::DAV_9201: {54 case NpuArch::DAV_9201: {
54 return true;55 return true;
55 }56 }
@@ -0,0 +1,179 @@
1+{
2+ "op_type": "Relu",
3+ "op_list": [
4+ {
5+ "bin_filename": "Relu_1c4543fdfe7149b6b0717bd88f061562",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ }
18+ ],
19+ "outputs": [
20+ {
21+ "name": "y",
22+ "index": 0,
23+ "dtype": "bfloat16",
24+ "format": "ND",
25+ "paramType": "required",
26+ "shape": [
27+ -2
28+ ],
29+ "format_match_mode": "FormatAgnostic"
30+ }
31+ ]
32+ },
33+ {
34+ "bin_filename": "Relu_d2db1a80c523e7e59a032c95969880af",
35+ "inputs": [
36+ {
37+ "name": "x",
38+ "index": 0,
39+ "dtype": "float16",
40+ "format": "ND",
41+ "paramType": "required",
42+ "shape": [
43+ -2
44+ ],
45+ "format_match_mode": "FormatAgnostic"
46+ }
47+ ],
48+ "outputs": [
49+ {
50+ "name": "y",
51+ "index": 0,
52+ "dtype": "float16",
53+ "format": "ND",
54+ "paramType": "required",
55+ "shape": [
56+ -2
57+ ],
58+ "format_match_mode": "FormatAgnostic"
59+ }
60+ ]
61+ },
62+ {
63+ "bin_filename": "Relu_5c5e58e043224cccf51a06108010ae13",
64+ "inputs": [
65+ {
66+ "name": "x",
67+ "index": 0,
68+ "dtype": "float32",
69+ "format": "ND",
70+ "paramType": "required",
71+ "shape": [
72+ -2
73+ ],
74+ "format_match_mode": "FormatAgnostic"
75+ }
76+ ],
77+ "outputs": [
78+ {
79+ "name": "y",
80+ "index": 0,
81+ "dtype": "float32",
82+ "format": "ND",
83+ "paramType": "required",
84+ "shape": [
85+ -2
86+ ],
87+ "format_match_mode": "FormatAgnostic"
88+ }
89+ ]
90+ },
91+ {
92+ "bin_filename": "Relu_8098b79498645e9c0da095babdeaf862",
93+ "inputs": [
94+ {
95+ "name": "x",
96+ "index": 0,
97+ "dtype": "int32",
98+ "format": "ND",
99+ "paramType": "required",
100+ "shape": [
101+ -2
102+ ],
103+ "format_match_mode": "FormatAgnostic"
104+ }
105+ ],
106+ "outputs": [
107+ {
108+ "name": "y",
109+ "index": 0,
110+ "dtype": "int32",
111+ "format": "ND",
112+ "paramType": "required",
113+ "shape": [
114+ -2
115+ ],
116+ "format_match_mode": "FormatAgnostic"
117+ }
118+ ]
119+ },
120+ {
121+ "bin_filename": "Relu_2060cf8d69781f9a7462e2f67555909f",
122+ "inputs": [
123+ {
124+ "name": "x",
125+ "index": 0,
126+ "dtype": "int8",
127+ "format": "ND",
128+ "paramType": "required",
129+ "shape": [
130+ -2
131+ ],
132+ "format_match_mode": "FormatAgnostic"
133+ }
134+ ],
135+ "outputs": [
136+ {
137+ "name": "y",
138+ "index": 0,
139+ "dtype": "int8",
140+ "format": "ND",
141+ "paramType": "required",
142+ "shape": [
143+ -2
144+ ],
145+ "format_match_mode": "FormatAgnostic"
146+ }
147+ ]
148+ },
149+ {
150+ "bin_filename": "Relu_1d2fd313763487259859439d7e9b41cf",
151+ "inputs": [
152+ {
153+ "name": "x",
154+ "index": 0,
155+ "dtype": "int64",
156+ "format": "ND",
157+ "paramType": "required",
158+ "shape": [
159+ -2
160+ ],
161+ "format_match_mode": "FormatAgnostic"
162+ }
163+ ],
164+ "outputs": [
165+ {
166+ "name": "y",
167+ "index": 0,
168+ "dtype": "int64",
169+ "format": "ND",
170+ "paramType": "required",
171+ "shape": [
172+ -2
173+ ],
174+ "format_match_mode": "FormatAgnostic"
175+ }
176+ ]
177+ }
178+ ]
179+}
@@ -43,6 +43,7 @@ public:
43 .ExtendCfgInfo("opFile.value", "relu_apt");43 .ExtendCfgInfo("opFile.value", "relu_apt");
44 this->AICore().AddConfig("ascend950", aicoreConfig);44 this->AICore().AddConfig("ascend950", aicoreConfig);
45 this->AICore().AddConfig("ascend960dt", aicoreConfig);45 this->AICore().AddConfig("ascend960dt", aicoreConfig);
46+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
46 this->AICore().AddConfig("ascend350", aicoreConfig);47 this->AICore().AddConfig("ascend350", aicoreConfig);
47 this->AICore().AddConfig("ascend5162", aicoreConfig);48 this->AICore().AddConfig("ascend5162", aicoreConfig);
48 }49 }
@@ -9,7 +9,7 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE relu_grad_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE relu_grad_v2 ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,245 @@
1+{
2+ "op_type": "ReluGradV2",
3+ "op_list": [
4+ {
5+ "bin_filename": "ReluGradV2_ba25f0ac52c80d5c7b1aa27fa34cb1aa",
6+ "inputs": [
7+ {
8+ "name": "gradients",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ],
16+ "format_match_mode": "FormatAgnostic"
17+ },
18+ {
19+ "name": "mask",
20+ "index": 1,
21+ "dtype": "uint1",
22+ "format": "ND",
23+ "paramType": "required",
24+ "shape": [
25+ -2
26+ ],
27+ "format_match_mode": "FormatAgnostic"
28+ }
29+ ],
30+ "outputs": [
31+ {
32+ "name": "backprops",
33+ "index": 0,
34+ "dtype": "bfloat16",
35+ "format": "ND",
36+ "paramType": "required",
37+ "shape": [
38+ -2
39+ ],
40+ "format_match_mode": "FormatAgnostic"
41+ }
42+ ]
43+ },
44+ {
45+ "bin_filename": "ReluGradV2_e1759e2b792120852dd9d7b84aa90eaa",
46+ "inputs": [
47+ {
48+ "name": "gradients",
49+ "index": 0,
50+ "dtype": "float16",
51+ "format": "ND",
52+ "paramType": "required",
53+ "shape": [
54+ -2
55+ ],
56+ "format_match_mode": "FormatAgnostic"
57+ },
58+ {
59+ "name": "mask",
60+ "index": 1,
61+ "dtype": "uint1",
62+ "format": "ND",
63+ "paramType": "required",
64+ "shape": [
65+ -2
66+ ],
67+ "format_match_mode": "FormatAgnostic"
68+ }
69+ ],
70+ "outputs": [
71+ {
72+ "name": "backprops",
73+ "index": 0,
74+ "dtype": "float16",
75+ "format": "ND",
76+ "paramType": "required",
77+ "shape": [
78+ -2
79+ ],
80+ "format_match_mode": "FormatAgnostic"
81+ }
82+ ]
83+ },
84+ {
85+ "bin_filename": "ReluGradV2_5ad32a03ba5d748fd1603e0ff48b69aa",
86+ "inputs": [
87+ {
88+ "name": "gradients",
89+ "index": 0,
90+ "dtype": "float32",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ],
96+ "format_match_mode": "FormatAgnostic"
97+ },
98+ {
99+ "name": "mask",
100+ "index": 1,
101+ "dtype": "uint1",
102+ "format": "ND",
103+ "paramType": "required",
104+ "shape": [
105+ -2
106+ ],
107+ "format_match_mode": "FormatAgnostic"
108+ }
109+ ],
110+ "outputs": [
111+ {
112+ "name": "backprops",
113+ "index": 0,
114+ "dtype": "float32",
115+ "format": "ND",
116+ "paramType": "required",
117+ "shape": [
118+ -2
119+ ],
120+ "format_match_mode": "FormatAgnostic"
121+ }
122+ ]
123+ },
124+ {
125+ "bin_filename": "ReluGradV2_99518cac5700b0a6489285e62db716aa",
126+ "inputs": [
127+ {
128+ "name": "gradients",
129+ "index": 0,
130+ "dtype": "int32",
131+ "format": "ND",
132+ "paramType": "required",
133+ "shape": [
134+ -2
135+ ],
136+ "format_match_mode": "FormatAgnostic"
137+ },
138+ {
139+ "name": "mask",
140+ "index": 1,
141+ "dtype": "uint1",
142+ "format": "ND",
143+ "paramType": "required",
144+ "shape": [
145+ -2
146+ ],
147+ "format_match_mode": "FormatAgnostic"
148+ }
149+ ],
150+ "outputs": [
151+ {
152+ "name": "backprops",
153+ "index": 0,
154+ "dtype": "int32",
155+ "format": "ND",
156+ "paramType": "required",
157+ "shape": [
158+ -2
159+ ],
160+ "format_match_mode": "FormatAgnostic"
161+ }
162+ ]
163+ },
164+ {
165+ "bin_filename": "ReluGradV2_fd2d2b43ba293a761dd769dd99db2eaa",
166+ "inputs": [
167+ {
168+ "name": "gradients",
169+ "index": 0,
170+ "dtype": "int8",
171+ "format": "ND",
172+ "paramType": "required",
173+ "shape": [
174+ -2
175+ ],
176+ "format_match_mode": "FormatAgnostic"
177+ },
178+ {
179+ "name": "mask",
180+ "index": 1,
181+ "dtype": "uint1",
182+ "format": "ND",
183+ "paramType": "required",
184+ "shape": [
185+ -2
186+ ],
187+ "format_match_mode": "FormatAgnostic"
188+ }
189+ ],
190+ "outputs": [
191+ {
192+ "name": "backprops",
193+ "index": 0,
194+ "dtype": "int8",
195+ "format": "ND",
196+ "paramType": "required",
197+ "shape": [
198+ -2
199+ ],
200+ "format_match_mode": "FormatAgnostic"
201+ }
202+ ]
203+ },
204+ {
205+ "bin_filename": "ReluGradV2_f26b540b588d442ecf92aed489251aaa",
206+ "inputs": [
207+ {
208+ "name": "gradients",
209+ "index": 0,
210+ "dtype": "uint8",
211+ "format": "ND",
212+ "paramType": "required",
213+ "shape": [
214+ -2
215+ ],
216+ "format_match_mode": "FormatAgnostic"
217+ },
218+ {
219+ "name": "mask",
220+ "index": 1,
221+ "dtype": "uint1",
222+ "format": "ND",
223+ "paramType": "required",
224+ "shape": [
225+ -2
226+ ],
227+ "format_match_mode": "FormatAgnostic"
228+ }
229+ ],
230+ "outputs": [
231+ {
232+ "name": "backprops",
233+ "index": 0,
234+ "dtype": "uint8",
235+ "format": "ND",
236+ "paramType": "required",
237+ "shape": [
238+ -2
239+ ],
240+ "format_match_mode": "FormatAgnostic"
241+ }
242+ ]
243+ }
244+ ]
245+}
@@ -49,6 +49,7 @@ public:
49 this->AICore().AddConfig("ascend950", aicoreConfig);49 this->AICore().AddConfig("ascend950", aicoreConfig);
50 this->AICore().AddConfig("ascend350", aicoreConfig);50 this->AICore().AddConfig("ascend350", aicoreConfig);
51 this->AICore().AddConfig("ascend960dt", aicoreConfig);51 this->AICore().AddConfig("ascend960dt", aicoreConfig);
52+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
52 }53 }
53};54};
54 55 
@@ -0,0 +1,107 @@
1+{
2+ "op_type": "SwiGlu",
3+ "op_list": [
4+ {
5+ "bin_filename": "SwiGlu_1",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ]
16+ }
17+ ],
18+ "outputs": [
19+ {
20+ "name": "y",
21+ "index": 0,
22+ "dtype": "float16",
23+ "format": "ND",
24+ "paramType": "required",
25+ "shape": [
26+ -2
27+ ]
28+ }
29+ ],
30+ "attrs": [
31+ {
32+ "name": "dim",
33+ "dtype": "int64",
34+ "value": -1
35+ }
36+ ]
37+ },
38+ {
39+ "bin_filename": "SwiGlu_2",
40+ "inputs": [
41+ {
42+ "name": "x",
43+ "index": 0,
44+ "dtype": "float32",
45+ "format": "ND",
46+ "paramType": "required",
47+ "shape": [
48+ -2
49+ ]
50+ }
51+ ],
52+ "outputs": [
53+ {
54+ "name": "y",
55+ "index": 0,
56+ "dtype": "float32",
57+ "format": "ND",
58+ "paramType": "required",
59+ "shape": [
60+ -2
61+ ]
62+ }
63+ ],
64+ "attrs": [
65+ {
66+ "name": "dim",
67+ "dtype": "int64",
68+ "value": -1
69+ }
70+ ]
71+ },
72+ {
73+ "bin_filename": "SwiGlu_3",
74+ "inputs": [
75+ {
76+ "name": "x",
77+ "index": 0,
78+ "dtype": "bfloat16",
79+ "format": "ND",
80+ "paramType": "required",
81+ "shape": [
82+ -2
83+ ]
84+ }
85+ ],
86+ "outputs": [
87+ {
88+ "name": "y",
89+ "index": 0,
90+ "dtype": "bfloat16",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ]
96+ }
97+ ],
98+ "attrs": [
99+ {
100+ "name": "dim",
101+ "dtype": "int64",
102+ "value": -1
103+ }
104+ ]
105+ }
106+ ]
107+}
@@ -55,6 +55,7 @@ public:
55 .ExtendCfgInfo("opFile.value", "swi_glu_apt");55 .ExtendCfgInfo("opFile.value", "swi_glu_apt");
56 this->AICore().AddConfig("ascend950", regbaseCfg);56 this->AICore().AddConfig("ascend950", regbaseCfg);
57 this->AICore().AddConfig("ascend960dt", regbaseCfg);57 this->AICore().AddConfig("ascend960dt", regbaseCfg);
58+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
58 this->AICore().AddConfig("ascend350", regbaseCfg);59 this->AICore().AddConfig("ascend350", regbaseCfg);
59 }60 }
60};61};
@@ -0,0 +1,137 @@
1+{
2+ "op_type": "SwiGluGrad",
3+ "op_list": [
4+ {
5+ "bin_filename": "SwiGluGrad_1",
6+ "inputs": [
7+ {
8+ "name": "y_grad",
9+ "index": 0,
10+ "dtype": "float16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ]
16+ },
17+ {
18+ "name": "x",
19+ "index": 1,
20+ "dtype": "float16",
21+ "format": "ND",
22+ "paramType": "required",
23+ "shape": [
24+ -2
25+ ]
26+ }
27+ ],
28+ "outputs": [
29+ {
30+ "name": "x_grad",
31+ "index": 0,
32+ "dtype": "float16",
33+ "format": "ND",
34+ "paramType": "required",
35+ "shape": [
36+ -2
37+ ]
38+ }
39+ ],
40+ "attrs": [
41+ {
42+ "name": "dim",
43+ "dtype": "int64",
44+ "value": -1
45+ }
46+ ]
47+ },
48+ {
49+ "bin_filename": "SwiGluGrad_2",
50+ "inputs": [
51+ {
52+ "name": "y_grad",
53+ "index": 0,
54+ "dtype": "float32",
55+ "format": "ND",
56+ "paramType": "required",
57+ "shape": [
58+ -2
59+ ]
60+ },
61+ {
62+ "name": "x",
63+ "index": 1,
64+ "dtype": "float32",
65+ "format": "ND",
66+ "paramType": "required",
67+ "shape": [
68+ -2
69+ ]
70+ }
71+ ],
72+ "outputs": [
73+ {
74+ "name": "x_grad",
75+ "index": 0,
76+ "dtype": "float32",
77+ "format": "ND",
78+ "paramType": "required",
79+ "shape": [
80+ -2
81+ ]
82+ }
83+ ],
84+ "attrs": [
85+ {
86+ "name": "dim",
87+ "dtype": "int64",
88+ "value": -1
89+ }
90+ ]
91+ },
92+ {
93+ "bin_filename": "SwiGluGrad_3",
94+ "inputs": [
95+ {
96+ "name": "y_grad",
97+ "index": 0,
98+ "dtype": "bfloat16",
99+ "format": "ND",
100+ "paramType": "required",
101+ "shape": [
102+ -2
103+ ]
104+ },
105+ {
106+ "name": "x",
107+ "index": 1,
108+ "dtype": "bfloat16",
109+ "format": "ND",
110+ "paramType": "required",
111+ "shape": [
112+ -2
113+ ]
114+ }
115+ ],
116+ "outputs": [
117+ {
118+ "name": "x_grad",
119+ "index": 0,
120+ "dtype": "bfloat16",
121+ "format": "ND",
122+ "paramType": "required",
123+ "shape": [
124+ -2
125+ ]
126+ }
127+ ],
128+ "attrs": [
129+ {
130+ "name": "dim",
131+ "dtype": "int64",
132+ "value": -1
133+ }
134+ ]
135+ }
136+ ]
137+}
@@ -49,6 +49,7 @@ public:
49 this->AICore().AddConfig("ascend950", regbaseCfg);49 this->AICore().AddConfig("ascend950", regbaseCfg);
50 this->AICore().AddConfig("ascend350", regbaseCfg);50 this->AICore().AddConfig("ascend350", regbaseCfg);
51 this->AICore().AddConfig("ascend960dt", regbaseCfg);51 this->AICore().AddConfig("ascend960dt", regbaseCfg);
52+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
52 53 
53 OpAICoreConfig config_without_bf16;54 OpAICoreConfig config_without_bf16;
54 config_without_bf16.DynamicCompileStaticFlag(true)55 config_without_bf16.DynamicCompileStaticFlag(true)
@@ -10,8 +10,8 @@
10 10 
11message(STATUS "=== Debug: start ops.activation.leaky_relu.CMakeLists.txt ")11message(STATUS "=== Debug: start ops.activation.leaky_relu.CMakeLists.txt ")
12# 设置算子定义时支持的芯片类型12# 设置算子定义时支持的芯片类型
13-set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "mc62" "ascend960dt" "ascend5162")13+set(SUPPORT_COMPUTE_UNIT "ascend950" "ascend350" "mc62" "ascend960dt" "ascend960pr" "ascend5162")
14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译14# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
15-set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35")15+set(SUPPORT_TILING_DIR "arch35" "arch35" "arch35" "arch35" "arch35" "arch35")
16 16 
17add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE swish ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)17add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE swish ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -0,0 +1,107 @@
1+{
2+ "op_type": "Swish",
3+ "op_list": [
4+ {
5+ "bin_filename": "Swish_299cf4d7f9ef0f745d89d88c666b45aa",
6+ "inputs": [
7+ {
8+ "name": "x",
9+ "index": 0,
10+ "dtype": "bfloat16",
11+ "format": "ND",
12+ "paramType": "required",
13+ "shape": [
14+ -2
15+ ]
16+ }
17+ ],
18+ "outputs": [
19+ {
20+ "name": "y",
21+ "index": 0,
22+ "dtype": "bfloat16",
23+ "format": "ND",
24+ "paramType": "required",
25+ "shape": [
26+ -2
27+ ]
28+ }
29+ ],
30+ "attrs": [
31+ {
32+ "name": "scale",
33+ "dtype": "float",
34+ "value": null
35+ }
36+ ]
37+ },
38+ {
39+ "bin_filename": "Swish_a8d63cbe8795eef99c620173d4757e59",
40+ "inputs": [
41+ {
42+ "name": "x",
43+ "index": 0,
44+ "dtype": "float16",
45+ "format": "ND",
46+ "paramType": "required",
47+ "shape": [
48+ -2
49+ ]
50+ }
51+ ],
52+ "outputs": [
53+ {
54+ "name": "y",
55+ "index": 0,
56+ "dtype": "float16",
57+ "format": "ND",
58+ "paramType": "required",
59+ "shape": [
60+ -2
61+ ]
62+ }
63+ ],
64+ "attrs": [
65+ {
66+ "name": "scale",
67+ "dtype": "float",
68+ "value": null
69+ }
70+ ]
71+ },
72+ {
73+ "bin_filename": "Swish_291664ae3e88b38b8b46c2efbbea27c9",
74+ "inputs": [
75+ {
76+ "name": "x",
77+ "index": 0,
78+ "dtype": "float32",
79+ "format": "ND",
80+ "paramType": "required",
81+ "shape": [
82+ -2
83+ ]
84+ }
85+ ],
86+ "outputs": [
87+ {
88+ "name": "y",
89+ "index": 0,
90+ "dtype": "float32",
91+ "format": "ND",
92+ "paramType": "required",
93+ "shape": [
94+ -2
95+ ]
96+ }
97+ ],
98+ "attrs": [
99+ {
100+ "name": "scale",
101+ "dtype": "float",
102+ "value": null
103+ }
104+ ]
105+ }
106+ ]
107+}
@@ -41,6 +41,7 @@ public:
41 this->AICore().AddConfig("ascend950", aicoreConfig);41 this->AICore().AddConfig("ascend950", aicoreConfig);
42 this->AICore().AddConfig("ascend350", aicoreConfig);42 this->AICore().AddConfig("ascend350", aicoreConfig);
43 this->AICore().AddConfig("ascend960dt", aicoreConfig);43 this->AICore().AddConfig("ascend960dt", aicoreConfig);
44+ this->AICore().AddConfig("ascend960pr", aicoreConfig);
44 this->AICore().AddConfig("ascend5162", aicoreConfig);45 this->AICore().AddConfig("ascend5162", aicoreConfig);
45 }46 }
46};47};
@@ -0,0 +1,169 @@
1+{
2+ "op_type": "ForeachAddScalarList",
3+ "op_list": [
4+ {
5+ "bin_filename": "ForeachAddScalarList_b0e3947626d3cd6647f1fd09abeeb9ba",
6+ "inputs": [
7+ [
8+ {
9+ "name": "x",
10+ "index": 0,
11+ "dtype": "float16",
12+ "format": "ND",
13+ "paramType": "dynamic",
14+ "shape": [
15+ -2
16+ ]
17+ }
18+ ],
19+ {
20+ "name": "scalars",
21+ "index": 1,
22+ "dtype": "float32",
23+ "format": "ND",
24+ "paramType": "required",
25+ "shape": [
26+ -2
27+ ]
28+ }
29+ ],
30+ "outputs": [
31+ [
32+ {
33+ "name": "y",
34+ "index": 0,
35+ "dtype": "float16",
36+ "format": "ND",
37+ "paramType": "dynamic",
38+ "shape": [
39+ -2
40+ ]
41+ }
42+ ]
43+ ]
44+ },
45+ {
46+ "bin_filename": "ForeachAddScalarList_1cfe4ec64f880d29bc5b8bdb19b0742c",
47+ "inputs": [
48+ [
49+ {
50+ "name": "x",
51+ "index": 0,
52+ "dtype": "float32",
53+ "format": "ND",
54+ "paramType": "dynamic",
55+ "shape": [
56+ -2
57+ ]
58+ }
59+ ],
60+ {
61+ "name": "scalars",
62+ "index": 1,
63+ "dtype": "float32",
64+ "format": "ND",
65+ "paramType": "required",
66+ "shape": [
67+ -2
68+ ]
69+ }
70+ ],
71+ "outputs": [
72+ [
73+ {
74+ "name": "y",
75+ "index": 0,
76+ "dtype": "float32",
77+ "format": "ND",
78+ "paramType": "dynamic",
79+ "shape": [
80+ -2
81+ ]
82+ }
83+ ]
84+ ]
85+ },
86+ {
87+ "bin_filename": "ForeachAddScalarList_f50412daa86373c35f091d9b6cb2de33",
88+ "inputs": [
89+ [
90+ {
91+ "name": "x",
92+ "index": 0,
93+ "dtype": "int32",
94+ "format": "ND",
95+ "paramType": "dynamic",
96+ "shape": [
97+ -2
98+ ]
99+ }
100+ ],
101+ {
102+ "name": "scalars",
103+ "index": 1,
104+ "dtype": "int64",
105+ "format": "ND",
106+ "paramType": "required",
107+ "shape": [
108+ -2
109+ ]
110+ }
111+ ],
112+ "outputs": [
113+ [
114+ {
115+ "name": "y",
116+ "index": 0,
117+ "dtype": "int32",
118+ "format": "ND",
119+ "paramType": "dynamic",
120+ "shape": [
121+ -2
122+ ]
123+ }
124+ ]
125+ ]
126+ },
127+ {
128+ "bin_filename": "ForeachAddScalarList_7312fe7276f4add75ee8dec933d9b7ea",
129+ "inputs": [
130+ [
131+ {
132+ "name": "x",
133+ "index": 0,
134+ "dtype": "bfloat16",
135+ "format": "ND",
136+ "paramType": "dynamic",
137+ "shape": [
138+ -2
139+ ]
140+ }
141+ ],
142+ {
143+ "name": "scalars",
144+ "index": 1,
145+ "dtype": "float32",
146+ "format": "ND",
147+ "paramType": "required",
148+ "shape": [
149+ -2
150+ ]
151+ }
152+ ],
153+ "outputs": [
154+ [
155+ {
156+ "name": "y",
157+ "index": 0,
158+ "dtype": "bfloat16",
159+ "format": "ND",
160+ "paramType": "dynamic",
161+ "shape": [
162+ -2
163+ ]
164+ }
165+ ]
166+ ]
167+ }
168+ ]
169+}
@@ -50,6 +50,7 @@ public:
50 regbaseCfg.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true);50 regbaseCfg.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true);
51 this->AICore().AddConfig("ascend950", regbaseCfg);51 this->AICore().AddConfig("ascend950", regbaseCfg);
52 this->AICore().AddConfig("ascend960dt", regbaseCfg);52 this->AICore().AddConfig("ascend960dt", regbaseCfg);
53+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
53 this->AICore().AddConfig("ascend350", regbaseCfg);54 this->AICore().AddConfig("ascend350", regbaseCfg);
54 55 
55 this->AICore().AddConfig("ascend910_93");56 this->AICore().AddConfig("ascend910_93");
@@ -14,6 +14,6 @@ add_kernel_sources(
14)14)
15add_kernel_sources(15add_kernel_sources(
16 KERNEL_SRC arch35/foreach_add_scalar_list.cpp16 KERNEL_SRC arch35/foreach_add_scalar_list.cpp
17- COMPUTE_UNITS ascend950 ascend960dt ascend35017+ COMPUTE_UNITS ascend950 ascend960dt ascend960pr ascend350
18 AUTO_SYNC false18 AUTO_SYNC false
19)19)
@@ -0,0 +1,333 @@
1+{
2+ "op_type": "ForeachAddcmulScalar",
3+ "op_list": [
4+ {
5+ "bin_filename": "ForeachAddcmulScalar_8d65fd6d7cdac280a1267ac79dc700bc",
6+ "inputs": [
7+ [
8+ {
9+ "name": "x1",
10+ "index": 0,
11+ "dtype": "float16",
12+ "format": "ND",
13+ "paramType": "dynamic",
14+ "shape": [
15+ -2
16+ ]
17+ }
18+ ],
19+ [
20+ {
21+ "name": "x2",
22+ "index": 1,
23+ "dtype": "float16",
24+ "format": "ND",
25+ "paramType": "dynamic",
26+ "shape": [
27+ -2
28+ ]
29+ }
30+ ],
31+ [
32+ {
33+ "name": "x3",
34+ "index": 2,
35+ "dtype": "float16",
36+ "format": "ND",
37+ "paramType": "dynamic",
38+ "shape": [
39+ -2
40+ ]
41+ }
42+ ],
43+ {
44+ "name": "scalar",
45+ "index": 3,
46+ "dtype": "float16",
47+ "format": "ND",
48+ "paramType": "required",
49+ "shape": [
50+ -2
51+ ]
52+ }
53+ 
54+ ],
55+ "outputs": [
56+ [
57+ {
58+ "name": "y",
59+ "index": 0,
60+ "dtype": "float16",
61+ "format": "ND",
62+ "paramType": "dynamic",
63+ "shape": [
64+ -2
65+ ]
66+ }
67+ ]
68+ ]
69+ },
70+ {
71+ "bin_filename": "ForeachAddcmulScalar_502b5fc7521aa7228eb69f831c901231",
72+ "inputs": [
73+ [
74+ {
75+ "name": "x1",
76+ "index": 0,
77+ "dtype": "float32",
78+ "format": "ND",
79+ "paramType": "dynamic",
80+ "shape": [
81+ -2
82+ ]
83+ }
84+ ],
85+ [
86+ {
87+ "name": "x2",
88+ "index": 1,
89+ "dtype": "float32",
90+ "format": "ND",
91+ "paramType": "dynamic",
92+ "shape": [
93+ -2
94+ ]
95+ }
96+ ],
97+ [
98+ {
99+ "name": "x3",
100+ "index": 2,
101+ "dtype": "float32",
102+ "format": "ND",
103+ "paramType": "dynamic",
104+ "shape": [
105+ -2
106+ ]
107+ }
108+ ],
109+ {
110+ "name": "scalar",
111+ "index": 3,
112+ "dtype": "float32",
113+ "format": "ND",
114+ "paramType": "required",
115+ "shape": [
116+ -2
117+ ]
118+ }
119+ 
120+ ],
121+ "outputs": [
122+ [
123+ {
124+ "name": "y",
125+ "index": 0,
126+ "dtype": "float32",
127+ "format": "ND",
128+ "paramType": "dynamic",
129+ "shape": [
130+ -2
131+ ]
132+ }
133+ ]
134+ ]
135+ },
136+ {
137+ "bin_filename": "ForeachAddcmulScalar_944361857bfacfe70c0d3ac88bad6f12",
138+ "inputs": [
139+ [
140+ {
141+ "name": "x1",
142+ "index": 0,
143+ "dtype": "int32",
144+ "format": "ND",
145+ "paramType": "dynamic",
146+ "shape": [
147+ -2
148+ ]
149+ }
150+ ],
151+ [
152+ {
153+ "name": "x2",
154+ "index": 1,
155+ "dtype": "int32",
156+ "format": "ND",
157+ "paramType": "dynamic",
158+ "shape": [
159+ -2
160+ ]
161+ }
162+ ],
163+ [
164+ {
165+ "name": "x3",
166+ "index": 2,
167+ "dtype": "int32",
168+ "format": "ND",
169+ "paramType": "dynamic",
170+ "shape": [
171+ -2
172+ ]
173+ }
174+ ],
175+ {
176+ "name": "scalar",
177+ "index": 3,
178+ "dtype": "int32",
179+ "format": "ND",
180+ "paramType": "required",
181+ "shape": [
182+ -2
183+ ]
184+ }
185+ 
186+ ],
187+ "outputs": [
188+ [
189+ {
190+ "name": "y",
191+ "index": 0,
192+ "dtype": "int32",
193+ "format": "ND",
194+ "paramType": "dynamic",
195+ "shape": [
196+ -2
197+ ]
198+ }
199+ ]
200+ ]
201+ },
202+ {
203+ "bin_filename": "ForeachAddcmulScalar_e1a1857e547fdb51843e5102cccc2191",
204+ "inputs": [
205+ [
206+ {
207+ "name": "x1",
208+ "index": 0,
209+ "dtype": "bfloat16",
210+ "format": "ND",
211+ "paramType": "dynamic",
212+ "shape": [
213+ -2
214+ ]
215+ }
216+ ],
217+ [
218+ {
219+ "name": "x2",
220+ "index": 1,
221+ "dtype": "bfloat16",
222+ "format": "ND",
223+ "paramType": "dynamic",
224+ "shape": [
225+ -2
226+ ]
227+ }
228+ ],
229+ [
230+ {
231+ "name": "x3",
232+ "index": 2,
233+ "dtype": "bfloat16",
234+ "format": "ND",
235+ "paramType": "dynamic",
236+ "shape": [
237+ -2
238+ ]
239+ }
240+ ],
241+ {
242+ "name": "scalar",
243+ "index": 3,
244+ "dtype": "float32",
245+ "format": "ND",
246+ "paramType": "required",
247+ "shape": [
248+ -2
249+ ]
250+ }
251+ ],
252+ "outputs": [
253+ [
254+ {
255+ "name": "y",
256+ "index": 0,
257+ "dtype": "bfloat16",
258+ "format": "ND",
259+ "paramType": "dynamic",
260+ "shape": [
261+ -2
262+ ]
263+ }
264+ ]
265+ ]
266+ },
267+ {
268+ "bin_filename": "ForeachAddcmulScalar_e1a1857e547fdb51843e5102dddd2191",
269+ "inputs": [
270+ [
271+ {
272+ "name": "x1",
273+ "index": 0,
274+ "dtype": "float16",
275+ "format": "ND",
276+ "paramType": "dynamic",
277+ "shape": [
278+ -2
279+ ]
280+ }
281+ ],
282+ [
283+ {
284+ "name": "x2",
285+ "index": 1,
286+ "dtype": "float16",
287+ "format": "ND",
288+ "paramType": "dynamic",
289+ "shape": [
290+ -2
291+ ]
292+ }
293+ ],
294+ [
295+ {
296+ "name": "x3",
297+ "index": 2,
298+ "dtype": "float16",
299+ "format": "ND",
300+ "paramType": "dynamic",
301+ "shape": [
302+ -2
303+ ]
304+ }
305+ ],
306+ {
307+ "name": "scalar",
308+ "index": 3,
309+ "dtype": "float32",
310+ "format": "ND",
311+ "paramType": "required",
312+ "shape": [
313+ -2
314+ ]
315+ }
316+ ],
317+ "outputs": [
318+ [
319+ {
320+ "name": "y",
321+ "index": 0,
322+ "dtype": "float16",
323+ "format": "ND",
324+ "paramType": "dynamic",
325+ "shape": [
326+ -2
327+ ]
328+ }
329+ ]
330+ ]
331+ }
332+ ]
333+}
@@ -88,6 +88,7 @@ public:
88 .UnknownShapeFormat({ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND});88 .UnknownShapeFormat({ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND, ge::FORMAT_ND});
89 this->AICore().AddConfig("ascend950", regbaseCfg);89 this->AICore().AddConfig("ascend950", regbaseCfg);
90 this->AICore().AddConfig("ascend960dt", regbaseCfg);90 this->AICore().AddConfig("ascend960dt", regbaseCfg);
91+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
91 this->AICore().AddConfig("ascend350", regbaseCfg);92 this->AICore().AddConfig("ascend350", regbaseCfg);
92 93 
93 OpAICoreConfig config_kirin = GetKirinCoreConfig();94 OpAICoreConfig config_kirin = GetKirinCoreConfig();
@@ -14,7 +14,7 @@ add_kernel_sources(
14)14)
15add_kernel_sources(15add_kernel_sources(
16 KERNEL_SRC arch35/foreach_addcmul_scalar.cpp16 KERNEL_SRC arch35/foreach_addcmul_scalar.cpp
17- COMPUTE_UNITS ascend950 ascend350 ascend960dt17+ COMPUTE_UNITS ascend950 ascend350 ascend960dt ascend960pr
18 AUTO_SYNC false18 AUTO_SYNC false
19 OPTIONS "--cce-no-dcache-flush"19 OPTIONS "--cce-no-dcache-flush"
20)20)
@@ -0,0 +1,128 @@
1+{
2+ "op_type": "ForeachDivScalar",
3+ "op_list": [
4+ {
5+ "bin_filename": "ForeachDivScalar_3598eaa1b43fab3d356b47371a953957",
6+ "inputs": [
7+ [
8+ {
9+ "name": "x",
10+ "index": 0,
11+ "dtype": "float16",
12+ "format": "ND",
13+ "paramType": "dynamic",
14+ "shape": [
15+ -2
16+ ]
17+ }
18+ ],
19+ {
20+ "name": "scalar",
21+ "index": 1,
22+ "dtype": "float16",
23+ "format": "ND",
24+ "paramType": "required",
25+ "shape": [
26+ -2
27+ ]
28+ }
29+ ],
30+ "outputs": [
31+ [
32+ {
33+ "name": "y",
34+ "index": 0,
35+ "dtype": "float16",
36+ "format": "ND",
37+ "paramType": "dynamic",
38+ "shape": [
39+ -2
40+ ]
41+ }
42+ ]
43+ ]
44+ },
45+ {
46+ "bin_filename": "ForeachDivScalar_c47f87b17dc031a9e4c31137a6b28c3d",
47+ "inputs": [
48+ [
49+ {
50+ "name": "x",
51+ "index": 0,
52+ "dtype": "float32",
53+ "format": "ND",
54+ "paramType": "dynamic",
55+ "shape": [
56+ -2
57+ ]
58+ }
59+ ],
60+ {
61+ "name": "scalar",
62+ "index": 1,
63+ "dtype": "float32",
64+ "format": "ND",
65+ "paramType": "required",
66+ "shape": [
67+ -2
68+ ]
69+ }
70+ ],
71+ "outputs": [
72+ [
73+ {
74+ "name": "y",
75+ "index": 0,
76+ "dtype": "float32",
77+ "format": "ND",
78+ "paramType": "dynamic",
79+ "shape": [
80+ -2
81+ ]
82+ }
83+ ]
84+ ]
85+ },
86+ {
87+ "bin_filename": "ForeachDivScalar_a9b8f421f352cf39e5e3ebde0c92241a",
88+ "inputs": [
89+ [
90+ {
91+ "name": "x",
92+ "index": 0,
93+ "dtype": "bfloat16",
94+ "format": "ND",
95+ "paramType": "dynamic",
96+ "shape": [
97+ -2
98+ ]
99+ }
100+ ],
101+ {
102+ "name": "scalar",
103+ "index": 1,
104+ "dtype": "float32",
105+ "format": "ND",
106+ "paramType": "required",
107+ "shape": [
108+ -2
109+ ]
110+ }
111+ ],
112+ "outputs": [
113+ [
114+ {
115+ "name": "y",
116+ "index": 0,
117+ "dtype": "bfloat16",
118+ "format": "ND",
119+ "paramType": "dynamic",
120+ "shape": [
121+ -2
122+ ]
123+ }
124+ ]
125+ ]
126+ }
127+ ]
128+}
@@ -49,6 +49,7 @@ public:
49 regbaseCfg.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true);49 regbaseCfg.DynamicCompileStaticFlag(true).DynamicRankSupportFlag(true).DynamicShapeSupportFlag(true);
50 this->AICore().AddConfig("ascend950", regbaseCfg);50 this->AICore().AddConfig("ascend950", regbaseCfg);
51 this->AICore().AddConfig("ascend960dt", regbaseCfg);51 this->AICore().AddConfig("ascend960dt", regbaseCfg);
52+ this->AICore().AddConfig("ascend960pr", regbaseCfg);
52 this->AICore().AddConfig("ascend350", regbaseCfg);53 this->AICore().AddConfig("ascend350", regbaseCfg);
53 54 
54 this->AICore().AddConfig("ascend910_93");55 this->AICore().AddConfig("ascend910_93");
@@ -14,6 +14,6 @@ add_kernel_sources(
14)14)
15add_kernel_sources(15add_kernel_sources(
16 KERNEL_SRC arch35/foreach_div_scalar.cpp16 KERNEL_SRC arch35/foreach_div_scalar.cpp
17- COMPUTE_UNITS ascend950 ascend960dt ascend35017+ COMPUTE_UNITS ascend950 ascend960dt ascend960pr ascend350
18 AUTO_SYNC false18 AUTO_SYNC false
19)19)
@@ -9,7 +9,7 @@
9# ----------------------------------------------------------------------------9# ----------------------------------------------------------------------------
10 10 
11# 设置算子定义时支持的芯片类型11# 设置算子定义时支持的芯片类型
12-set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "ascend950" "ascend350" "ascend960dt")12+set(SUPPORT_COMPUTE_UNIT "ascend910b" "ascend910_93" "ascend950" "ascend350" "ascend960dt" "ascend960pr")
13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译13# 设置每种芯片类型对应的tiling文件目录,即采用op_host目录下哪个文件夹下的tiling文件编译
14-set(SUPPORT_TILING_DIR "arch22" "arch22" "arch35" "arch35" "arch35")14+set(SUPPORT_TILING_DIR "arch22" "arch22" "arch35" "arch35" "arch35" "arch35")
15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)15add_modules_sources(HOSTNAME ${OPHOST_NAME} MODE PRIVATE DIR ${CMAKE_CURRENT_SOURCE_DIR} OPTYPE index_fill ACLNNTYPE aclnn_exclude COMPUTE_UNIT ${SUPPORT_COMPUTE_UNIT} TILING_DIR ${SUPPORT_TILING_DIR} DISABLE_IN_OPP TRUE)
@@ -40,7 +40,7 @@ void CalculatePNQ(gert::Shape& xShape, int64_t dim, IndexFillInputInfo& inputDat
40 40 
41ge::graphStatus CheckSupportForHif4(gert::TilingContext* context, IndexFillInputInfo& inputData)41ge::graphStatus CheckSupportForHif4(gert::TilingContext* context, IndexFillInputInfo& inputData)
42{42{
43- // FLOAT4在Ascend 960DT且尾轴是偶数时支持43+ // FLOAT4在Ascend 960系列(960DT/960PR)且尾轴是偶数时支持
44#if defined(METADEF_VERSION_NUM) && METADEF_VERSION_NUM >= 9030000044#if defined(METADEF_VERSION_NUM) && METADEF_VERSION_NUM >= 90300000
45 if (inputData.dtype != ge::DataType::DT_HIFLOAT4 && inputData.dtype != ge::DataType::DT_FLOAT4_E2M1 &&45 if (inputData.dtype != ge::DataType::DT_HIFLOAT4 && inputData.dtype != ge::DataType::DT_FLOAT4_E2M1 &&
46 inputData.dtype != ge::DataType::DT_FLOAT4_E1M2) {46 inputData.dtype != ge::DataType::DT_FLOAT4_E1M2) {
@@ -50,7 +50,8 @@ ge::graphStatus CheckSupportForHif4(gert::TilingContext* context, IndexFillInput
50 auto platformInfo = context->GetPlatformInfo();50 auto platformInfo = context->GetPlatformInfo();
51 OP_CHECK_NULL_WITH_CONTEXT(context, platformInfo);51 OP_CHECK_NULL_WITH_CONTEXT(context, platformInfo);
52 auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformInfo);52 auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformInfo);
53- bool isAscend960DT = ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9201;53+ bool isAscend960DT = ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9201 ||
54+ ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9202;
54 55 
55 OP_CHECK_IF(56 OP_CHECK_IF(
56 !isAscend960DT,57 !isAscend960DT,
@@ -181,7 +182,8 @@ ge::graphStatus IndexFillCommonTiling::GetPlatformInfo()
181 sysWorkspaceSize_ = compileInfo->sysWorkspaceSize;182 sysWorkspaceSize_ = compileInfo->sysWorkspaceSize;
182 } else {183 } else {
183 auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformPtr);184 auto ascendcPlatform = platform_ascendc::PlatformAscendC(platformPtr);
184- inputData.isAscend960DT = ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9201;185+ inputData.isAscend960DT = ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9201 ||
186+ ascendcPlatform.GetCurNpuArch() == NpuArch::DAV_9202;
185 coreNum_ = ascendcPlatform.GetCoreNumAiv();187 coreNum_ = ascendcPlatform.GetCoreNumAiv();
186 uint64_t ubSizePlatform;188 uint64_t ubSizePlatform;
187 ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ubSizePlatform);189 ascendcPlatform.GetCoreMemSize(platform_ascendc::CoreMemType::UB, ubSizePlatform);
@@ -135,6 +135,7 @@ public:
135 .DynamicRankSupportFlag(true)135 .DynamicRankSupportFlag(true)
136 .DynamicShapeSupportFlag(true);136 .DynamicShapeSupportFlag(true);
137 this->AICore().AddConfig("ascend960dt", config_960);137 this->AICore().AddConfig("ascend960dt", config_960);
138+ this->AICore().AddConfig("ascend960pr", config_960);
138#endif139#endif
139 }140 }
140};141};
@@ -28,7 +28,7 @@ add_kernel_sources(
28# A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_DMA 模板28# A6(arch92) 使用 arch92 目录下的入口,额外引入 arch92 的 SIMD_DMA 模板
29add_kernel_sources(29add_kernel_sources(
30 KERNEL_SRC arch92/index_fill.cpp30 KERNEL_SRC arch92/index_fill.cpp
31- COMPUTE_UNITS ascend960dt31+ COMPUTE_UNITS ascend960dt ascend960pr
32 SIMPLIFIED_KEY 032 SIMPLIFIED_KEY 0
33 IMPL_MODE high_performance33 IMPL_MODE high_performance
34 AUTO_SYNC false34 AUTO_SYNC false
@@ -40,7 +40,8 @@ bool IndexPutV2SimdDmaTiling::IsCapable()
40{40{
41 auto platformInfo = context_->GetPlatformInfo();41 auto platformInfo = context_->GetPlatformInfo();
42 if (platformInfo == nullptr ||42 if (platformInfo == nullptr ||
43- platform_ascendc::PlatformAscendC(platformInfo).GetCurNpuArch() != NpuArch::DAV_9201) {43+ (platform_ascendc::PlatformAscendC(platformInfo).GetCurNpuArch() != NpuArch::DAV_9201 &&
44+ platform_ascendc::PlatformAscendC(platformInfo).GetCurNpuArch() != NpuArch::DAV_9202)) {
44 return false;45 return false;
45 }46 }
46 return IndexPutV2SimdTiling::IsCapable();47 return IndexPutV2SimdTiling::IsCapable();
@@ -42,8 +42,8 @@ ASCENDC_TPL_ARGS_DECL(IndexPutV2,
42 ASCENDC_TPL_BOOL_DECL(IS_SIMD, 0, 1), ASCENDC_TPL_BOOL_DECL(IS_NOCON, 0, 1),42 ASCENDC_TPL_BOOL_DECL(IS_SIMD, 0, 1), ASCENDC_TPL_BOOL_DECL(IS_NOCON, 0, 1),
43 ASCENDC_TPL_BOOL_DECL(IS_ACCUMULATE, 0, 1), ASCENDC_TPL_BOOL_DECL(IS_OVERLENGTH, 0, 1));43 ASCENDC_TPL_BOOL_DECL(IS_ACCUMULATE, 0, 1), ASCENDC_TPL_BOOL_DECL(IS_OVERLENGTH, 0, 1));
44 44 
45-// Host tiling describes both paths; device compilation enables DMA only on DAV_9201.45+// Host tiling describes both paths; device compilation enables DMA only on DAV_9201/DAV_9202.
46-#if defined(__NPU_ARCH__) && (__NPU_ARCH__ != 9201)46+#if defined(__NPU_ARCH__) && (__NPU_ARCH__ != 9201) && (__NPU_ARCH__ != 9202)
47#define INDEX_PUT_V2_DMA_SEL ASCENDC_TPL_BOOL_SEL(IS_PERF, 0)47#define INDEX_PUT_V2_DMA_SEL ASCENDC_TPL_BOOL_SEL(IS_PERF, 0)
48#else48#else
49#define INDEX_PUT_V2_DMA_SEL ASCENDC_TPL_BOOL_SEL(IS_PERF, 0, 1)49#define INDEX_PUT_V2_DMA_SEL ASCENDC_TPL_BOOL_SEL(IS_PERF, 0, 1)
@@ -16,7 +16,7 @@
16#ifndef INDEX_PUT_V2_SIMD_DMA16#ifndef INDEX_PUT_V2_SIMD_DMA
17#define INDEX_PUT_V2_SIMD_DMA17#define INDEX_PUT_V2_SIMD_DMA
18 18 
19-#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201)19+#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201 || __NPU_ARCH__ == 9202)
20 20 
21#include "kernel_operator.h"21#include "kernel_operator.h"
22#include "op_kernel/platform_util.h"22#include "op_kernel/platform_util.h"
@@ -160,5 +160,5 @@ __aicore__ inline void IndexPutV2SimdDma<TX, TIDX, IsAtomicAdd>::Process()
160 160 
161} // namespace IndexPutV2161} // namespace IndexPutV2
162 162 
163-#endif // defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201)163+#endif // defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201 || __NPU_ARCH__ == 9202)
164#endif // INDEX_PUT_V2_SIMD_DMA164#endif // INDEX_PUT_V2_SIMD_DMA
@@ -17,7 +17,7 @@
17#include "../index/arch35/index.h"17#include "../index/arch35/index.h"
18#include "../index/arch35/index_no_continuous.h"18#include "../index/arch35/index_no_continuous.h"
19#include "arch35/index_put_v2_simd.h"19#include "arch35/index_put_v2_simd.h"
20-#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201)20+#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201 || __NPU_ARCH__ == 9202)
21#include "arch92/index_put_v2_simd_dma.h"21#include "arch92/index_put_v2_simd_dma.h"
22#endif22#endif
23#include "arch35/index_put_v2_tiling_key.h"23#include "arch35/index_put_v2_tiling_key.h"
@@ -56,8 +56,8 @@ __global__ __aicore__ void index_put_v2(GM_ADDR inputX, GM_ADDR value, GM_ADDR i
56 KERNEL_TASK_TYPE_DEFAULT(KERNEL_TYPE_AIV_ONLY);56 KERNEL_TASK_TYPE_DEFAULT(KERNEL_TYPE_AIV_ONLY);
57 REGISTER_TILING_DEFAULT(Index::IndexSimtTilingData);57 REGISTER_TILING_DEFAULT(Index::IndexSimtTilingData);
58 58 
59-#if !defined(__NPU_ARCH__) || (__NPU_ARCH__ != 9201)59+#if !defined(__NPU_ARCH__) || ((__NPU_ARCH__ != 9201) && (__NPU_ARCH__ != 9202))
60- static_assert(!IS_PERF, "IndexPutV2 DMA is supported only on DAV_9201");60+ static_assert(!IS_PERF, "IndexPutV2 DMA is supported only on DAV_9201/DAV_9202");
61#endif61#endif
62 62 
63 using indexOffsetType = std::conditional_t<IS_OVERLENGTH, uint64_t, uint32_t>;63 using indexOffsetType = std::conditional_t<IS_OVERLENGTH, uint64_t, uint32_t>;
@@ -118,7 +118,7 @@ __global__ __aicore__ void index_put_v2(GM_ADDR inputX, GM_ADDR value, GM_ADDR i
118 IndexPutV2Simd<DTYPE_X, DTYPE_INDICES, true> op;118 IndexPutV2Simd<DTYPE_X, DTYPE_INDICES, true> op;
119 op.Init(inputX, value, indexedSizes, indexedStrides, indices, tilingData);119 op.Init(inputX, value, indexedSizes, indexedStrides, indices, tilingData);
120 op.Process();120 op.Process();
121-#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201)121+#if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201 || __NPU_ARCH__ == 9202)
122 // IS_PERF selects the additional SIMD DMA templates without changing the mainline tiling keys.122 // IS_PERF selects the additional SIMD DMA templates without changing the mainline tiling keys.
123 } else if constexpr (IS_SIMD && IS_PERF && !IS_ACCUMULATE) {123 } else if constexpr (IS_SIMD && IS_PERF && !IS_ACCUMULATE) {
124 REGISTER_TILING_FOR_TILINGKEY(124 REGISTER_TILING_FOR_TILINGKEY(