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

TorchText tests failed when multiprocessing #397

Open
2 of 3 tasks
ejguan opened this issue May 11, 2022 · 10 comments
Open
2 of 3 tasks

TorchText tests failed when multiprocessing #397

ejguan opened this issue May 11, 2022 · 10 comments
Assignees

Comments

@ejguan
Copy link
Contributor

ejguan commented May 11, 2022

🐛 Describe the bug

I think the test from TorchText starts failing after pytorch/pytorch#74984 is landed into core and shipped into nightly.

Should we either revert the change or fix this problem ASAP considering the closing branch cut for TorchText?
We can let TorchText team to remove all lambda function in their dataset if needed.

Versions

main

Progress

@ejguan
Copy link
Contributor Author

ejguan commented May 11, 2022

See the domain tests in my PR https://github.com/pytorch/data/pull/394/checks

@VitalyFedyunin
Copy link
Contributor

Thank you for reporting, lets fix it forward in DataLoader1 and DataLoader2

@NivekT
Copy link
Contributor

NivekT commented May 11, 2022

If users upgrade torch but not torchtext, this will break in the next release. To address that, it seems like we definitely need to make changes to both versions DataLoader to switch to use dill for serialization.

I can also submit a PR to torchtext and switch its lambda usages to non-lambda function instead, since we cannot expect all users to have dill installed. Do you think that will be appropriate as well?

@VitalyFedyunin
Copy link
Contributor

@NivekT totally makes sense to update torchtext. As parallel topic: Should we consider dill as hard dependency for torchdata?

@NicolasHug
Copy link
Member

NicolasHug commented May 11, 2022

If that helps, we have opened pytorch/vision#5938 so that you can check whether recent changes break the torchvision datapipes when dill is installed.

Re torchtext's useof lambdas: I mentioned to @parmeet yesterday that the use of lambdas will break users' code when doing multi-processing on Windows, so I believe they are planning on fixing this (would need Parmeet's confirmation though).

Regarding making dill a hard-dependency: doesn't dill silently replace pickle automatically?

@ejguan
Copy link
Contributor Author

ejguan commented May 11, 2022

Regarding making dill a hard-dependency: doesn't dill silently replace pickle automatically?

Yeah but technically, we can revert the change by doing dill.extend(use_dill=False). https://github.com/pytorch/pytorch/blob/50efa3a6e8ff8a29f7a0cb08cf3e3e5ed42f38fe/torch/utils/data/_utils/serialization.py#L5-L15

@NicolasHug
Copy link
Member

Do I understand correctly that this revert will only affect torchdata code? I.e. installing dill will still silently replace pickle in the rest of the users environement?

@ejguan
Copy link
Contributor Author

ejguan commented May 11, 2022

Install won't affect. It only affects the pickle when import dill. So, I think always reverting the change every time thattorchdata finishes using dill should remove impact for other part of code.

VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 11, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

[ghstack-poisoned]
VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 12, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

[ghstack-poisoned]
VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 12, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

[ghstack-poisoned]
VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 12, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

Differential Revision: [D36347737](https://our.internmc.facebook.com/intern/diff/D36347737)

[ghstack-poisoned]
VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 12, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

Differential Revision: [D36347737](https://our.internmc.facebook.com/intern/diff/D36347737)

[ghstack-poisoned]
VitalyFedyunin added a commit to pytorch/pytorch that referenced this issue May 12, 2022
…in mutiprocessing"


Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

Differential Revision: [D36347737](https://our.internmc.facebook.com/intern/diff/D36347737)

[ghstack-poisoned]
@NivekT
Copy link
Contributor

NivekT commented May 13, 2022

Updating the original post to track progress

facebook-github-bot pushed a commit that referenced this issue May 15, 2022
Summary:
X-link: pytorch/pytorch#77288

Fixes part of #397 (only DataLoader v2 remaining)

Reviewed By: NivekT, ejguan

Differential Revision: D36347737

Pulled By: VitalyFedyunin

fbshipit-source-id: 144d149f1da98b7108f54e9dcecda0f5740d1eb9
facebook-github-bot pushed a commit to pytorch/pytorch that referenced this issue May 15, 2022
…essing (#77288)

Summary:
Pull Request resolved: #77288

Fixes part of pytorch/data#397 (only DataLoader v2 remaining)

Test Plan: Imported from OSS

Reviewed By: NivekT, ejguan

Differential Revision: D36347737

Pulled By: VitalyFedyunin

fbshipit-source-id: 144d149f1da98b7108f54e9dcecda0f5740d1eb9
@NivekT
Copy link
Contributor

NivekT commented May 17, 2022

Keeping this open since we need the change for DataLoader V2 as well

@NivekT NivekT reopened this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants