提交 21280d2f 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!963 [Bert lossscale]fix bug of too big static memory

Merge pull request !963 from chenfei_mindspore/fix-bug-of-too-big-static-mem
......@@ -21,8 +21,8 @@
namespace mindspore {
namespace device {
namespace ascend {
const uint64_t kAscendDeviceMemGB = 20;
const uint64_t kAscendMemPoolGB = 10;
const uint64_t kAscendDeviceMemGB = 24;
const uint64_t kAscendMemPoolGB = 6;
const uint64_t kAscendDeviceMemSize = (kAscendDeviceMemGB << 30);
const uint64_t kAscendMemPoolSize = (kAscendMemPoolGB << 30);
......
......@@ -243,11 +243,17 @@ void KernelRuntime::RunOpAssignWorkSpaceMemory(const AnfNodePtr &kernel) {
void KernelRuntime::AssignStaticMemoryInput(const session::KernelGraph *graph) {
MS_EXCEPTION_IF_NULL(graph);
MS_EXCEPTION_IF_NULL(mem_manager_);
for (auto &item : graph->inputs()) {
auto graph_inputs = graph->inputs();
auto graph_valid_input = graph->valid_inputs();
for (size_t i = 0; i < graph_inputs.size(); i++) {
auto item = graph_inputs[i];
MS_EXCEPTION_IF_NULL(item);
if (!item->isa<Parameter>()) {
continue;
}
if (i < graph_valid_input.size() && !graph_valid_input[i]) {
continue;
}
if (AnfAlgo::OutputAddrExist(item, 0)) {
continue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册