Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bukejiyu committed Apr 8, 2024
1 parent 156852f commit defa974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions paddle/fluid/pybind/pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ bool SupportsInt8() {
#endif
}

bool SupportsAvx512F() {
return phi::backends::cpu::MayIUse(phi::backends::cpu::cpu_isa_t::avx512f);
}

bool SupportsVNNI() {
#ifndef PADDLE_WITH_DNNL
return false;
Expand Down Expand Up @@ -2153,6 +2157,7 @@ All parameter, weight, gradient are variables in Paddle.
m.def("supports_bfloat16", SupportsBfloat16);
m.def("supports_bfloat16_fast_performance", SupportsBfloat16FastPerformance);
m.def("supports_int8", SupportsInt8);
m.def("supports_avx512f", SupportsAvx512F);
m.def("supports_vnni", SupportsVNNI);
m.def("op_supported_infos", imperative::OpSupportedInfos);
m.def("is_compiled_with_brpc", IsCompiledWithBrpc);
Expand Down
4 changes: 2 additions & 2 deletions test/legacy_test/test_fused_layernorm_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ def test_residual_bias_add_layernorm_int8(self):


@unittest.skipIf(
not core.avx_supported() or not core.is_compiled_with_avx(),
not core.supports_avx512f() or not core.is_compiled_with_avx(),
"machine is not support AVX or is not compiled with AVX",
)
class TestlayernormOpCPU(unittest.TestCase):
Expand Down Expand Up @@ -939,7 +939,7 @@ def test_residual_bias_add_layernorm(self):


@unittest.skipIf(
not core.avx_supported() or not core.is_compiled_with_avx(),
not core.supports_avx512f() or not core.is_compiled_with_avx(),
"machine is not support AVX or is not compiled with AVX",
)
class TestlayernormStaticOpCPU(unittest.TestCase):
Expand Down

0 comments on commit defa974

Please sign in to comment.