dmlc / gluon-nlp

NLP made easy
https://nlp.gluon.ai/
Apache License 2.0
2.55k stars 538 forks source link

[Performance][WIP] Use boolean mask #1403

Closed sxjscience closed 3 years ago

sxjscience commented 3 years ago

Description

Switch to use boolean mask, which helps reduce the memory consumption of the models.

Checklist

Essentials

cc @dmlc/gluon-nlp-team

github-actions[bot] commented 3 years ago

The documentation website for preview: http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR1403/boolean_mask/index.html

codecov[bot] commented 3 years ago

Codecov Report

Merging #1403 into master will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1403      +/-   ##
==========================================
+ Coverage   82.17%   82.26%   +0.08%     
==========================================
  Files          53       53              
  Lines        6946     6946              
==========================================
+ Hits         5708     5714       +6     
+ Misses       1238     1232       -6     
Impacted Files Coverage Δ
src/gluonnlp/attention_cell.py 79.92% <100.00%> (ø)
src/gluonnlp/data/loading.py 83.39% <0.00%> (+2.26%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8c8b0c9...588b974. Read the comment docs.

github-actions[bot] commented 3 years ago

The documentation website for preview: http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR1403/boolean_mask/index.html

github-actions[bot] commented 3 years ago

The documentation website for preview: http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR1403/boolean_mask/index.html

github-actions[bot] commented 3 years ago

The documentation website for preview: http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR1403/boolean_mask/index.html