Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
8928013d
Commit
8928013d
authored
Jul 14, 2017
by
Haibin Lin
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add kDynamicStorageID to plan mem (#127)
parent
ec04b943
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
nnvm/src/pass/plan_memory.cc
+4
-1
No files found.
nnvm/src/pass/plan_memory.cc
View file @
8928013d
...
...
@@ -24,6 +24,8 @@ class GraphAllocator {
static
const
StorageID
kBadStorageID
=
-
1
;
// external storage id
static
const
StorageID
kExternalStorageID
=
-
2
;
// dynamic storage id
static
const
StorageID
kDynamicStorageID
=
-
3
;
// request a free storage
StorageID
Request
(
int
dev_id
,
int
dtype
,
TShape
shape
,
uint32_t
node_id
)
{
...
...
@@ -66,7 +68,7 @@ class GraphAllocator {
// release a memory space.
void
Release
(
StorageID
id
,
uint32_t
node_id
)
{
CHECK_NE
(
id
,
kBadStorageID
);
if
(
id
==
kExternalStorageID
)
return
;
if
(
id
==
kExternalStorageID
||
id
==
kDynamicStorageID
)
return
;
StorageEntry
*
e
=
data_
[
id
].
get
();
e
->
released_by_node
=
node_id
;
free_
.
insert
({
e
->
max_bytes
,
e
});
...
...
@@ -209,6 +211,7 @@ size_t AllocMemory(const Graph& ret, const IndexedGraph& idx, StorageVector* sto
std
::
multimap
<
size_t
,
uint32_t
>
eids
;
for
(
uint32_t
index
=
0
;
index
<
inode
.
source
->
num_outputs
();
++
index
)
{
uint32_t
eid
=
idx
.
entry_id
(
nid
,
index
);
// only request memory for kBadStorageID
if
(
storage
[
eid
]
==
GraphAllocator
::
kBadStorageID
)
{
auto
&
eshape
=
shape_vec
[
eid
];
size_t
esize
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment