Cython
Description
This PR converts the functionality of GluonNLP that previously supported optional numba JIT to Cython.
Checklist
Essentials
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [X] All changes have test coverage
- [X] Code is well-documented
Changes
- [X] Replace numba with Cython
Comments
- This removes the runtime dependency on numba to a compile time dependency cython. While numba was formally optional, the execution speed without numba was unusable for the optimized code paths.
- Thanks to Cython
language_level=3str, the.pyxcan be written using Python 3 syntax and features, with Cython taking care of the bindings to Py2
TODO
- [x] Sphinx documentation https://opendreamkit.org/2017/06/09/CythonSphinx/
- [x] Code coverage https://github.com/pytest-dev/pytest-cov/issues/163 https://cython.readthedocs.io/en/latest/src/tutorial/profiling_tutorial.html https://github.com/cython/cython/issues/1461
Job PR-389/10 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-389/10/index.html
Codecov Report
Merging #389 into master will increase coverage by
18.1%. The diff coverage is46.51%.
@@ Coverage Diff @@
## master #389 +/- ##
==========================================
+ Coverage 64.37% 82.48% +18.1%
==========================================
Files 84 85 +1
Lines 7160 7198 +38
==========================================
+ Hits 4609 5937 +1328
+ Misses 2551 1261 -1290
| Flag | Coverage Δ | |
|---|---|---|
| #PR389 | 82.48% <46.51%> (?) |
|
| #master | ? |
|
| #notserial | 56.8% <31.25%> (?) |
|
| #py2 | 82.15% <46.51%> (+18.07%) |
:arrow_up: |
| #py3 | 82.32% <44.18%> (+18.13%) |
:arrow_up: |
| #serial | 63.8% <44.18%> (?) |
Job PR-389/11 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-389/11/index.html
Job PR-389/12 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-389/12/index.html
@szha FYI, after the split in serial / non-serial test execution, only the code coverage of serial tests was uploaded. Fixed by 527b23d
Job PR-389/18 is complete. Docs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/PR-389/18/index.html