Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse data memory if not propagate down #86

Merged
merged 5 commits into from
Jul 20, 2016
Merged

Conversation

Cysu
Copy link
Collaborator

@Cysu Cysu commented Jun 22, 2016

Make a dry-run of forward pass. If some layer does not propagate down (or during test phase), reuse its top blob's data memory.

Change the keys from blob address to blob_name + "_data" (or "_diff") in the slot array.

Add to NetParameter an option optimize_mem that controls the memory optimization strategy. It has three enum values:

  • NO_OPTIM: no memory optimization
  • TRAIN_ONLY: only optimize forward and backward blobs memory during training phase
  • ALL_OPTIM: optimize for both the training and test phase

It is set to TRAIN_ONLY by default. Note that using the memory optimization may corrupt internal blobs data/diff. So you may wish to use NO_OPTIM for feature extraction.

@yjxiong
Copy link
Owner

yjxiong commented Jul 12, 2016

Looks good to me! Please proceed.

@yjxiong yjxiong merged commit 823a7c7 into yjxiong:mem Jul 20, 2016
@yjxiong
Copy link
Owner

yjxiong commented Jul 20, 2016

Thanks a lot!

@Cysu Cysu deleted the reduce-mem-no-bp branch July 27, 2016 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants