Skip to content

Commit defa974

Browse files
committed
update
1 parent 156852f commit defa974

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

paddle/fluid/pybind/pybind.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ bool SupportsInt8() {
405405
#endif
406406
}
407407

408+
bool SupportsAvx512F() {
409+
return phi::backends::cpu::MayIUse(phi::backends::cpu::cpu_isa_t::avx512f);
410+
}
411+
408412
bool SupportsVNNI() {
409413
#ifndef PADDLE_WITH_DNNL
410414
return false;
@@ -2153,6 +2157,7 @@ All parameter, weight, gradient are variables in Paddle.
21532157
m.def("supports_bfloat16", SupportsBfloat16);
21542158
m.def("supports_bfloat16_fast_performance", SupportsBfloat16FastPerformance);
21552159
m.def("supports_int8", SupportsInt8);
2160+
m.def("supports_avx512f", SupportsAvx512F);
21562161
m.def("supports_vnni", SupportsVNNI);
21572162
m.def("op_supported_infos", imperative::OpSupportedInfos);
21582163
m.def("is_compiled_with_brpc", IsCompiledWithBrpc);

test/legacy_test/test_fused_layernorm_op.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def test_residual_bias_add_layernorm_int8(self):
793793

794794

795795
@unittest.skipIf(
796-
not core.avx_supported() or not core.is_compiled_with_avx(),
796+
not core.supports_avx512f() or not core.is_compiled_with_avx(),
797797
"machine is not support AVX or is not compiled with AVX",
798798
)
799799
class TestlayernormOpCPU(unittest.TestCase):
@@ -939,7 +939,7 @@ def test_residual_bias_add_layernorm(self):
939939

940940

941941
@unittest.skipIf(
942-
not core.avx_supported() or not core.is_compiled_with_avx(),
942+
not core.supports_avx512f() or not core.is_compiled_with_avx(),
943943
"machine is not support AVX or is not compiled with AVX",
944944
)
945945
class TestlayernormStaticOpCPU(unittest.TestCase):

0 commit comments

Comments
 (0)