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

Suppress Apex deprecation message #15071

Closed
wants to merge 10 commits into from
Closed

Suppress Apex deprecation message #15071

wants to merge 10 commits into from

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Oct 11, 2022

What does this PR do?

Fixes #15070

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

I made sure I had fun coding 🙃

cc @Borda @tchaton @rohitgr7 @carmocca @justusschock @awaelchli @akihironitta

@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Oct 11, 2022
@awaelchli awaelchli added priority: 0 High priority task precision: apex (removed) NVIDIA/apex precision labels Oct 11, 2022
@awaelchli awaelchli added this to the pl:1.8 milestone Oct 11, 2022
@awaelchli awaelchli self-assigned this Oct 11, 2022
@awaelchli
Copy link
Contributor Author

The previous warning filter did not work, I need to experiment.
Suggestions welcome

@otaj
Copy link
Contributor

otaj commented Oct 11, 2022

@awaelchli the issue is here https://github.com/Lightning-AI/lightning/blob/6f16e46bdb397bf1898e4d7d9050492924177abd/setup.cfg#L36 , since DeprecatedFeatureWarning is a subclass of FutureWarning (https://github.com/NVIDIA/apex/blob/48bf0df5f7925f71bdeac66c6995ab5c6f2617e3/apex/__init__.py#L58)

The warning is silenced when not run in pytest, but pytest filter takes precedence. I think we can decide to filter this particular inside every test that uses it.

@awaelchli
Copy link
Contributor Author

@otaj Thank you! So the filter works on the user side, that's what we want. Great!
Will try to suppress it in the test then.

@awaelchli awaelchli marked this pull request as ready for review October 11, 2022 10:44
@mergify mergify bot added the ready PRs ready to be merged label Oct 11, 2022
from apex import amp

# TODO: Remove with deprecation of Apex integration #14416
if hasattr(apex, "DeprecatedFeatureWarning"):
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't silence the warning at the source level. We want to appear to users IMO

We can only silence it during pytest time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would of course add our own deprecation in #14416. But we don't want two deprecation messages at the same time. Also, the apex message does not tell Lightning users that they can switch to precision=16 or precision=bf16

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, but we haven't added our deprecation yet. So I would only replace it once we have ours

@awaelchli awaelchli closed this Oct 11, 2022
@awaelchli awaelchli deleted the ci/apex-deprecation branch October 11, 2022 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pl Generic label for PyTorch Lightning package precision: apex (removed) NVIDIA/apex precision priority: 0 High priority task ready PRs ready to be merged
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Suppress Apex AMP deprecation message until Lightning removes its implementation
5 participants