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
Use JIT Plug-in for coverage to cover JIT'd functions and methods #56310
Conversation
|
d59bd2c
to
5164858
Codecov Report
@@ Coverage Diff @@
## master #56310 +/- ##
==========================================
- Coverage 77.77% 77.77% -0.01%
==========================================
Files 1924 1924
Lines 190977 190977
==========================================
- Hits 148534 148528 -6
- Misses 42443 42449 +6 |
bf20e9f
to
deb8702
Summary: This PR is step 1 to covering JIT'd methods and functions. Step 2 (using it in CI) is here: #56310. 1. This PR introduces a package `coverage_plugins` that hosts JITPlugin. 2. We also bring in a `.coveragerc` file that is used in CI to omit the files we don't want to report on (e.g., temporary directories or test or utils.) **Disclaimer: This PR does NOT use the plug-in. Nothing should change as a result.** Pull Request resolved: #56708 Test Plan: CI. Coverage should not go down. If you're interested in testing this plug-in locally, you should: `pip install -e tools/coverage_plugins_package` from the root directory. Add the following lines to `.coveragerc` under `[run]` ``` plugins = coverage_plugins.jit_plugin ``` And then try: `coverage run test/test_jit.py TestAsync.test_async_script_no_script_mod` You should see `.coverage.jit` show up at the end. You can then run `coverage combine --append` and `coverage debug data` to see that some files in `torch/jit` are covered. Reviewed By: samestep Differential Revision: D27945570 Pulled By: janeyx99 fbshipit-source-id: 78732940fcb498d5ec37d4075c4e7e08e96a8d55
The conflicts are with myself--I will rebase, but wanted to see if CI passed first |
it should improve in general in torch/jit/* right? not just quantized.py |
Yes actually I'm not even seeing the changes at all...hmmmm let me debug this before making you review haha. I have discovered why! it's cuz we use coverage-4 instead of 5, and COVERAGE_RCFILE is coverage 5 only. |
@@ -102,6 +102,7 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then | |||
# TODO: Why is scipy pinned | |||
# Pin MyPy version because new errors are likely to appear with each release | |||
# Pin hypothesis to avoid flakiness: https://github.com/pytorch/pytorch/issues/31136 | |||
# Pin coverage so we can use COVERAGE_RCFILE |
Does this mean that we expect COVERAGE_RCFILE
to be removed in future versions of coverage
? Or is the purpose of this just to modify the script in some way so that the Docker image gets rebuilt?
Ah, no, this was because our previously installed version of coverage did not have the COVERAGE_RCFILE option, so this explains why we pinned it in the first place
@janeyx99 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
This pull request has been reverted by 3fbc154. |
@janeyx99 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…torch#56310) Summary: This PR is step 2 (after pytorch#56708) to having JIT coverage--it actually uses the plug-in in CI! Disclaimer: note that this will mark the entire JIT'd function/method as covered without seeking proof that the compiled code has been executed. This means that even if the code chunk is merely compiled and not run, it will get marked as covered. Pull Request resolved: pytorch#56310 Test Plan: We should see coverage improvements in CI after. A file to look out for would be `torch/jit/quantized.py`, which should have more coverage after this PR, which it does! https://codecov.io/gh/pytorch/pytorch/src/d3283ccd8c898e7a1c5b46179a0b9147c87c53b9/torch/jit/quantized.py vs https://codecov.io/gh/pytorch/pytorch/src/master/torch/jit/quantized.py More generally, the whole jit folder got ~3% increase in coverage, I believe. Reviewed By: walterddr Differential Revision: D28000672 Pulled By: janeyx99 fbshipit-source-id: 6712979d63a5e1224a92ee9bd9679ec62cf1cbba
Summary: This PR is step 1 to covering JIT'd methods and functions. Step 2 (using it in CI) is here: pytorch#56310. 1. This PR introduces a package `coverage_plugins` that hosts JITPlugin. 2. We also bring in a `.coveragerc` file that is used in CI to omit the files we don't want to report on (e.g., temporary directories or test or utils.) **Disclaimer: This PR does NOT use the plug-in. Nothing should change as a result.** Pull Request resolved: pytorch#56708 Test Plan: CI. Coverage should not go down. If you're interested in testing this plug-in locally, you should: `pip install -e tools/coverage_plugins_package` from the root directory. Add the following lines to `.coveragerc` under `[run]` ``` plugins = coverage_plugins.jit_plugin ``` And then try: `coverage run test/test_jit.py TestAsync.test_async_script_no_script_mod` You should see `.coverage.jit` show up at the end. You can then run `coverage combine --append` and `coverage debug data` to see that some files in `torch/jit` are covered. Reviewed By: samestep Differential Revision: D27945570 Pulled By: janeyx99 fbshipit-source-id: 78732940fcb498d5ec37d4075c4e7e08e96a8d55
…torch#56310) Summary: This PR is step 2 (after pytorch#56708) to having JIT coverage--it actually uses the plug-in in CI! Disclaimer: note that this will mark the entire JIT'd function/method as covered without seeking proof that the compiled code has been executed. This means that even if the code chunk is merely compiled and not run, it will get marked as covered. Pull Request resolved: pytorch#56310 Test Plan: We should see coverage improvements in CI after. A file to look out for would be `torch/jit/quantized.py`, which should have more coverage after this PR, which it does! https://codecov.io/gh/pytorch/pytorch/src/d3283ccd8c898e7a1c5b46179a0b9147c87c53b9/torch/jit/quantized.py vs https://codecov.io/gh/pytorch/pytorch/src/master/torch/jit/quantized.py More generally, the whole jit folder got ~3% increase in coverage, I believe. Reviewed By: ezyang Differential Revision: D27967517 Pulled By: janeyx99 fbshipit-source-id: 53fd8431d772c2447191135c29d1b166ecd42f50
…torch#56310) Summary: This PR is step 2 (after pytorch#56708) to having JIT coverage--it actually uses the plug-in in CI! Disclaimer: note that this will mark the entire JIT'd function/method as covered without seeking proof that the compiled code has been executed. This means that even if the code chunk is merely compiled and not run, it will get marked as covered. Pull Request resolved: pytorch#56310 Test Plan: We should see coverage improvements in CI after. A file to look out for would be `torch/jit/quantized.py`, which should have more coverage after this PR, which it does! https://codecov.io/gh/pytorch/pytorch/src/d3283ccd8c898e7a1c5b46179a0b9147c87c53b9/torch/jit/quantized.py vs https://codecov.io/gh/pytorch/pytorch/src/master/torch/jit/quantized.py More generally, the whole jit folder got ~3% increase in coverage, I believe. Reviewed By: walterddr Differential Revision: D28000672 Pulled By: janeyx99 fbshipit-source-id: 6712979d63a5e1224a92ee9bd9679ec62cf1cbba
This PR is step 2 (after #56708) to having JIT coverage--it actually uses the plug-in in CI!
Disclaimer: note that this will mark the entire JIT'd function/method as covered without seeking proof that the
compiled code has been executed. This means that even if the code chunk is merely compiled and not run, it will get
marked as covered.
Test plan:
We should see coverage improvements in CI after. A file to look out for would be
torch/jit/quantized.py
, which should have more coverage after this PR, which it does!https://codecov.io/gh/pytorch/pytorch/src/d3283ccd8c898e7a1c5b46179a0b9147c87c53b9/torch/jit/quantized.py vs https://codecov.io/gh/pytorch/pytorch/src/master/torch/jit/quantized.py
More generally, the whole jit folder got ~3% increase in coverage, I believe.
The text was updated successfully, but these errors were encountered: