未验证 提交 4f2cf7fb 编写于 作者: X xiaoxiaohehe001 提交者: GitHub

[Paddle Inference] Set softmax op use_cudnn default true. (#56036)

* fix_softmax_eigen

* fix_ctest_seresnet

* fix_ci_error
上级 b4a4f1bb
...@@ -2528,7 +2528,7 @@ ...@@ -2528,7 +2528,7 @@
softmax : GetSoftmaxExpectedKernelType softmax : GetSoftmaxExpectedKernelType
softmax_grad : GetSoftmaxGradExpectedKernelType softmax_grad : GetSoftmaxGradExpectedKernelType
extra : extra :
attrs : [str data_format = "AnyLayout", bool use_cudnn=false, bool use_mkldnn = false, str mkldnn_data_type = "float32", bool is_test = false] attrs : [str data_format = "AnyLayout", bool use_cudnn = true, bool use_mkldnn = false, str mkldnn_data_type = "float32", bool is_test = false]
- op : softplus - op : softplus
backward : softplus_grad, softplus_double_grad backward : softplus_grad, softplus_double_grad
......
...@@ -218,7 +218,7 @@ class DistSeResneXt2x2(TestDistRunnerBase): ...@@ -218,7 +218,7 @@ class DistSeResneXt2x2(TestDistRunnerBase):
model = SE_ResNeXt(layers=50) model = SE_ResNeXt(layers=50)
out = model.net(input=image, class_dim=102) out = model.net(input=image, class_dim=102)
cost = paddle.nn.functional.cross_entropy( cost = paddle.nn.functional.cross_entropy(
input=out, label=label, reduction='none', use_softmax=False input=out, label=label, reduction='none', use_softmax=True
) )
avg_cost = paddle.mean(x=cost) avg_cost = paddle.mean(x=cost)
......
...@@ -171,7 +171,7 @@ def SE_ResNeXt50Small(use_feed): ...@@ -171,7 +171,7 @@ def SE_ResNeXt50Small(use_feed):
# Classifier layer: # Classifier layer:
prediction = paddle.static.nn.fc(x=dropout, size=1000, activation='softmax') prediction = paddle.static.nn.fc(x=dropout, size=1000, activation='softmax')
loss = paddle.nn.functional.cross_entropy( loss = paddle.nn.functional.cross_entropy(
input=prediction, label=label, reduction='none', use_softmax=False input=prediction, label=label, reduction='none', use_softmax=True
) )
loss = paddle.mean(loss) loss = paddle.mean(loss)
return loss return loss
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册