Comments (12)
I think you don't need to check whether it is contiguous
.
px.contiguous()
is a no-op if px
is already contiguous, I think.
from fast_rnnt.
If I remember correctly, the cpp code is using tensor accessor to access the data, which does not require a contiguous tensor.
But a contiguous tensor is more cache friendly, so I suggest changing it to
px = px.contiguous()
from fast_rnnt.
So, theoretically commenting these two assertions won't affect the performance... right? And changing the tensors to contiguous
will just help a little bit with memory?
from fast_rnnt.
It says right there, it's for efficiency, so yes, using non-contiguous tensors will affect the performance. Making that copy may not necessarily require more memory, it depends whether the original (before the copy) is required for backprop. I suggest to try adding the .contiguous() statement before the log_softmax, if possible, since likely the log_softmax needs the output of its operation for the backprop (but not the input), so the copy prior to the .contiguous() before the log_softmax likely would not be held for backprop.
from fast_rnnt.
@danpovey I'm sorry I didn't get what you mean by "adding the .contiguous() statement before the log_softmax".
By ".contiguous() statement", you meant px = px.contiguous()
& py = py.contiguous()
.. right?
Also, which log_softmax
are we talking about here exactly? The one at the end of the jointer network?
from fast_rnnt.
At some point in the RNN-T computation there is a normalization of log-probs, probably via log_softmax(). I meant doing it just before then.
But this is probably not super critical as I think this is not going to dominate memory requirements anyway; thanks to using pruned RNN-T, we are not instantiating any really huge tensors. So you can do it to the px and py, I think, if they are not naturally contiguous.
from fast_rnnt.
I have added the following two lines just before this part in the mutual_information.py
script:
if not px.is_contiguous(): px = px.contiguous()
if not py.is_contiguous(): py = py.contiguous()
@danpovey If you agree with what I did, feel free to close this issue!
from fast_rnnt.
Thanks for the help!
from fast_rnnt.
@Anwarvic Where do you add this line, I think there is px.contiguous
in rnnt_loss.py
https://github.com/danpovey/fast_rnnt/blob/c268c3d5a005968b87a724a21082410a3ec0bac3/fast_rnnt/python/fast_rnnt/rnnt_loss.py#L810-L811
from fast_rnnt.
Ok, I think I forgot get_rnnt_logprobs
and get_rnnt_logprobs_smoothed
.
from fast_rnnt.
My issue was in the AssertionError
which only exists in the mutual_information.py script... I think.
from fast_rnnt.
My issue was in the
AssertionError
which only exists in the mutual_information.py script... I think.
Yes, I meaned we won't call mutual_information_recursion
directly, we call it from functions in rnnt_loss.py
. Anyway, fix it in mutual_information.py
is OK. Thanks!
from fast_rnnt.
Related Issues (20)
- An error occurred while compiling the source code HOT 2
- CUDA error HOT 6
- Trying to Understand pruned_loss HOT 7
- #error -- unsupported GUN version ! gcc version later than 5.3 are not supported! HOT 2
- Train loss is nan or inf HOT 29
- Combination of fast_rnnt and fast_emit HOT 12
- missing: CUDNN_LIBRARY_PATH CUDNN_INCLUDE_PATH when installing HOT 3
- RuntimeError: invalid device ordinal HOT 19
- ModuleNotFoundError: No module named '_fast_rnnt' HOT 2
- Issue in installation HOT 7
- [Help wanted] Support BUILD_FOR_ALL_ARCHS
- Why T>=S constraint? HOT 15
- Error while installing HOT 6
- pip error HOT 4
- pip error
- Import fast_rnnt is Failed HOT 11
- [feature request] Enable github actions HOT 1
- T>=S constraint in latest pip version HOT 1
- RuntimeError: Failed to find native CUDA module HOT 10
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 fast_rnnt.