Comments (2)
gradInput
tensors can always be shared unless they are exposed outside the network but the code handles that for you.
output
tensors can be shared if they are not used in the backward pass. You should take a look at the implementation of every new modules you introduce in the code and apply this rule:
- If the content of
input
is used inupdateGradInput
oraccGradParameters
, add the module in theprotectInput
table. - If the content of
self.output
is used inupdateGradInput
oraccGradParameters
, add the module in theprotectOutput
table.
For example, see the modules that are already blacklisted in MemoryOptimizer.lua
and how they use their input or output in the backward pass.
It forces you to know in details the modules you use but the optimization is efficient. To validate your approach, you should get the same perplexity with and without memory optimization.
from opennmt.
@guillaumekln Thank you so much!
from opennmt.
Related Issues (20)
- Decoder.lua:446: 'for' limit must be a number HOT 1
- Error when translating with Language Model: "attempt to call method 'forwardOne' (a nil value)" HOT 2
- Meet with lua:446:'for' limit must be a number HOT 2
- Difference between using epoch and train_steps HOT 3
- Difference bteween gnmt and brnn encoder HOT 2
- WriteObject problem, bad argument #1 to 'ipairs' HOT 1
- IDEA: Process FOSS projects .po files for translation corpora
- The engine caches the data in the translation HOT 6
- How to speed up when preprocess the corpus ? HOT 1
- Embeddings: invalid line count HOT 3
- Test BLEU Score HOT 1
- share_embedding option HOT 2
- Better pre-trained PyTorch models
- Maximum length of string processed by the engine HOT 2
- unicode issue for translating Bangla to English HOT 2
- Error BPE tokenizer: tokenize.lua:87: attempt to concatenate upvalue 'line' HOT 3
- Is early stopping available in OpenNMT-py or OpenNMT-tf? HOT 1
- Is `early-stopping` available feature in OpenNMT-tf or OpenNMT-py?
- NMT, What if we do not pass input for decoder? HOT 1
- ModuleNotFoundError: No module named 'onmt.inputters' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opennmt.