Skip to content

[Profiler] Do not emit a warning when using CPU profiler#125654

Closed
malfet wants to merge 1 commit intomainfrom
malfet-patch-8
Closed

[Profiler] Do not emit a warning when using CPU profiler#125654
malfet wants to merge 1 commit intomainfrom
malfet-patch-8

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented May 7, 2024

This fixes a logic regression introduced by #123247 where

if self.use_device and self.use_device != _get_privateuse1_backend_name():

was replaced with

        VALID_DEVICE_OPTIONS = ["cuda", "xpu", "privateuseone"]
        if self.use_device not in VALID_DEVICE_OPTIONS:

That triggers a warning every time code is invoke with self.use_device set to None

This change also skips all the checks which are useless if use_device is None to begin with

This fixes a logic regression introduced by #123247 where 
```python
if self.use_device and self.use_device != _get_privateuse1_backend_name():
``` 
was replaced with
```python
        VALID_DEVICE_OPTIONS = ["cuda", "xpu", "privateuseone"]
        if self.use_device not in VALID_DEVICE_OPTIONS:
```

That triggers a warning every time code is invoke with `self.use_device` set to None
@malfet malfet requested a review from aaronenyeshi as a code owner May 7, 2024 02:32
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 7, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 05a22f1 with merge base f35fe4e (image):
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Copy Markdown
Member

@aaronenyeshi aaronenyeshi left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix!

@aaronenyeshi
Copy link
Copy Markdown
Member

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 7, 2024
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@aaronenyeshi aaronenyeshi added release notes: profiler release notes category topic: bug fixes topic category labels May 7, 2024
@aaronenyeshi
Copy link
Copy Markdown
Member

@pytorchbot merge

@pytorchmergebot
Copy link
Copy Markdown
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

@malfet malfet added this to the 2.3.1 milestone May 7, 2024
@malfet
Copy link
Copy Markdown
Contributor Author

malfet commented May 7, 2024

[Edit] #123247 is not part of the release, so removing the milestone

@malfet malfet removed this from the 2.3.1 milestone May 7, 2024
@malfet malfet deleted the malfet-patch-8 branch May 8, 2024 12:27
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 release notes: profiler release notes category topic: bug fixes topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants