Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

[GraphExecutor] Shared Memory bind and runtime reshaping#1408

Merged
piiswrong merged 3 commits intoapache:masterfrom
piiswrong:master
Feb 5, 2016
Merged

[GraphExecutor] Shared Memory bind and runtime reshaping#1408
piiswrong merged 3 commits intoapache:masterfrom
piiswrong:master

Conversation

@piiswrong
Copy link
Contributor

No description provided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullptr

This was referenced Feb 3, 2016
@tqchen
Copy link
Member

tqchen commented Feb 3, 2016

Please add a few test cases on this, also suggest the following improvments.

  • Make executor take a shared_ptr of the StorageAllocator (this helps cleanup the code reference issue).
  • Being able to call release and re-aquire space during runtime, so an executor can optionally release its requested memory, and re-aquire it during imperative execution (optional, can do it later).

@piiswrong
Copy link
Contributor Author

I thought about sharing StorageAllocator at the start, but that actually doesn't work. Suppose ExecA has 2 chunks of memory, Rebind ExecB reuse 1 chunk and allocate 1 new chunk. Then ExecA destructs. Now The un-reused 1 chunk of memory stays there until all derived executors are deleted.

@tqchen
Copy link
Member

tqchen commented Feb 3, 2016

Understand this case, however, I guess the point of shared memory execs is that all the shared execs destructs together. We can discuss a bit on this offline

@piiswrong
Copy link
Contributor Author

Not really. Usually you have one base exec. Then for each batch you derive a new exec with different size. After this batch the new exec destructs. Then if it allocated any new memory they will stay there unused before base destructs.

@piiswrong
Copy link
Contributor Author

@tqchen Done. Lets do a final pass and merge this.

if (e->ctx != ctx) continue;
if (e->type_flag != type_flag) continue;
if (node_color_[e->released_by_node] != node_color_[node_id]) continue;
if (node_color_[e->released_by_node] != num_match_color_ + 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make dummy color a constant, so it is easier to expect what is going on

piiswrong added a commit that referenced this pull request Feb 5, 2016
[GraphExecutor] Shared Memory bind and runtime reshaping
@piiswrong piiswrong merged commit c2905fd into apache:master Feb 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants