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

jittor.nn.MaxPool2d 在使用GPU运算时会产生-INF #596

Open
PhyllisJi opened this issue Sep 8, 2024 · 0 comments
Open

jittor.nn.MaxPool2d 在使用GPU运算时会产生-INF #596

PhyllisJi opened this issue Sep 8, 2024 · 0 comments

Comments

@PhyllisJi
Copy link

Full Log

gpu的输出中存在很多-inf,但输入数据其实就都为0或者大于0.001

jt.Var([[[[-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.4927946e-01  2.4003847e-01  3.7717146e-01  4.0253597e-01
            4.0253597e-01  4.0253597e-01  4.0253597e-01  4.0253597e-01
            4.0253597e-01  4.0253597e-01  4.0253597e-01  1.9055609e-01
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.4927946e-01  2.4003847e-01  3.7717146e-01  4.0253597e-01
            4.1456258e-01  4.1456258e-01  4.1456258e-01  4.1456258e-01
            4.1456258e-01  4.1456258e-01  4.1456258e-01  4.1456258e-01
            1.2646900e-01  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.4927946e-01  2.4003847e-01  3.7717146e-01  4.0775770e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            2.8187984e-01  5.5362388e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.4927946e-01  2.4003847e-01  3.7717146e-01  4.0775770e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            2.8187984e-01  5.5362388e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  1.8985461e-01  2.1769403e-01  4.0775770e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            2.8187984e-01  5.5362388e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  1.8985461e-01  2.1769403e-01  4.0775770e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            2.8187984e-01  5.5362388e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  1.8985461e-01  2.1769403e-01  4.0775770e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            5.0950021e-01  5.0950021e-01  5.0950021e-01  5.0950021e-01
            2.8187984e-01  5.5362388e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]]
       
         [[-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            2.2493003e-01  3.4764841e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  1.4531037e-01  6.1729271e-02
            6.1729271e-02  6.1729271e-02  4.3406930e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            2.2493003e-01  3.4764841e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  1.4531037e-01  8.6400174e-02
            8.6400174e-02  6.1729271e-02  4.3406930e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            2.2493003e-01  3.4764841e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  4.3398163e-01  4.3398163e-01
            4.3398163e-01  4.3398163e-01  1.5092641e-01  1.5092641e-01
            1.0883322e-01  6.1729271e-02  4.3406930e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            2.2493003e-01  3.4764841e-01  3.4764841e-01  3.4764841e-01
            3.4764841e-01  3.4764841e-01  3.4764841e-01  3.4764841e-01
            3.4764841e-01  3.2727769e-01  1.5092641e-01  1.5092641e-01
            1.0883322e-01  8.6275078e-02  8.6275078e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            2.0389429e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.2727769e-01  1.5092641e-01  1.5092641e-01
            1.0883322e-01  8.6275078e-02  8.6275078e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            1.5981312e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.2727769e-01  1.5092641e-01  1.5092641e-01
            1.0883322e-01  8.6275078e-02  8.6275078e-02  4.3406930e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.3406930e-02  4.3406930e-02  4.3406930e-02
            1.5981312e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.3969164e-01  3.3969164e-01  3.3969164e-01
            3.3969164e-01  3.2727769e-01  1.5092641e-01  1.5092641e-01
            1.0883322e-01  8.6275078e-02  8.6275078e-02  4.3406930e-02
           -3.4028235e+38]]
       
         [[-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  5.4462498e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0074594e-01  2.7227283e-01
            1.5576500e-03  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  5.4462498e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0074594e-01  2.7227283e-01
            1.5576500e-03  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  5.4462498e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0074594e-01  2.7227283e-01
            7.9842404e-02  7.9842404e-02  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  5.4462498e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0567369e-01  7.0567369e-01
            7.0567369e-01  7.0567369e-01  7.0074594e-01  6.2061739e-01
            5.5357701e-01  5.5357701e-01  1.2504171e-01  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  5.4462498e-01  8.1113821e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  8.2976043e-01
            5.5357701e-01  5.5357701e-01  1.2504171e-01  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.3050182e-01  4.7433880e-01  8.1113821e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  8.2976043e-01
            5.5357701e-01  5.5357701e-01  1.2504171e-01  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  2.7469626e-01  8.1113821e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  9.1192883e-01
            9.1192883e-01  9.1192883e-01  9.1192883e-01  8.2976043e-01
            5.5357701e-01  5.5357701e-01  1.2504171e-01  0.0000000e+00
           -3.4028235e+38]]
       
         [[-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  5.3507531e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.4222074e-01  5.2259576e-01
            5.7960249e-02  5.0474759e-02  4.7009472e-02  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  5.3507531e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.4222074e-01  5.2259576e-01
            1.1508992e-01  1.1508992e-01  4.7009472e-02  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  5.3507531e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  6.8248332e-01  6.4222074e-01  5.2259576e-01
            4.5839888e-01  4.5839888e-01  1.3897316e-01  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  5.3507531e-01  6.8248332e-01  6.8248332e-01
            6.8248332e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  4.5839888e-01  1.3897316e-01  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  5.3507531e-01  7.5975591e-01  7.5975591e-01
            7.5975591e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  4.5839888e-01  1.3897316e-01  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            2.7904010e-01  3.2982445e-01  7.5975591e-01  7.5975591e-01
            7.5975591e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  4.5839888e-01  1.3897316e-01  4.7009472e-02
           -3.4028235e+38]
          [-3.4028235e+38  4.7009472e-02  4.7009472e-02  4.7009472e-02
            9.3529552e-02  3.2982445e-01  7.5975591e-01  7.5975591e-01
            7.5975591e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  8.2965738e-01  8.2965738e-01  8.2965738e-01
            8.2965738e-01  4.5839888e-01  1.3897316e-01  4.7009472e-02
           -3.4028235e+38]]
       
         [[-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            4.2767075e-01  4.2767075e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  2.7990359e-01  2.7990359e-01
            1.3443573e-01  8.8191412e-02  8.8191412e-02  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            4.2767075e-01  4.2767075e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  2.7990359e-01  2.7990359e-01
            1.3443573e-01  9.7128570e-02  9.7128570e-02  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            4.2767075e-01  4.2767075e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  2.7990359e-01  2.7990359e-01
            1.3443573e-01  1.1171624e-01  1.1171624e-01  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            4.2767075e-01  4.2767075e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  2.7990359e-01  2.7990359e-01
            2.2847664e-01  2.2847664e-01  2.2847664e-01  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            4.2767075e-01  4.2767075e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  3.6671627e-01  3.6671627e-01
            3.6671627e-01  2.2847664e-01  2.2847664e-01  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            3.3895338e-01  4.0968794e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  7.6685077e-01  7.6685077e-01
            7.6685077e-01  7.6685077e-01  3.6671627e-01  3.6671627e-01
            3.6671627e-01  2.2847664e-01  2.2847664e-01  8.8191412e-02
           -3.4028235e+38]
          [-3.4028235e+38  8.8191412e-02  8.8191412e-02  8.8191412e-02
            1.5337470e-01  4.0968794e-01  5.7877833e-01  5.7877833e-01
            5.7877833e-01  5.7877833e-01  5.7877833e-01  5.7877833e-01
            5.7877833e-01  5.7877833e-01  3.6671627e-01  3.6671627e-01
            3.6671627e-01  2.2847664e-01  2.2847664e-01  8.8191412e-02
           -3.4028235e+38]]
       
         [[-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            1.1870350e-02  1.1870350e-02  1.1870350e-02  1.1870350e-02
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]
          [-3.4028235e+38  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
            0.0000000e+00  0.0000000e+00  0.0000000e+00  0.0000000e+00
           -3.4028235e+38]]]], dtype=float32)

Compiling Operators(1/1) used: 3.94s eta:    0s 
jt.Var([[[[      -inf 0.         0.         0.         0.14927946 0.24003847
           0.37717146 0.40253597 0.40253597 0.40253597 0.40253597 0.40253597
           0.40253597 0.40253597 0.40253597 0.1905561  0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.14927946 0.24003847
           0.37717146 0.40253597 0.41456258 0.41456258 0.41456258 0.41456258
           0.41456258 0.41456258 0.41456258 0.41456258 0.126469   0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.14927946 0.24003847
           0.37717146 0.4077577  0.5095002  0.5095002  0.5095002  0.5095002
           0.5095002  0.5095002  0.5095002  0.5095002  0.28187984 0.05536239
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.14927946 0.24003847
           0.37717146 0.4077577  0.5095002  0.5095002  0.5095002  0.5095002
           0.5095002  0.5095002  0.5095002  0.5095002  0.28187984 0.05536239
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.         0.1898546
           0.21769403 0.4077577  0.5095002  0.5095002  0.5095002  0.5095002
           0.5095002  0.5095002  0.5095002  0.5095002  0.28187984 0.05536239
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.         0.1898546
           0.21769403 0.4077577  0.5095002  0.5095002  0.5095002  0.5095002
           0.5095002  0.5095002  0.5095002  0.5095002  0.28187984 0.05536239
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.         0.1898546
           0.21769403 0.4077577  0.5095002  0.5095002  0.5095002  0.5095002
           0.5095002  0.5095002  0.5095002  0.5095002  0.28187984 0.05536239
           0.         0.               -inf]]
       
         [[      -inf 0.04340693 0.04340693 0.04340693 0.22493003 0.3476484
           0.43398163 0.43398163 0.43398163 0.43398163 0.43398163 0.43398163
           0.43398163 0.43398163 0.14531037 0.06172927 0.06172927 0.06172927
           0.04340693 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.22493003 0.3476484
           0.43398163 0.43398163 0.43398163 0.43398163 0.43398163 0.43398163
           0.43398163 0.43398163 0.14531037 0.08640017 0.08640017 0.06172927
           0.04340693 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.22493003 0.3476484
           0.43398163 0.43398163 0.43398163 0.43398163 0.43398163 0.43398163
           0.43398163 0.43398163 0.15092641 0.15092641 0.10883322 0.06172927
           0.04340693 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.22493003 0.3476484
           0.3476484  0.3476484  0.3476484  0.3476484  0.3476484  0.3476484
           0.3476484  0.3272777  0.15092641 0.15092641 0.10883322 0.08627508
           0.08627508 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.20389429 0.33969164
           0.33969164 0.33969164 0.33969164 0.33969164 0.33969164 0.33969164
           0.33969164 0.3272777  0.15092641 0.15092641 0.10883322 0.08627508
           0.08627508 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.15981312 0.33969164
           0.33969164 0.33969164 0.33969164 0.33969164 0.33969164 0.33969164
           0.33969164 0.3272777  0.15092641 0.15092641 0.10883322 0.08627508
           0.08627508 0.04340693       -inf]
          [      -inf 0.04340693 0.04340693 0.04340693 0.15981312 0.33969164
           0.33969164 0.33969164 0.33969164 0.33969164 0.33969164 0.33969164
           0.33969164 0.3272777  0.15092641 0.15092641 0.10883322 0.08627508
           0.08627508 0.04340693       -inf]]
       
         [[      -inf 0.         0.         0.         0.13050182 0.544625
           0.7056737  0.7056737  0.7056737  0.7056737  0.7056737  0.7056737
           0.7056737  0.7056737  0.70074594 0.27227283 0.00155765 0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.13050182 0.544625
           0.7056737  0.7056737  0.7056737  0.7056737  0.7056737  0.7056737
           0.7056737  0.7056737  0.70074594 0.27227283 0.00155765 0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.13050182 0.544625
           0.7056737  0.7056737  0.7056737  0.7056737  0.7056737  0.7056737
           0.7056737  0.7056737  0.70074594 0.27227283 0.0798424  0.0798424
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.13050182 0.544625
           0.7056737  0.7056737  0.7056737  0.7056737  0.7056737  0.7056737
           0.7056737  0.7056737  0.70074594 0.6206174  0.553577   0.553577
           0.12504171 0.               -inf]
          [      -inf 0.         0.         0.         0.13050182 0.544625
           0.8111382  0.91192883 0.91192883 0.91192883 0.91192883 0.91192883
           0.91192883 0.91192883 0.91192883 0.82976043 0.553577   0.553577
           0.12504171 0.               -inf]
          [      -inf 0.         0.         0.         0.13050182 0.4743388
           0.8111382  0.91192883 0.91192883 0.91192883 0.91192883 0.91192883
           0.91192883 0.91192883 0.91192883 0.82976043 0.553577   0.553577
           0.12504171 0.               -inf]
          [      -inf 0.         0.         0.         0.         0.27469626
           0.8111382  0.91192883 0.91192883 0.91192883 0.91192883 0.91192883
           0.91192883 0.91192883 0.91192883 0.82976043 0.553577   0.553577
           0.12504171 0.               -inf]]
       
         [[      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.5350753
           0.6824833  0.6824833  0.6824833  0.6824833  0.6824833  0.6824833
           0.6824833  0.6824833  0.64222074 0.52259576 0.05796025 0.05047476
           0.04700947 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.5350753
           0.6824833  0.6824833  0.6824833  0.6824833  0.6824833  0.6824833
           0.6824833  0.6824833  0.64222074 0.52259576 0.11508992 0.11508992
           0.04700947 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.5350753
           0.6824833  0.6824833  0.6824833  0.6824833  0.6824833  0.6824833
           0.6824833  0.6824833  0.64222074 0.52259576 0.45839888 0.45839888
           0.13897316 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.5350753
           0.6824833  0.6824833  0.6824833  0.8296574  0.8296574  0.8296574
           0.8296574  0.8296574  0.8296574  0.8296574  0.8296574  0.45839888
           0.13897316 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.5350753
           0.7597559  0.7597559  0.7597559  0.8296574  0.8296574  0.8296574
           0.8296574  0.8296574  0.8296574  0.8296574  0.8296574  0.45839888
           0.13897316 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.2790401  0.32982445
           0.7597559  0.7597559  0.7597559  0.8296574  0.8296574  0.8296574
           0.8296574  0.8296574  0.8296574  0.8296574  0.8296574  0.45839888
           0.13897316 0.04700947       -inf]
          [      -inf 0.04700947 0.04700947 0.04700947 0.09352955 0.32982445
           0.7597559  0.7597559  0.7597559  0.8296574  0.8296574  0.8296574
           0.8296574  0.8296574  0.8296574  0.8296574  0.8296574  0.45839888
           0.13897316 0.04700947       -inf]]
       
         [[      -inf 0.08819141 0.08819141 0.08819141 0.42767075 0.42767075
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.2799036  0.2799036  0.13443573 0.08819141
           0.08819141 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.42767075 0.42767075
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.2799036  0.2799036  0.13443573 0.09712857
           0.09712857 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.42767075 0.42767075
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.2799036  0.2799036  0.13443573 0.11171624
           0.11171624 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.42767075 0.42767075
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.2799036  0.2799036  0.22847664 0.22847664
           0.22847664 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.42767075 0.42767075
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.36671627 0.36671627 0.36671627 0.22847664
           0.22847664 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.33895338 0.40968794
           0.76685077 0.76685077 0.76685077 0.76685077 0.76685077 0.76685077
           0.76685077 0.76685077 0.36671627 0.36671627 0.36671627 0.22847664
           0.22847664 0.08819141       -inf]
          [      -inf 0.08819141 0.08819141 0.08819141 0.1533747  0.40968794
           0.5787783  0.5787783  0.5787783  0.5787783  0.5787783  0.5787783
           0.5787783  0.5787783  0.36671627 0.36671627 0.36671627 0.22847664
           0.22847664 0.08819141       -inf]]
       
         [[      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.01187035 0.01187035
           0.01187035 0.01187035 0.01187035 0.01187035 0.01187035 0.01187035
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]
          [      -inf 0.         0.         0.         0.         0.
           0.         0.         0.         0.         0.         0.
           0.         0.         0.         0.         0.         0.
           0.         0.               -inf]]]], dtype=float32)

Minimal Reproduce

import jittor
import numpy as np
import copy
import random

seed = 42
random.seed(seed)
np.random.seed(seed)
jittor.seed(seed)

def chebyshev_distance(A: np.ndarray, B: np.ndarray):
    if A is None or B is None:
        return 0.0
    if A.shape != B.shape:
        return 9999999
    else:
        return float(np.max(np.abs(A - B)))

# data = np.load('./maxpool2d_input_2.npz')['inp']
data = [
    [
        [
            [0., 0., 0., 0., 0., 0.15685005, 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0.2040826, 0.3494063, 0.40253597, 0., 0., 0., 0., 0.],
            [0., 0., 0., 0.14927946, 0.24003847, 0.37717146, 0.07421438, 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.17000304, 0.04403594, 0.04129967, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.02591759, 0., 0.09126398, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.05346677, 0., 0.12202908, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.08989008, 0., 0.1905561, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0.01642773, 0.21769403, 0., 0.41456258, 0.126469, 0., 0., 0.],
            [0., 0., 0., 0., 0.13199194, 0.17417265, 0.4077577, 0.5095002, 0.28187984, 0.05536239, 0., 0.],
            [0., 0., 0., 0., 0.1898546, 0.12335719, 0.34951448, 0.15104438, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
        ],
        [
            [0.04340693, 0.04340693, 0.04340693, 0.04340693, 0.09511481, 0.18995853, 0.14531037, 0.01903103, 0.0065299, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.09891686, 0.26693964, 0.43398163, 0., 0., 0.00160573, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.22493003, 0.3476484, 0.09090321, 0., 0., 0.05481253, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.20389429, 0.04783146, 0., 0., 0., 0.04340693, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.0726514, 0., 0.12019433, 0., 0., 0.04340693, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.0153887, 0.01219215, 0.17619793, 0., 0., 0.04340693, 0.04340693, 0.04340693, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.04340693, 0.11530609, 0.20969972, 0.00198663, 0., 0.0522819, 0.06172927, 0.03638273, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.04340693, 0.29556984, 0.24648133, 0., 0.06053366, 0.08640017, 0., 0., 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.06469841, 0.33969164, 0.3272777, 0., 0.15092641, 0.10883322, 0., 0.02563027, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.11939006, 0.19932903, 0.12497775, 0., 0., 0., 0., 0.08627508, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0.15981312, 0.17869246, 0.10284844, 0., 0., 0., 0., 0.04070441, 0.04340693],
            [0.04340693, 0.04340693, 0.04340693, 0., 0., 0., 0., 0., 0.02189272, 0.04340693, 0.04340693, 0.04340693]
        ],
        [
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0.07220851, 0.1880362, 0.43907446, 0.27227283, 0.00155765, 0., 0., 0.],
            [0., 0., 0., 0.05905887, 0.544625, 0.66681546, 0.6857215, 0.18234831, 0., 0., 0., 0.],
            [0., 0., 0., 0.13050182, 0.4743388, 0.7056737, 0.70074594, 0.06390604, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.17869282, 0.52951497, 0.03458298, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.11606291, 0.40798056, 0.00117774, 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.12643212, 0.37192938, 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0.22793597, 0.33495057, 0., 0., 0.0798424, 0., 0.],
            [0., 0., 0., 0., 0.13454145, 0.35454372, 0.4550567, 0.6206174, 0.43545264, 0.553577, 0.12504171, 0.],
            [0., 0., 0., 0., 0.27469626, 0.8111382, 0.91192883, 0.82976043, 0.49622396, 0.11247639, 0., 0.],
            [0., 0., 0., 0., 0.18815821, 0.28644323, 0.2716272, 0.10448416, 0., 0., 0., 0.]
        ],
        [
            [0.04700947, 0.04700947, 0.04700947, 0.04700947, 0.08651208, 0., 0., 0.04228427, 0.04592258, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.08941668, 0., 0., 0.16602537, 0.52259576, 0.05796025, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0., 0., 0.47727212, 0.64222074, 0.33341566, 0.0247089, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.02086113, 0.5350753, 0.6824833, 0.5170374, 0.18436384, 0.04700947, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.2790401, 0.2999647, 0.28442162, 0.35599712, 0.17063603, 0.04700947, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.06666827, 0.08049754, 0.18446739, 0.47047907, 0.15492289, 0.04700947, 0.04700947, 0.04700947, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.04700947, 0.06533378, 0.15004528, 0.4852689, 0.04199514, 0.03486224, 0.05047476, 0.04680244, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.04700947, 0.10049464, 0.1440804, 0.4347712, 0.04229088, 0., 0.11508992, 0., 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.06327525, 0., 0.28503057, 0.3503591, 0.05242874, 0.23865211, 0.45839888, 0.13897316, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.01270876, 0.04840504, 0.53035474, 0.46597266, 0.6395123, 0.8296574, 0.19922033, 0., 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.07608382, 0.32982445, 0.7597559, 0.67719126, 0.45816907, 0.18187274, 0., 0.04072466, 0.04700947],
            [0.04700947, 0.04700947, 0.04700947, 0.09352955, 0.21165699, 0.24615076, 0.01711456, 0., 0.00277855, 0.04700947, 0.04700947, 0.04700947]
        ],
        [
            [0.08819141, 0.08819141, 0.08819141, 0.08819141, 0.08842978, 0.06145801, 0., 0., 0.08704833, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.08844731, 0.09901631, 0.17924073, 0., 0., 0.06749697, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.11146501, 0.20169947, 0.02148412, 0., 0.05455584, 0.13443573, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.42767075, 0.15973106, 0.29937133, 0.01271471, 0.18290591, 0.08819141, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.33895338, 0.17126837, 0.76685077, 0., 0.15206587, 0.08819141, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.1017458, 0.08857994, 0.56584215, 0., 0.18455982, 0.08819141, 0.08819141, 0.08819141, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.08819141, 0.11446189, 0.5787783, 0., 0.2799036, 0.06322102, 0.07392699, 0.08797368, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.08819141, 0.17532063, 0.56458676, 0., 0.1815764, 0.10056813, 0., 0.09712857, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.08828957, 0.170097, 0.34632617, 0., 0.18686679, 0.02133245, 0., 0.11171624, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.1533747, 0.3009949, 0.07615723, 0.1458463, 0.18052286, 0.01083277, 0.1594953, 0.22847664, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.13598761, 0.40968794, 0.25677565, 0.3280553, 0.31480962, 0.36671627, 0.21937025, 0.09177419, 0.08819141],
            [0.08819141, 0.08819141, 0.08819141, 0.10308773, 0.30095595, 0.33695114, 0.32765555, 0.20539683, 0.11546265, 0.08819141, 0.08819141, 0.08819141]
        ],
        [
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0.01187035, 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],
            [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]
        ]
    ]
]


jittor.flags.use_cuda = 0
input_c = jittor.array(data).float32()
pool_cpu = jittor.nn.MaxPool2d(kernel_size=8, stride=1, ceil_mode=False, return_indices=False, padding=(1, 8))
output_c = pool_cpu(input_c)

jittor.flags.use_cuda = 1
input_g = jittor.array(data).float32()
pool_gpu = copy.deepcopy(pool_cpu)
output_g = pool_gpu(input_g)

print(output_c)
print(output_g)

Expected behavior

输出无异常值

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

No branches or pull requests

1 participant