Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
0c316e52
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0c316e52
编写于
9月 09, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
9月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
!5866 clean idle mem at proper time
Merge pull request !5866 from liangzelang/fix_global_step_error
上级
eff187d8
4c729107
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
0 deletion
+9
-0
mindspore/ccsrc/backend/session/ascend_session.cc
mindspore/ccsrc/backend/session/ascend_session.cc
+1
-0
mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc
...pore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc
+2
-0
mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h
...spore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h
+1
-0
mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc
...pore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc
+2
-0
mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.h
...spore/ccsrc/runtime/device/ascend/ascend_memory_manager.h
+1
-0
mindspore/ccsrc/runtime/device/kernel_runtime.h
mindspore/ccsrc/runtime/device/kernel_runtime.h
+1
-0
mindspore/ccsrc/runtime/device/memory_manager.h
mindspore/ccsrc/runtime/device/memory_manager.h
+1
-0
未找到文件。
mindspore/ccsrc/backend/session/ascend_session.cc
浏览文件 @
0c316e52
...
@@ -1014,6 +1014,7 @@ void AscendSession::AssignStaticMemory(NotNull<KernelGraphPtr> graph,
...
@@ -1014,6 +1014,7 @@ void AscendSession::AssignStaticMemory(NotNull<KernelGraphPtr> graph,
// assign static memory for parameters
// assign static memory for parameters
auto
runtime_instance
=
device
::
KernelRuntimeManager
::
Instance
().
GetKernelRuntime
(
kAscendDevice
,
device_id_
);
auto
runtime_instance
=
device
::
KernelRuntimeManager
::
Instance
().
GetKernelRuntime
(
kAscendDevice
,
device_id_
);
MS_EXCEPTION_IF_NULL
(
runtime_instance
);
MS_EXCEPTION_IF_NULL
(
runtime_instance
);
runtime_instance
->
ClearGlobalIdleMem
();
runtime_instance
->
AssignStaticMemoryInput
(
graph
.
get
().
get
());
runtime_instance
->
AssignStaticMemoryInput
(
graph
.
get
().
get
());
runtime_instance
->
AssignStaticMemoryValueNode
(
graph
.
get
().
get
());
runtime_instance
->
AssignStaticMemoryValueNode
(
graph
.
get
().
get
());
for
(
auto
&
child_graph
:
graph
->
child_graph_order
())
{
for
(
auto
&
child_graph
:
graph
->
child_graph_order
())
{
...
...
mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc
浏览文件 @
0c316e52
...
@@ -155,6 +155,8 @@ void AscendKernelRuntime::ClearGraphRuntimeResource(uint32_t graph_id, const std
...
@@ -155,6 +155,8 @@ void AscendKernelRuntime::ClearGraphRuntimeResource(uint32_t graph_id, const std
}
}
}
}
void
AscendKernelRuntime
::
ClearGlobalIdleMem
()
{
mem_manager_
->
ClearGlobalIdleMem
();
}
bool
AscendKernelRuntime
::
NeedDestroyHccl
()
{
bool
AscendKernelRuntime
::
NeedDestroyHccl
()
{
auto
context_ptr
=
MsContext
::
GetInstance
();
auto
context_ptr
=
MsContext
::
GetInstance
();
MS_EXCEPTION_IF_NULL
(
context_ptr
);
MS_EXCEPTION_IF_NULL
(
context_ptr
);
...
...
mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.h
浏览文件 @
0c316e52
...
@@ -49,6 +49,7 @@ class AscendKernelRuntime : public KernelRuntime {
...
@@ -49,6 +49,7 @@ class AscendKernelRuntime : public KernelRuntime {
void
ClearGraphRuntimeResource
(
uint32_t
graph_id
,
const
std
::
vector
<
AnfNodePtr
>
&
inputs
,
void
ClearGraphRuntimeResource
(
uint32_t
graph_id
,
const
std
::
vector
<
AnfNodePtr
>
&
inputs
,
const
std
::
unordered_set
<
ValueNodePtr
>
&
value_nodes
,
const
std
::
unordered_set
<
ValueNodePtr
>
&
value_nodes
,
const
std
::
vector
<
CNodePtr
>
&
execution_order
)
override
;
const
std
::
vector
<
CNodePtr
>
&
execution_order
)
override
;
void
ClearGlobalIdleMem
()
override
;
bool
SyncStream
()
override
;
bool
SyncStream
()
override
;
protected:
protected:
...
...
mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.cc
浏览文件 @
0c316e52
...
@@ -77,6 +77,8 @@ void AscendMemoryManager::ResetDynamicMemory() {
...
@@ -77,6 +77,8 @@ void AscendMemoryManager::ResetDynamicMemory() {
AscendMemoryPool
::
GetInstance
().
set_graph_dynamic_mem_offset
(
dynamic_mem_offset_
);
AscendMemoryPool
::
GetInstance
().
set_graph_dynamic_mem_offset
(
dynamic_mem_offset_
);
}
}
void
AscendMemoryManager
::
ClearGlobalIdleMem
()
{
AscendMemoryPool
::
GetInstance
().
ResetIdleMemBuf
();
}
void
*
AscendMemoryManager
::
MallocMemFromMemPool
(
size_t
size
)
{
void
*
AscendMemoryManager
::
MallocMemFromMemPool
(
size_t
size
)
{
auto
align_size
=
GetCommonAlignSize
(
size
);
auto
align_size
=
GetCommonAlignSize
(
size
);
return
AscendMemoryPool
::
GetInstance
().
AllocTensorMem
(
align_size
);
return
AscendMemoryPool
::
GetInstance
().
AllocTensorMem
(
align_size
);
...
...
mindspore/ccsrc/runtime/device/ascend/ascend_memory_manager.h
浏览文件 @
0c316e52
...
@@ -28,6 +28,7 @@ class AscendMemoryManager : public MemoryManager {
...
@@ -28,6 +28,7 @@ class AscendMemoryManager : public MemoryManager {
void
MallocDeviceMemory
()
override
;
void
MallocDeviceMemory
()
override
;
void
FreeDeviceMemory
()
override
;
void
FreeDeviceMemory
()
override
;
void
ResetDynamicMemory
()
override
;
void
ResetDynamicMemory
()
override
;
void
ClearGlobalIdleMem
()
override
;
void
*
MallocMemFromMemPool
(
size_t
size
)
override
;
void
*
MallocMemFromMemPool
(
size_t
size
)
override
;
protected:
protected:
...
...
mindspore/ccsrc/runtime/device/kernel_runtime.h
浏览文件 @
0c316e52
...
@@ -74,6 +74,7 @@ class KernelRuntime {
...
@@ -74,6 +74,7 @@ class KernelRuntime {
const
std
::
unordered_set
<
ValueNodePtr
>
&
value_nodes
,
const
std
::
unordered_set
<
ValueNodePtr
>
&
value_nodes
,
const
std
::
vector
<
CNodePtr
>
&
execution_order
);
const
std
::
vector
<
CNodePtr
>
&
execution_order
);
virtual
bool
SyncStream
()
=
0
;
virtual
bool
SyncStream
()
=
0
;
virtual
void
ClearGlobalIdleMem
()
{}
#ifdef ENABLE_DUMP_E2E
#ifdef ENABLE_DUMP_E2E
DumpConfPtr
GetDumpConf
();
DumpConfPtr
GetDumpConf
();
...
...
mindspore/ccsrc/runtime/device/memory_manager.h
浏览文件 @
0c316e52
...
@@ -39,6 +39,7 @@ class MemoryManager {
...
@@ -39,6 +39,7 @@ class MemoryManager {
total_dynamic_size_
=
0
;
total_dynamic_size_
=
0
;
dynamic_mem_offset_
=
0
;
dynamic_mem_offset_
=
0
;
}
}
virtual
void
ClearGlobalIdleMem
()
{}
void
MallocReusedDynamicMem
(
const
session
::
KernelGraph
*
graph
);
void
MallocReusedDynamicMem
(
const
session
::
KernelGraph
*
graph
);
uint8_t
*
MallocOutputMem
(
const
AnfNodePtr
&
node
,
size_t
index
,
MemType
type
,
size_t
size
,
uint8_t
*
MallocOutputMem
(
const
AnfNodePtr
&
node
,
size_t
index
,
MemType
type
,
size_t
size
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录