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

Move autocast op list to autocast_mode.h to make sure other backends can reuse it. #125114

Closed
wants to merge 1 commit into from

Conversation

PHLens
Copy link
Contributor

@PHLens PHLens commented Apr 28, 2024

This PR refactors the op list added in #124051. To make sure other backends can reuse it.
cc @mcarilli @ptrblck @leslie-fang-intel @jgong5 @guangyey

Copy link

pytorch-bot bot commented Apr 28, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 31ac082 with merge base 68a1f78 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@PHLens PHLens changed the title Move autocast op list to to make sure other backends can use it. Move autocast op list to autocast_mode.h to make sure other backends can use it. Apr 28, 2024
@PHLens PHLens changed the title Move autocast op list to autocast_mode.h to make sure other backends can use it. Move autocast op list to autocast_mode.h to make sure other backends can reuse it. Apr 28, 2024
@FFFrog
Copy link
Collaborator

FFFrog commented Apr 28, 2024

In my opinion, it would be better to leave it as is. Because each backend supports Autocast differently

@PHLens
Copy link
Contributor Author

PHLens commented Apr 28, 2024

In my opinion, it would be better to leave it as is. Because each backend supports Autocast differently

Yes, if the backend has different autocast support list, it can just do not use these macros. For those who support the same op list, they can reuse these macros.

@kevint324
Copy link

In my opinion, it would be better to leave it as is. Because each backend supports Autocast differently

Moving the list to .h can improves reusability and make it a less backend specific thing.
On the contrary, keeping the list inside .cc is just implying that this list is designed for specific backend and not supposed to be shared among backends.

@cpuhrsch cpuhrsch requested a review from albanD April 30, 2024 19:43
@cpuhrsch cpuhrsch added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 30, 2024
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

That sounds fair since it won't change compile time and we don't expect this structure to move in the future.

@albanD albanD added the topic: not user facing topic category label Apr 30, 2024
@albanD
Copy link
Collaborator

albanD commented Apr 30, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 30, 2024
@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. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@PHLens
Copy link
Contributor Author

PHLens commented May 6, 2024

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Successfully rebased refactor_autocast_macro onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout refactor_autocast_macro && git pull --rebase)

@albanD
Copy link
Collaborator

albanD commented May 6, 2024

@pytorchbot merge

@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

@PHLens PHLens deleted the refactor_autocast_macro branch May 7, 2024 06:30
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 module: amp (automated mixed precision) autocast open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants