未验证 提交 7c542c29 编写于 作者: Z zhangbo9674 提交者: GitHub

Improve some control conditions of bfloat16 OP unittest (#45639)

上级 b12c27eb
develop 1.8.5 2.4.1 Ligoml-patch-1 add_kylinv10 bugfix-eval-frame-leakgae cherry-pick-fix-customOP-random-fail cp_2.4_fix_numpy fix-numpy-issue fix-run-program-grad-node-mem fix_check fix_custom_device_copy_sync fix_dlpack_for fix_newexe_gc fix_var_stop_gradient_error hack_event incuabte/new_frl incubate/frl_train_eval incubate/new_frl incubate/new_frl_rc incubate/stride layer_norm matmul_double_grad operator_opt pass-compile-eval-frame prv-md-even-more prv-reshape-mkldnn-ut2 release-deleted/2.5 release-rc/2.5 release/2.4 release/2.5 release/llm_2.5 revert-45808-phi/simplify_size_op revert-46827-deform_comment revert-47325-remove_cudnn_hardcode revert-47645-add_npu_storage_dims revert-48815-set_free_when_no_cache_hit_default_value_true revert-49499-test_ninja_on_ci revert-49654-prim_api_gen revert-49673-modify_get_single_cov revert-49763-fix_static_composite_gen revert-50158-fix_found_inf_bug_for_custom_optimizer revert-50188-refine_optimizer_create_accumulators revert-50335-fix_optminizer_set_auxiliary_var_bug revert-51676-flag_delete revert-51850-fix_softmaxce_dev revert-52175-dev_peak_memory revert-52186-deve revert-52523-test_py38 revert-52912-develop revert-53248-set_cmake_policy revert-54029-fix_windows_compile_bug revert-54068-support_translating_op_attribute revert-54214-modify_cmake_dependencies revert-54370-offline_pslib revert-54391-fix_cmake_md5error revert-54411-fix_cpp17_compile revert-54466-offline_pslib revert-54480-cmake-rocksdb revert-55568-fix_BF16_bug1 revert-56328-new_ir_support_vector_type_place_transfer revert-56366-fix_openssl_bug revert-56545-revert-56366-fix_openssl_bug revert-56620-fix_new_ir_ocr_bug revert-56925-check_inputs_grad_semantic revert-57005-refine_stride_flag sd_conv_linear_autocast semi-auto/rule-base support-0D-sort test_for_Filtetfiles zhiqiu-patch-1 v2.5.1 v2.5.0 v2.5.0-rc1 v2.5.0-rc0 v2.4.2 v2.4.1 v2.4.0 v2.4.0-rc0
无相关合并请求
......@@ -108,8 +108,10 @@ class TestFP16ElementwiseAddOp(TestElementwiseAddOp):
@unittest.skipIf(
not core.is_compiled_with_cuda() or core.cudnn_version() < 8100,
"core is not compiled with CUDA and cudnn version need larger than 8.1.0")
not core.is_compiled_with_cuda() or core.cudnn_version() < 8100
or paddle.device.cuda.get_device_capability()[0] < 8,
"only support compiled with CUDA and cudnn version need larger than 8.1.0 and device's compute capability is at least 8.0"
)
class TestBF16ElementwiseAddOp(OpTest):
def setUp(self):
......
......@@ -62,9 +62,11 @@ class TestElementwiseOp(OpTest):
no_grad_set=set('Y'))
@unittest.skipIf(
core.is_compiled_with_cuda() and core.cudnn_version() < 8100,
"run test when gpu is availble and the minimum cudnn version is 8.1.0.")
@unittest.skipIf(core.is_compiled_with_cuda() and (
core.cudnn_version() < 8100
or paddle.device.cuda.get_device_capability()[0] < 8
), "run test when gpu is availble and the minimum cudnn version is 8.1.0 and gpu's compute capability is at least 8.0."
)
class TestElementwiseBF16Op(OpTest):
def setUp(self):
......
......@@ -417,7 +417,9 @@ class TestBF16ScaleBiasLayerNorm(unittest.TestCase):
return y_np, x_g_np, w_g_np, b_g_np
def test_main(self):
if (not core.is_compiled_with_cuda()) or (core.cudnn_version() < 8100):
if (not core.is_compiled_with_cuda()) or (
core.cudnn_version() <
8100) or (paddle.device.cuda.get_device_capability()[0] < 8):
return
x_np = np.random.random([10, 20]).astype('float32')
weight_np = np.random.random([20]).astype('float32')
......
......@@ -360,8 +360,10 @@ class TestSoftmaxBF16Op(OpTest):
@unittest.skipIf(
not core.is_compiled_with_cuda() or core.cudnn_version() < 8100,
"core is not compiled with CUDA and cudnn version need larger than 8.1.0")
not core.is_compiled_with_cuda() or core.cudnn_version() < 8100
or paddle.device.cuda.get_device_capability()[0] < 8,
"only support compiled with CUDA and cudnn version need larger than 8.1.0 and device's compute capability is at least 8.0"
)
class TestSoftmaxBF16CUDNNOp(TestSoftmaxBF16Op):
def init_cudnn(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部