mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/43883 Check the result of GCC coverage in OSS is reasonable and ready to ship. The amount of executable lines are not the same between `gcc` and `clang` because of the following reasons: * Lines following are counted in `clang` but not in `gcc`: 1. empty line or line with only “{” or “}” 3. some comments are counted in clang but not in gcc 5. `#define ...` -- not supported by gcc according to official documentation * Besides, a statement that explains to more than one line will be counted as only one executable line in gcc, but several lines in clang ## Advantage of `gcc` coverage 1. Much faster - code coverage tool runtime is onle **4 min** (*ammazzzing!!*) by `gcc`, compared to **3 hours!!** by `clang`, to analyze all the tests' artifacts 2. Use less disk - `Clang`'s artifacts will take as large as 170G, but `GCC` is 980M Besides, also update `README.md`. Test Plan: Compare the result in OSS `clang` and OSS `gcc` with the same command: ``` python oss_coverage.py --run-only atest test_nn.py --interested-folder=aten ``` ---- ## GCC **Summary** > time: 0:15:45 summary percentage: 44.85% **Report and Log** [File Coverage Report](P140825162) [Line Coverage Report](P140825196) [Log](P140825385) ------ ## CLANG **Summary** > time: 0:21:35 summary percentage: 44.08% **Report and Log** [File Coverage Report](P140825845) [Line Coverage Report](P140825923) [Log](P140825950) ---------- # Run all tests ``` # run all tests and get coverage over Pytorch python oss_coverage.py ``` **Summary** > time: 1:27:20. ( time to run tests: 1:23:33) summary percentage: 56.62% **Report and Log** [File Coverage Report](P140837175) [Log](P140837121) Reviewed By: malfet Differential Revision: D23416772 fbshipit-source-id: a6810fa4d8199690f10bd0a4f58a42ab2a22182b |
||
|---|---|---|
| .. | ||
| oss | ||
| tool | ||
| util | ||
| __init__.py | ||