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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated mask fill mask type can causes pages and pages of repeated messages #37065

Open
hughperkins opened this issue Apr 22, 2020 · 1 comment
Assignees
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@hughperkins
Copy link
Contributor

馃悰 Bug

When I install DrQA, https://github.com/facebookresearch/DrQA , with pytorch 1.4, the mask being provided is legacy, ie torch.uint8. pytorch correctly points out that this is legacy, and should be migrated to dtype torch.bool. However, rather than printing a single warning, it prints pages and pages of warnings, presumably one for each time the masked fill is called. I feel taht the warning should only be printed once. Example partial output:

/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
/tmp/pip-req-build-o37zi_pa/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.

I have logged the masked fill dtype issue at facebookresearch/DrQA#249 . However, I feel taht DrQA cannot simply upgrade this, because will likely break backwards compatibility with earlier torch versions.

I feel that the correct fix is that deprecation warnings should be printed only once per python process.

To Reproduce

Steps to reproduce the behavior:

  1. install DrQA, https://github.com/facebookresearch/DrQA (which is a facebook repo actually...)
  2. run, using python scripts/pipeline/interactive.py --tokenizer regexp
  3. type process('what is the capital of france?')
  4. watch the spammy deprecation messages...

Expected behavior

Print the deprecation message once, and then stop.

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version (e.g., 1.0): 1.4
  • OS (e.g., Linux): ubuntu 18.04
  • How you installed PyTorch (conda, pip, source): conda
  • Build command you used (if compiling from source): n/a
  • Python version: 3.6
  • CUDA/cuDNN version: 10.2
  • GPU models and configuration: cpu only
  • Any other relevant information:

Additional context

@mruberry
Copy link
Collaborator

Thanks for reporting this issue, @hughperkins! I'll take a look.

@mruberry mruberry added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 22, 2020
@mruberry mruberry self-assigned this Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants