-
Notifications
You must be signed in to change notification settings - Fork 38
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
Training step is too slow #25
Comments
Hi @guoyang9, thanks for trying out! I agree, it should accelerate training, it is only a matter of design choice — I prioritized memory consumption while developing the code. The On the other hand, padding all the sequences with zeros would grow the memory requirements roughly in the order of the number of examples. This was also one of the motivations to do pre-processing on the fly, instead of reading tokens from H5 files (others being flexible switching of vocabulary and such). However, this is purely my intuition and I haven't tried moving things to |
Interestingly, after I moved the |
Two suggestions to speed up the code and to avoid memory leak on other GPU:
Please let me know if you want me to raise a PR. Thanks. |
@shubhamagarwal92 Thanks for the suggestions! Both make sense to me. If you could send in a pull request, that'd be great, thanks! |
Hi,
Thank you for your code.
As I go deeply into this code, I found the training step is particular slow. The problem here (I guess) is the dataset construction processing, where too much functions (e.g., padding sequences, getting history) are implemented in the
__get_item__
.I wonder, have you tried to wrap these functions in the
__init__
function? This might lead to more memory consuming but will absolutely accelerate the training process.Thanks.
The text was updated successfully, but these errors were encountered: