!27411 mindrt takes over hete with loop sink

Merge pull request !27411 from baihuawei/hetert
This commit is contained in:
i-robot 2021-12-10 09:44:29 +00:00 committed by Gitee
commit 9e37e77dc2
2 changed files with 4 additions and 3 deletions

View File

@ -189,10 +189,11 @@ void SetLoopCount(const ResourcePtr &resource) {
size_t graph_nums = manager->func_graphs().size();
int64_t loop_size = ConfigManager::GetInstance().iter_num();
const auto context_ptr = MsContext::GetInstance();
bool enable_mind_rt = context_ptr->get_param<bool>(MS_CTX_ENABLE_MINDRT);
if (context_ptr->get_param<std::string>(MS_CTX_DEVICE_TARGET) == kAscendDevice) {
resource->set_vm_loop(!context_ptr->get_param<bool>(MS_CTX_IS_MULTI_GRAPH_SINK), loop_size);
resource->set_vm_loop(!(context_ptr->get_param<bool>(MS_CTX_IS_MULTI_GRAPH_SINK) || enable_mind_rt), loop_size);
} else if (context_ptr->get_param<std::string>(MS_CTX_DEVICE_TARGET) == kGPUDevice) {
bool run_with_mind_rt = graph_nums == 1 || context_ptr->get_param<bool>(MS_CTX_ENABLE_MINDRT);
bool run_with_mind_rt = graph_nums == 1 || enable_mind_rt;
resource->set_vm_loop(!run_with_mind_rt, loop_size);
}
MS_LOG(INFO) << "Change vm_loop_flag to " << resource->vm_loop_flag() << ", set loop_size to " << loop_size;

View File

@ -371,7 +371,7 @@ def multinomial(inputs, num_sample, replacement=True, seed=None):
>>> output = ops.multinomial(x, 4)
>>> print(output)
[1 1 2 1]
>>> # case 3: num_sample == x_length = 4, and replacement is True, Can extract the same elements。
>>> # case 3: The output is random, num_sample == x_length = 4, and replacement is True, Can extract the same elements。
>>> x = Tensor([0, 9, 4, 0], mstype.float32)
>>> output = ops.multinomial(x, 4, True)
>>> print(output)