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

[Improvement] Improve digit_version & use it for version_checking #1185

Merged
merged 17 commits into from
Jul 23, 2021

Conversation

kennymckormick
Copy link
Member

No description provided.

@zhouzaida zhouzaida requested a review from ZwwWayne July 9, 2021 06:46
@zhouzaida zhouzaida mentioned this pull request Jul 9, 2021
20 tasks
@zhouzaida zhouzaida requested a review from innerlee July 9, 2021 07:03
@zhouzaida zhouzaida mentioned this pull request Jul 10, 2021
12 tasks
@ZwwWayne
Copy link
Collaborator

need to resolve comments and fix CI

@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #1185 (cfa417a) into master (6659c38) will increase coverage by 0.28%.
The diff coverage is 66.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1185      +/-   ##
==========================================
+ Coverage   68.00%   68.28%   +0.28%     
==========================================
  Files         160      160              
  Lines       10442    10519      +77     
  Branches     1902     1918      +16     
==========================================
+ Hits         7101     7183      +82     
+ Misses       2968     2958      -10     
- Partials      373      378       +5     
Flag Coverage Δ
unittests 68.28% <66.12%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcv/ops/saconv.py 83.33% <20.00%> (-0.25%) ⬇️
mmcv/parallel/distributed.py 20.83% <20.00%> (-1.62%) ⬇️
mmcv/runner/fp16_utils.py 58.12% <33.33%> (-0.27%) ⬇️
mmcv/parallel/distributed_deprecated.py 66.66% <50.00%> (-0.73%) ⬇️
mmcv/runner/dist_utils.py 50.00% <50.00%> (-0.50%) ⬇️
mmcv/runner/hooks/logger/tensorboard.py 34.37% <50.00%> (-1.99%) ⬇️
mmcv/utils/parrots_wrapper.py 59.37% <50.00%> (ø)
mmcv/utils/trace.py 54.54% <50.00%> (ø)
mmcv/version.py 82.35% <78.57%> (-9.96%) ⬇️
mmcv/utils/version_utils.py 68.08% <86.95%> (+6.32%) ⬆️
... and 9 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 6659c38...cfa417a. Read the comment docs.

@kennymckormick
Copy link
Member Author

@ZwwWayne CI passed.

setup.py Outdated Show resolved Hide resolved
@zhouzaida
Copy link
Collaborator

if LooseVersion(torch.__version__) >= LooseVersion('1.6.0'):

This line should also be replaced with digit_version

@kennymckormick
Copy link
Member Author

if LooseVersion(torch.__version__) >= LooseVersion('1.6.0'):

This line should also be replaced with digit_version

resolved

Copy link
Collaborator

@zhouzaida zhouzaida left a comment

Choose a reason for hiding this comment

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

LGTM

@kennymckormick
Copy link
Member Author

@zhouzaida

@kennymckormick
Copy link
Member Author

@ZwwWayne

@ZwwWayne ZwwWayne requested a review from innerlee July 20, 2021 08:47
@innerlee
Copy link
Contributor

@kennymckormick
Copy link
Member Author

kennymckormick commented Jul 21, 2021

My sole interest is the test cases. They should be as complete as possible. Here are some idea sources:

https://github.com/JuliaInterop/VersionParsing.jl/blob/master/test/runtests.jl
https://github.com/eieste/VersionParser/blob/master/version_parser/test.py
https://github.com/pypa/packaging/blob/main/tests/test_version.py

Since we use the parse_version API from pkg_resources, the capability of digit_version is not unlimited. For example, it can not parse sth. like 'vM1m2b3' and will treat '0.99.1+1' like '0.99.1'. However, I think can parse versions of most python packages correctly (it is mainly used to parse the version of pytorch or MM codebases). The test cases added define the boundary of its capability.

@zhiqi-li
Copy link

zhiqi-li commented Apr 16, 2023

image

Can mmcv and mmegine improve the ability of digit_version function to handle custom compiled torch version?

@kennymckormick
Copy link
Member Author

image

Can mmcv and mmegine improve the ability of digit_version function to handle custom compiled torch version?

That might be difficult because you need the entire commit history to make it possible. Besides, there is no guarantee that all commits are in linear (actually they can be parallel, it's not possible to determine the ranking in that case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants