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

Reduce the memory footprint of the training script and few other bug fixes #231

Merged
merged 9 commits into from Dec 25, 2019

Conversation

@Abhijit-2592
Copy link
Contributor

Abhijit-2592 commented Dec 24, 2019

Fixes #193
This Pull request addresses the following 3 problems:

  1. Issue #193 highlights that the training script hogs a huge amount of RAM memory. Looking into the code base, this is mainly attributed to: Loading the entire .npy files to memory. Thus I have provided an option to load them lazily so that RAM usage does not blow up. This option can be turned on by passing a --lazy flag to learn.py. Before this I was unable to train on the dataset (approx 8.5GB size in disk) generated using spacy's en_core_web_lg model on my laptop (16GB RAM and 6GB GPU). The dataset required more than 50GB of RAM to train. After this change the memory foot print is ~ 5GB for the same dataset and runs on my laptop without hiccups.
  2. While creating the dataset it would be beneficial if user could pass the required spacy model.
  3. The pull request #230 attempts to fix training on GPU but introduces a new bug which throws an error while training on CPU. This is fixed here. Now the training can be done both on GPU and CPU as required.
Copy link
Collaborator

svlandeg left a comment

Looks great !

neuralcoref/train/conllparser.py Outdated Show resolved Hide resolved
neuralcoref/train/conllparser.py Outdated Show resolved Hide resolved
neuralcoref/train/dataset.py Show resolved Hide resolved
neuralcoref/train/learn.py Outdated Show resolved Hide resolved
@Abhijit-2592

This comment has been minimized.

Copy link
Contributor Author

Abhijit-2592 commented Dec 25, 2019

@svlandeg done

@svlandeg svlandeg merged commit 84f29f4 into huggingface:master Dec 25, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hiberly 1 piece of feedback given. You can add more by clicking ->
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.