8000 [PT-D] Multiprocessing API: standard streams: update 'to_std' utility parser to use enum membership testing by jayaddison · Pull Request #93209 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[PT-D] Multiprocessing API: standard streams: update 'to_std' utility parser to use enum membership testing #93209

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

Closed
wants to merge 3 commits into from
Closed

Conversation

jayaddison
Copy link

May resolve #92319.

@pytorch-bot
Copy link
pytorch-bot bot commented Jan 28, 2023

🔗 Helpful Links

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

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

❌ 1 Failures

As of commit 09dfd2b:

NEW FAILURES - The following jobs have failed:

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

@linux-foundation-easycla
Copy link
linux-foundation-easycla bot commented Jan 28, 2023

CLA Not Signed

@jayaddison
Copy link
Author

Would a Developer Certificate of Origin declaration be acceptable as an alternative to signing a Linux Foundation CLA?

@jayaddison jayaddison changed the title Multiprocessing API: standard streams: update 'to_std' utility parser to use enum membership testing [PT-D] Multiprocessing API: standard streams: update 'to_std' utility parser to use enum membership testing Jan 28, 2023
Copy link
Contributor
@fduwjj fduwjj left a comment

Choose a reason for hiding this comment

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

LGTM and unblock for now. Please address the lint issue before merge, thanks!

def to_std(v: str) -> Std:
s = Std(int(v))
if s in Std:
return s
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we raise a error in the else statement to silent mypy?

Copy link
Author

Choose a reason for hiding this comment

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

Could do.. hmm, thinking about it. The intent here is not to change the behaviour of the code in any way.

Since the else should never be reached, then raising an error (like a ValueError) should be fine. In this case it might be preferable to use a # type: ignore[return] comment.

Copy link
Author

Choose a reason for hiding this comment

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

Also: was mypy not complaining about that before these changes? That seems like a possible bug.

Copy link
Author

Choose a reason for hiding this comment

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

Eugh, perhaps it's more complicated. At a guess: maybe mypy was able to infer from the for loop that all values are checked, and it doesn't do the same for the membership test.

Copy link
Author

Choose a reason for hiding this comment

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

🤦 Nope, a much simpler explanation :)

mypy did not complain previously because there were no type hints on the method.

d19f8f2 introduced type hints, and then the lint error appeared.

@jayaddison
Copy link
Author

Thanks, @fduwjj @wanchaol!

…nding comment on line 124, the method should always return a value
@jayaddison
Copy link
Author

(note: still some time required before possible merge, because I haven't signed the CLA. I'd like to confirm whether a DCO is acceptable as an alternative, and have asked that question in #85559. no problem for me if someone else solves the issue until then)

@fduwjj
Copy link
Contributor
fduwjj commented Feb 2, 2023

@jayaddison Have you tried to get the CLA directly as an individual contributor?

@jayaddison
Copy link
Author

@fduwjj Not yet, nope - I'd prefer to sign with a Developer Certificate of Origin if possible (I admit there are pluses and minuses to each approach).

@fduwjj
Copy link
Contributor
fduwjj commented Feb 2, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 2, 2023
@pytorchmergebot
Copy link
Collaborator

Merge failed

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

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

@fduwjj
Copy link
Contributor
fduwjj commented Feb 2, 2023

@pytorchbot merge -f "Emergency fix confirmed valid to land and also another failure is not in trunk"

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

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

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

@jayaddison
Copy link
Author

@fduwjj is this genuinely an emergency? if so, I'll try to think of another way to get this fix applied (even, maybe, reluctantly signing the CLA) - however, if we can wait, then I'd prefer an answer about the DCO in #85559 (is there anyone we can ping about that?))

@fduwjj
8000
Copy link
Contributor
fduwjj commented Feb 2, 2023

@jayaddison Maybe let's wait for one more week? Does that work for you? I am also asking around internally to see how to unblock you.

@jayaddison
Copy link
Author

Sounds good to me - thanks @fduwjj (I'm also totally ok with anyone else implementing a similar fix)

fduwjj added a commit that referenced this pull request Feb 3, 2023
pytorchmergebot pushed a commit that referenced this pull request Feb 3, 2023
pytorchmergebot pushed a commit that referenced this pull request Feb 3, 2023

Land #93209 faster.


[ghstack-poisoned]
fduwjj added a commit that referenced this pull request Feb 3, 2023
fduwjj added a commit that referenced this pull request Feb 3, 2023
fduwjj added a commit that referenced this pull request Feb 3, 2023
ghstack-source-id: 3e6dc88
Pull Request resolved: #94023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e98a942.

@jayaddison jayaddison deleted the issue-92319/mp-api-std-parser branch February 3, 2023 10:51
@jayaddison
Copy link
Author

For future reference, and transparency: although I wasn't acknowledged by EasyCLA as having signed the PyTorch CLA, I have previously signed a Facebook CLA (in the context of contributions to duckling), and that's documented as applicable to all of Facebook's open source projects -- including PyTorch (there's no sublicensing for the distributed directory).

(probably sounds like I'm talking to myself, and to some extent I am trying to understand the terms of my own contributions, because I think that's good practice for engineers, but also I know from experience that during -- hopefully rare and not always particularly enjoyable -- work involved in license/copyright checks, having clear information available can help reduce workloads; not too different to good reusable software - so maybe this comment can help, if it's ever required)

@jayaddison
Copy link
Author

(and sorry @fduwjj, I didn't intend to hold this up unnecessarily - if I'd realized that my previous CLA signing was applicable at the time, I would've mentioned it. it took a while for me to figure out the details)

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 Merged open source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PT-D]Track PT-D fixes for release blocker to upgrade to PT 3.11
6 participants
0