From 36fbd5a65a2e2a1a2f797675561671b4d824d25e Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Wed, 7 Apr 2021 10:55:20 +0800 Subject: [PATCH] fix(mgb): fix spell error GitOrigin-RevId: acae00e0a54daf5a18a775bcf8bb5d2469f337cb --- dnn/src/x86/conv_bias/opr_impl.cpp | 2 +- imperative/python/megengine/functional/debug_param.py | 2 +- imperative/python/src/graph_rt.cpp | 2 +- sdk/load-and-run/src/mgblar.cpp | 2 +- src/gopt/test/inference.cpp | 4 ++-- src/opr/impl/search_policy/algo_chooser.cpp | 2 +- src/opr/test/dnn/convolution.cpp | 10 +++++----- tools/param_defs/mgb_opr_param_defs.py | 3 ++- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dnn/src/x86/conv_bias/opr_impl.cpp b/dnn/src/x86/conv_bias/opr_impl.cpp index 3244b47c6..a71d55819 100644 --- a/dnn/src/x86/conv_bias/opr_impl.cpp +++ b/dnn/src/x86/conv_bias/opr_impl.cpp @@ -185,7 +185,7 @@ SmallVector ConvBiasImpl::suggest_algo_category_order( } //! conv1x1 im2col_prefer |= (FH == 1 && FW == 1); - //! x86 8x8x16 not optmized, so it will use fallback im2col+matmul + //! x86 8x8x16 not optimized, so it will use fallback im2col+matmul if (param.deduce_algo_data_type() == AlgoDataType::INT8X8X16) { im2col_prefer = true; } diff --git a/imperative/python/megengine/functional/debug_param.py b/imperative/python/megengine/functional/debug_param.py index 08bace859..7467eb731 100644 --- a/imperative/python/megengine/functional/debug_param.py +++ b/imperative/python/megengine/functional/debug_param.py @@ -40,7 +40,7 @@ def set_execution_strategy(option): * HEURISTIC uses heuristic to choose the fastest algorithm. * PROFILE runs possible algorithms on real device to find the best one. * REPRODUCIBLE uses the algorithms that is reproducible. - * OPTMIZED uses the algorithms that is optimized. + * OPTIMIZED uses the algorithms that is optimized. The default strategy is HEURISTIC, this options can be combined to form a combination option, e.g. PROFILE | REPRODUCIBLE diff --git a/imperative/python/src/graph_rt.cpp b/imperative/python/src/graph_rt.cpp index 240bbdbf6..228d69ab5 100644 --- a/imperative/python/src/graph_rt.cpp +++ b/imperative/python/src/graph_rt.cpp @@ -266,7 +266,7 @@ void init_graph_rt(py::module m) { {"HEURISTIC", [&]() { stg = _AlgoStrategy::HEURISTIC; }}, {"PROFILE", [&]() { stg = _AlgoStrategy::PROFILE; }}, {"REPRODUCIBLE", [&]() { stg = _AlgoStrategy::REPRODUCIBLE; }}, - {"OPTMIZED", [&]() { stg = _AlgoStrategy::OPTMIZED; }}, + {"OPTIMIZED", [&]() { stg = _AlgoStrategy::OPTIMIZED; }}, }; auto it = m.find(strategy); mgb_assert(it != m.end(), "Invalid strategy string!"); diff --git a/sdk/load-and-run/src/mgblar.cpp b/sdk/load-and-run/src/mgblar.cpp index e51ffa6a2..87b3a1921 100644 --- a/sdk/load-and-run/src/mgblar.cpp +++ b/sdk/load-and-run/src/mgblar.cpp @@ -709,7 +709,7 @@ void run_test_st(Args &env) { strategy = S::PROFILE; } } else if (env.use_fast_run) { - strategy = S::PROFILE | S::OPTMIZED; + strategy = S::PROFILE | S::OPTIMIZED; } else if (env.reproducible) { strategy = S::HEURISTIC | S::REPRODUCIBLE; } diff --git a/src/gopt/test/inference.cpp b/src/gopt/test/inference.cpp index 08c3b0a1c..70518421c 100644 --- a/src/gopt/test/inference.cpp +++ b/src/gopt/test/inference.cpp @@ -1756,8 +1756,8 @@ TEST(TestGoptInference, FastProfileCache) { using S = opr::Convolution::ExecutionPolicy::Strategy; ASSERT_EQ(S::HEURISTIC, conv.execution_policy_transient().strategy); gopt::modify_opr_algo_strategy_inplace({z + 2.3f}, - S::PROFILE | S::OPTMIZED); - ASSERT_EQ(S::PROFILE | S::OPTMIZED, conv.execution_policy().strategy); + S::PROFILE | S::OPTIMIZED); + ASSERT_EQ(S::PROFILE | S::OPTIMIZED, conv.execution_policy().strategy); } TEST(TestGoptInference, AlgoWorkspaceLimit) { diff --git a/src/opr/impl/search_policy/algo_chooser.cpp b/src/opr/impl/search_policy/algo_chooser.cpp index 9f712c404..97b554c1d 100644 --- a/src/opr/impl/search_policy/algo_chooser.cpp +++ b/src/opr/impl/search_policy/algo_chooser.cpp @@ -283,7 +283,7 @@ std::vector flatten_search_space( static bool algo_attribute_match_strategy(AlgoAttribute attribute, ExecutionStrategy selected_strategy) { bool ret = true; - if (selected_strategy & ExecutionStrategy::OPTMIZED) { + if (selected_strategy & ExecutionStrategy::OPTIMIZED) { ret &= (!static_cast(AlgoAttribute::NAIVE & attribute)); } else if (selected_strategy & ExecutionStrategy::REPRODUCIBLE) { ret &= static_cast(AlgoAttribute::REPRODUCIBLE & attribute); diff --git a/src/opr/test/dnn/convolution.cpp b/src/opr/test/dnn/convolution.cpp index 7736975d2..ccd3aebcd 100644 --- a/src/opr/test/dnn/convolution.cpp +++ b/src/opr/test/dnn/convolution.cpp @@ -357,7 +357,7 @@ TEST(TestOprDNN, ConvBiasExePolicy) { #if MGB_ENABLE_FASTRUN for (auto strategy : SmallVector{S::PROFILE, S::HEURISTIC, S::PROFILE | S::REPRODUCIBLE, - S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTMIZED}) { + S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTIMIZED}) { #else for (auto strategy : SmallVector{S : HEURISTIC, S::PROFILE | S::HEURISTIC}) { @@ -444,7 +444,7 @@ TEST(TestOprDNN, ConvolutionExePolicy) { #if MGB_ENABLE_FASTRUN for (auto strategy : SmallVector{S::PROFILE, S::HEURISTIC, S::PROFILE | S::REPRODUCIBLE, - S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTMIZED}) { + S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTIMIZED}) { #else for (auto strategy : SmallVector{S : HEURISTIC, S::PROFILE | S::HEURISTIC}) { @@ -1717,7 +1717,7 @@ TEST(TestOprDNN, LocalShareForwardExecPolicy) { #if MGB_ENABLE_FASTRUN for (auto strategy : SmallVector{S::PROFILE, S::HEURISTIC, S::PROFILE | S::REPRODUCIBLE, - S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTMIZED}) { + S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTIMIZED}) { #else for (auto strategy : SmallVector{S : HEURISTIC, S::PROFILE | S::HEURISTIC}) { @@ -1828,7 +1828,7 @@ TEST(TestOprDNN, DeformableConvForward) { #if MGB_ENABLE_FASTRUN for (auto strategy : SmallVector{S::PROFILE, S::HEURISTIC, S::PROFILE | S::REPRODUCIBLE, - S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTMIZED}) { + S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTIMIZED}) { #else for (auto strategy : SmallVector{S : HEURISTIC, S::PROFILE | S::HEURISTIC}) { @@ -1997,7 +1997,7 @@ TEST(TestOprDNN, BatchConvBiasForward) { #if MGB_ENABLE_FASTRUN for (auto strategy : SmallVector{S::PROFILE, S::HEURISTIC, S::PROFILE | S::REPRODUCIBLE, - S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTMIZED}) { + S::PROFILE | S::HEURISTIC, S::PROFILE | S::OPTIMIZED}) { #else for (auto strategy : SmallVector{S : HEURISTIC, S::PROFILE | S::HEURISTIC}) { diff --git a/tools/param_defs/mgb_opr_param_defs.py b/tools/param_defs/mgb_opr_param_defs.py index cd46edd2a..b32d2087d 100644 --- a/tools/param_defs/mgb_opr_param_defs.py +++ b/tools/param_defs/mgb_opr_param_defs.py @@ -41,12 +41,13 @@ pdef('PersistentOutputStorage').add_fields( Doc('REPRODUCIBLE', 'when profile or heuristic algo selection it require the algos' 'must be reproducible'), - Doc('OPTMIZED', + Doc('OPTIMIZED', 'profile require algos are optmized to achieve fast-profile'), default=('HEURISTIC',), member_alias=[(('HEURISTIC', 'REPRODUCIBLE'), 'HEURISTIC_REPRODUCIBLE'), (('PROFILE', 'REPRODUCIBLE'), 'PROFILE_REPRODUCIBLE'), (('PROFILE', 'HEURISTIC'), 'PROFILE_HEURISTIC'), + (('OPTIMIZED',), 'OPTMIZED'), ]). add_fields('uint64', Doc('workspace_limit', 'workspace limit in bytes'), -- GitLab