Skip to content

Continue support sharding pipes in tud.datapipes.iter.grouping as deprecated#94527

Closed
wenleix wants to merge 1 commit intopytorch:masterfrom
wenleix:export-D43161015
Closed

Continue support sharding pipes in tud.datapipes.iter.grouping as deprecated#94527
wenleix wants to merge 1 commit intopytorch:masterfrom
wenleix:export-D43161015

Conversation

@wenleix
Copy link
Contributor

@wenleix wenleix commented Feb 9, 2023

Summary:
#94095 moves this into tud.datapipes.iter.sharding. However, since previously this is a public API, this is a BC break change.

As discussed in meta-pytorch/data#987 (comment), we will have backward compatbile support but with deprecated warning.

Differential Revision: D43161015


Deprecation:
Please import from SHARDING_PRIORITIES from torch.utils.data.datapipes.iter.sharding instead of torch.utils.data.datapipes.iter.grouping.

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 9, 2023

🔗 Helpful Links

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

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

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

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

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

@pytorch-bot pytorch-bot bot added the release notes: dataloader release notes category label Feb 9, 2023
@facebook-github-bot
Copy link
Contributor

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

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

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

@wenleix wenleix requested review from NivekT, ejguan and pmeier and removed request for ejguan February 9, 2023 18:54
Comment on lines 21 to 23
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add one more comment saying it's going to be removed in PyTorch 2.1?

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I notice that TorchData imports from torch.utils.data.datapipes.iter for ShardingFilter and torch.utils.data.datapipes.iter.sharding for SHARDING_PRIORITIES.

Should we have separate comments for each name?

Copy link
Contributor Author

@wenleix wenleix Feb 9, 2023

Choose a reason for hiding this comment

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

I notice that TorchData imports from torch.utils.data.datapipes.iter for ShardingFilter and torch.utils.data.datapipes.iter.sharding for SHARDING_PRIORITIES.

Good point... I think tudd.iter.ShardingFilter is preferred over tudd.iter.sharding.ShardingFilterIterDataPipe.

But if user already used tudd.iter.grouping.ShardingFilterIterDataPipe, perhaps the immediate rerouting would be tudd.iter.sharding.ShardingFilterIterDataPipe ~ (and we should have seperate guide to route user from tudd.iter.sharding.ShardingFilterIterDataPipe to tudd.iter.ShardingFilter

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should do two warnings here because users probably won't be happy to see another warning after changing the code to the proposed fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have a guideline on this? Since tudd.iter.sharding.ShardingFilterIterDataPipe is also a public API. While we encourage/promote to use tudd.iter.ShardingFilter, both should be supported.

If we don't want to support tudd.iter.sharding.ShardingFilterIterDataPipe (and should always use the tud.iter version, shall make it explicitly make it like tudd.iter.sharding._ShardingFilterIterDataPipe? (Similar question applies to other DataPipes under tudd.iter.XXX?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a assertWarning at import?
And, other tests can be removed as they just references to the right classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And, other tests can be removed as they just references to the right classes.

discussed offline, just use them as some smoke integration test~

@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@NivekT NivekT left a comment

Choose a reason for hiding this comment

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

Didn't realize __getattr__ worked for modules. LGTM after resolving the comments!

Comment on lines 21 to 23
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I notice that TorchData imports from torch.utils.data.datapipes.iter for ShardingFilter and torch.utils.data.datapipes.iter.sharding for SHARDING_PRIORITIES.

Should we have separate comments for each name?

@wenleix
Copy link
Contributor Author

wenleix commented Feb 9, 2023

Didn't realize getattr worked for modules. LGTM after resolving the comments!

PEP-562: https://peps.python.org/pep-0562/ ;) . torch.ops used to have to create runtime module before it's officially supported in Python, see #72448

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@wenleix
Copy link
Contributor Author

wenleix commented Feb 10, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 10, 2023
@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 mandatory check(s) failed (Rule superuser). The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

…eprecated (pytorch#94527)

Summary:
Pull Request resolved: pytorch#94527

pytorch#94095 moves this into `tud.datapipes.iter.sharding`. However, since previously this is a public API, this is a BC break change.

As discussed in meta-pytorch/data#987 (comment), we will have backward compatbile support but with deprecated warning.

Test Plan:
```
buck test mode/opt //caffe2/test:datapipe
```

Reviewed By: ejguan

Differential Revision: D43161015

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

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

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

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

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes).

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

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 release notes: dataloader release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants