forked from mindspore-Ecosystem/mindspore
!11010 Fix bug of RunOp context checker in GRAPH_MODE
From: @jojobugfree Reviewed-by: @kisnwang,@chujinjin Signed-off-by: @chujinjin
This commit is contained in:
commit
437816551e
mindspore/ccsrc/pipeline/pynative
|
@ -525,10 +525,13 @@ PynativeExecutor::~PynativeExecutor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckPyNativeContext() {
|
void CheckPyNativeContext() {
|
||||||
auto context = parallel::ParallelContext::GetInstance();
|
auto parallel_context = parallel::ParallelContext::GetInstance();
|
||||||
MS_EXCEPTION_IF_NULL(context);
|
MS_EXCEPTION_IF_NULL(parallel_context);
|
||||||
auto parallel_mode = context->parallel_mode();
|
auto ms_context = MsContext::GetInstance();
|
||||||
if (parallel_mode != parallel::STAND_ALONE && parallel_mode != parallel::DATA_PARALLEL) {
|
MS_EXCEPTION_IF_NULL(ms_context);
|
||||||
|
auto parallel_mode = parallel_context->parallel_mode();
|
||||||
|
if (parallel_mode != parallel::STAND_ALONE && parallel_mode != parallel::DATA_PARALLEL &&
|
||||||
|
ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode) {
|
||||||
MS_LOG(EXCEPTION) << "PyNative Only support STAND_ALONE and DATA_PARALLEL, but got:" << parallel_mode;
|
MS_LOG(EXCEPTION) << "PyNative Only support STAND_ALONE and DATA_PARALLEL, but got:" << parallel_mode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue