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

[REVIEW] Adding Cython to Code Coverage #3111

Merged
merged 5 commits into from
Nov 6, 2020

Conversation

mdemoret-nv
Copy link
Contributor

Closes #3110

Quick update to add cython to the code coverage.

Since adding --linetrace=1 to the build has a performance impact, the ./build.sh scripts have been updated to only perform this during GPU CI. I used an environment variable to support adding any argument to the python build via BUILD_PYTHON_ARGS.

@mdemoret-nv mdemoret-nv requested review from a team as code owners November 3, 2020 00:08
@GPUtester
Copy link
Contributor

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@codecov-io
Copy link

codecov-io commented Nov 3, 2020

Codecov Report

Merging #3111 into branch-0.17 will increase coverage by 10.18%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-0.17    #3111       +/-   ##
================================================
+ Coverage        59.20%   69.38%   +10.18%     
================================================
  Files              142      193       +51     
  Lines             8966    14704     +5738     
================================================
+ Hits              5308    10203     +4895     
- Misses            3658     4501      +843     
Impacted Files Coverage Δ
python/cuml/metrics/regression.pyx 95.40% <0.00%> (ø)
python/cuml/linear_model/mbsgd_regressor.pyx 94.73% <0.00%> (ø)
python/cuml/metrics/cluster/homogeneity_score.pyx 100.00% <0.00%> (ø)
python/cuml/internals/internals.pyx 100.00% <0.00%> (ø)
python/cuml/ensemble/randomforestclassifier.pyx 72.72% <0.00%> (ø)
python/cuml/metrics/cluster/mutual_info_score.pyx 100.00% <0.00%> (ø)
python/cuml/metrics/accuracy.pyx 100.00% <0.00%> (ø)
python/cuml/common/pointer_utils.pyx 50.00% <0.00%> (ø)
python/cuml/tsa/seasonality.pyx 32.14% <0.00%> (ø)
python/cuml/neighbors/kneighbors_classifier.pyx 96.26% <0.00%> (ø)
... and 41 more

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 1f563ee...d95d80e. Read the comment docs.

Copy link
Contributor

@JohnZed JohnZed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. Seems safe for the non-CI case too. The codecov.io displays don't show lines, though - I just see file-level summaries.

@@ -58,7 +58,7 @@ BUILD_TYPE=Release
INSTALL_TARGET=install
BUILD_ALL_GPU_ARCH=0
SINGLEGPU_CPP_FLAG=""
SINGLEGPU_PYTHON_FLAG=""
BUILD_PYTHON_ARGS=${BUILD_PYTHON_ARGS:=""}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be a command-line flag instead, like "--python-args"? Seems like that would be more consistent with the other inputs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try and convert it to a command line argument, but it will be a little riskier since it will be a little different than all of our current command line args. This would be the only one that accepts an argument value. All of the current options (-g, -n, --singlegpu, etc.) are boolean flags which is much easier to parse. I'm just a little concerned that we may miss some edge cases when parsing arbitrary arguments since this runs on several platforms.

I'll give it a shot and see if there are any other build.sh scripts in rapids that take arbitrary values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up sticking with boolean flags and added a new --codecov option to build.sh. This doesn't add any risk from parsing argument values and is generic enough to possibly include C++ code coverage one day (if we can figure out how to do it).

I'm open to different argument name. Let me know if you have a better selection. Link to the help section: https://github.com/rapidsai/cuml/pull/3111/files#diff-4d2a8eefdf2a9783512a35da4dc7676a66404b6f3826a8af9aad038722da6823R46-R47

python/cython_build_ext.py Show resolved Hide resolved
python/cython_build_ext.py Show resolved Hide resolved
@mdemoret-nv mdemoret-nv changed the title [WIP] Adding Cython to Code Coverage [REVIEW] Adding Cython to Code Coverage Nov 5, 2020
@mdemoret-nv mdemoret-nv added 4 - Waiting on Reviewer Waiting for reviewer to review or respond Build or Dep Issues related to building the code or dependencies Cython / Python Cython or Python issue tests Unit testing for project labels Nov 5, 2020
@mdemoret-nv
Copy link
Contributor Author

Looks great to me. Seems safe for the non-CI case too. The codecov.io displays don't show lines, though - I just see file-level summaries.

FYI, I think it doesnt show up in codecov.io since some of the cython names get mangled. I would look into it but I cant get codecov.io to even load this PR for me.

@JohnZed
Copy link
Contributor

JohnZed commented Nov 6, 2020

Looks great to me. Seems safe for the non-CI case too. The codecov.io displays don't show lines, though - I just see file-level summaries.

FYI, I think it doesnt show up in codecov.io since some of the cython names get mangled. I would look into it but I cant get codecov.io to even load this PR for me.

Ok it's showing up in codecov for me.. no line level info but that seems to be because there is no baseline from which to diff?

Copy link
Contributor

@JohnZed JohnZed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the --codecov option... matches the existing approach well.

@JohnZed JohnZed merged commit 25b29f5 into rapidsai:branch-0.17 Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - Waiting on Reviewer Waiting for reviewer to review or respond Build or Dep Issues related to building the code or dependencies Cython / Python Cython or Python issue tests Unit testing for project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Add cython to code coverage
5 participants