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

[Pytorch] add an option to disable TORCH_WARN and TORCH_WARN_ONCE log #87188

Closed
wants to merge 1 commit into from

Conversation

biubiuX
Copy link
Contributor

@biubiuX biubiuX commented Oct 18, 2022

Summary: Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 18, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: biubiuX / name: zxiong (b51436f)

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 18, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/87188

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit f6ce0cb:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

@kurtamohler
Copy link
Collaborator

Looks good to me, but there's a recent merge conflict

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

biubiuX added a commit to biubiuX/pytorch that referenced this pull request Oct 24, 2022
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: fac3a05ce508d2e276a965c1e4e670d35c477a04
@biubiuX
Copy link
Contributor Author

biubiuX commented Oct 25, 2022

@kurtamohler mind taking another look ? thanks !

@kurtamohler
Copy link
Collaborator

Looks good, thanks!

Just to make sure you're aware, you can filter all warnings at the Python level like this:

import warnings
warnings.filterwarnings('ignore')

But this also filters out all warnings in your project, not just the PyTorch ones, so I can see why this DISABLE_WARN flag is useful.

There is a loose plan to add a warning filter to the C++ side of PyTorch (part of pytorch/rfcs#43). The details aren't decided yet, but we could potentially add a Python binding for it. If/when that exists, you could use that instead of having to build PyTorch yourself

@biubiuX
Copy link
Contributor Author

biubiuX commented Oct 25, 2022

Thanks for the tip. We're the consumer of the model and we don't directly work on the python code. We're working with our partner to fix/adjust warning, but it would be great if we also have log/warning config on c++ side.

@biubiuX
Copy link
Contributor Author

biubiuX commented Oct 27, 2022

not sure if the workflow failure is caused by my change, is there anything I can do here ?

@kurtamohler
Copy link
Collaborator

Yeah these failures don't seem to be related. Try rebasing just to make sure

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

biubiuX added a commit to biubiuX/pytorch that referenced this pull request Oct 28, 2022
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: 0cb87acb1f3cc9a601a61c3aeb1c6a401454c975
@biubiuX
Copy link
Contributor Author

biubiuX commented Oct 31, 2022

Could anyone help me run the workflows ?

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

biubiuX added a commit to biubiuX/pytorch that referenced this pull request Nov 1, 2022
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: 19ac897834f6205475ee3d2b496c07f3f8a6271f
@kurtamohler
Copy link
Collaborator

kurtamohler commented Nov 2, 2022

The two failing jobs actually do seem to be caused by your changes. I think I may have steered you wrong earlier--I had only seen the Device or resource busy error in the logs and assumed it wasn't related. But there's another error that happens earlier in the logs:

C:\actions-runner\_work\pytorch\pytorch\c10/core/TensorImpl.h(1758): error C2275: 'c10::UserWarning': illegal use of this type as an expression
C:\actions-runner\_work\pytorch\pytorch\c10/core/TensorImpl.h(1758): note: see declaration of 'c10::UserWarning'
C:\actions-runner\_work\pytorch\pytorch\c10/core/TensorImpl.h(1758): error C2064: term does not evaluate to a function taking 0 arguments

I guess the macros are maybe acting slightly differently on windows builds? Not sure

biubiuX added a commit to biubiuX/pytorch that referenced this pull request Nov 3, 2022
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: bd0a61a90a9f3160486f8dc84fda4a455a097e4f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

biubiuX added a commit to biubiuX/pytorch that referenced this pull request Nov 3, 2022
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: bd7a5b377912da4bc03e378ce8360219ba8f3d68
…pytorch#87188)

Summary:
Pull Request resolved: pytorch#87188

Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

fbshipit-source-id: 74e0997f7271336543bad2691e327006d6cda7f9
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40321550

@biubiuX
Copy link
Contributor Author

biubiuX commented Nov 5, 2022

@kurtamohler mind taking another look(also trigger the workflow) ? It indeed seems to be a subtle preprocessor bug in MVSC(gcc, clang works ok).

@biubiuX
Copy link
Contributor Author

biubiuX commented Nov 7, 2022

gentle ping @kurtamohler ; )

@kurtamohler
Copy link
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 7, 2022
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Approval needed from one of the following (Rule 'superuser'):
qxy11, chauhang, chenyang78, shunting314, soulitzer, ...

Details for Dev Infra team Raised by workflow job

@kurtamohler
Copy link
Collaborator

Oh right, forgot we need @ezyang's approval before merging

@biubiuX
Copy link
Contributor Author

biubiuX commented Nov 8, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@biubiuX biubiuX deleted the export-D40321550 branch November 8, 2022 04:59
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
…pytorch#87188)

Summary: Add an option to disable TORCH_WARN, some op could trigger spammy TOCH_WARN log which is not desired under certain scenario.

Test Plan:
Tested with
-pt.disable_warn = 1 and -pt.disable_warn = 0

verified TORCH_WARN and TORCH_WARN_ONCE are properly handled

tested with
-pt.strip_error_messages = 1, -pt.disable_warn = 0

verified strip error message is respected when warn is printed

Differential Revision: D40321550

Pull Request resolved: pytorch#87188
Approved by: https://github.com/kurtamohler, https://github.com/ezyang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants