Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix avgpool ir #188

Merged
merged 3 commits into from
Dec 22, 2020
Merged

fix avgpool ir #188

merged 3 commits into from
Dec 22, 2020

Conversation

xiayuqing0622
Copy link
Contributor

No description provided.

@xiayuqing0622 xiayuqing0622 linked an issue Dec 21, 2020 that may be closed by this pull request
@xysmlx
Copy link
Contributor

xysmlx commented Dec 21, 2020

still has wrong results in at least one of the following cases:

tag << "cudnn_avgpool_dtype_" << output_type.c_type_string() << "_i" << join(input_shape, "_")
        << "_o" << join(output_shape, "_") << "_ws" << join(window_stride, "_") << "_wst"
        << join(window_stride, "_") << "_pb" << join(padding_below, "_") << "_pb"
        << join(padding_above, "_");

cudnn_avgpool_dtype_float_i1_96_32_32_o1_96_32_32_ws1_1_wst1_1_pb1_1_pb1_1
cudnn_avgpool_dtype_float_i1_32_32_32_o1_32_32_32_ws1_1_wst1_1_pb1_1_pb1_1
cudnn_avgpool_dtype_float_i1_192_32_32_o1_192_16_16_ws2_2_wst2_2_pb0_0_pb0_0
cudnn_avgpool_dtype_float_i1_64_32_32_o1_64_16_16_ws2_2_wst2_2_pb0_0_pb1_1
cudnn_avgpool_dtype_float_i1_64_16_16_o1_64_16_16_ws1_1_wst1_1_pb1_1_pb1_1
cudnn_avgpool_dtype_float_i1_384_16_16_o1_384_8_8_ws2_2_wst2_2_pb0_0_pb0_0
cudnn_avgpool_dtype_float_i1_128_16_16_o1_128_8_8_ws2_2_wst2_2_pb0_0_pb1_1
cudnn_avgpool_dtype_float_i1_128_8_8_o1_128_8_8_ws1_1_wst1_1_pb1_1_pb1_1
AvgPool input_shape; output_shape floatfloat window_shape, stride, padding_below

[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,96,32,32;1,96,32,32floatfloatShape{3, 3}Strides{1, 1}Shape{1, 1}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 1 + KH - 1 , WO * 1 + KW - 1].when([HO * 1 + KH - 1 >= 0, HO * 1 + KH - 1 < 32 , WO * 1 + KW - 1 >= 0, WO * 1 + KW - 1 < 32], 0.0) / ((HO * 1 + 3 - 1).call('min', [32])  - (HO * 1 - 1).call('max', [0])) / ((WO * 1 + 3 - 1).call('min', [32])  - (WO * 1 - 1).call('max', [0])) where HO in 32, WO in 32, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 96, 32, 32]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,32,32,32;1,32,32,32floatfloatShape{3, 3}Strides{1, 1}Shape{1, 1}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 1 + KH - 1 , WO * 1 + KW - 1].when([HO * 1 + KH - 1 >= 0, HO * 1 + KH - 1 < 32 , WO * 1 + KW - 1 >= 0, WO * 1 + KW - 1 < 32], 0.0) / ((HO * 1 + 3 - 1).call('min', [32])  - (HO * 1 - 1).call('max', [0])) / ((WO * 1 + 3 - 1).call('min', [32])  - (WO * 1 - 1).call('max', [0])) where HO in 32, WO in 32, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 32, 32, 32]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,192,32,32;1,192,16,16floatfloatShape{1, 1}Strides{2, 2}Shape{0, 0}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 2 + KH , WO * 2 + KW] / ((HO * 2 + 1 - 0).call('min', [32])  - (HO * 2 - 0).call('max', [0])) / ((WO * 2 + 1 - 0).call('min', [32])  - (WO * 2 - 0).call('max', [0])) where HO in 16, WO in 16, KH in 1, KW in 1;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 192, 32, 32]} }) 
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,64,32,32;1,64,16,16floatfloatShape{3, 3}Strides{2, 2}Shape{0, 0}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 2 + KH , WO * 2 + KW] / ((HO * 2 + 3 - 0).call('min', [32])  - (HO * 2 - 0).call('max', [0])) / ((WO * 2 + 3 - 0).call('min', [32])  - (WO * 2 - 0).call('max', [0])) where HO in 16, WO in 16, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 64, 32, 32]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,64,16,16;1,64,16,16floatfloatShape{3, 3}Strides{1, 1}Shape{1, 1}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 1 + KH - 1 , WO * 1 + KW - 1].when([HO * 1 + KH - 1 >= 0, HO * 1 + KH - 1 < 16 , WO * 1 + KW - 1 >= 0, WO * 1 + KW - 1 < 16], 0.0) / ((HO * 1 + 3 - 1).call('min', [16])  - (HO * 1 - 1).call('max', [0])) / ((WO * 1 + 3 - 1).call('min', [16])  - (WO * 1 - 1).call('max', [0])) where HO in 16, WO in 16, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 64, 16, 16]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,384,16,16;1,384,8,8floatfloatShape{1, 1}Strides{2, 2}Shape{0, 0}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 2 + KH , WO * 2 + KW] / ((HO * 2 + 1 - 0).call('min', [16])  - (HO * 2 - 0).call('max', [0])) / ((WO * 2 + 1 - 0).call('min', [16])  - (WO * 2 - 0).call('max', [0])) where HO in 8, WO in 8, KH in 1, KW in 1;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 384, 16, 16]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,128,16,16;1,128,8,8floatfloatShape{3, 3}Strides{2, 2}Shape{0, 0}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 2 + KH , WO * 2 + KW] / ((HO * 2 + 3 - 0).call('min', [16])  - (HO * 2 - 0).call('max', [0])) / ((WO * 2 + 3 - 0).call('min', [16])  - (WO * 2 - 0).call('max', [0])) where HO in 8, WO in 8, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 128, 16, 16]} })
[INFO] 2020-12-21T10:44:47z src/nnfusion/engine/pass/graph/kernel_tuning.cpp 285        AvgPool1,128,8,8;1,128,8,8floatfloatShape{3, 3}Strides{1, 1}Shape{1, 1}, ir:  - einstein_v2(" output0[N, C, HO, WO] +=! input0[N, C, HO * 1 + KH - 1 , WO * 1 + KW - 1].when([HO * 1 + KH - 1 >= 0, HO * 1 + KH - 1 < 8 , WO * 1 + KW - 1 >= 0, WO * 1 + KW - 1 < 8], 0.0) / ((HO * 1 + 3 - 1).call('min', [8])  - (HO * 1 - 1).call('max', [0])) / ((WO * 1 + 3 - 1).call('min', [8])  - (WO * 1 - 1).call('max', [0])) where HO in 8, WO in 8, KH in 3, KW in 3;", input_dict={ "input0" : { "dtype" : "float32", "shape" : [1, 128, 8, 8]} })

@jlxue jlxue merged commit 61418e9 into master Dec 22, 2020
@xiayuqing0622 xiayuqing0622 deleted the yuqxia/fix_avgpool_ir branch January 25, 2021 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Antares IR problem in AvgPool operator
3 participants