-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Cut a version of TORCH_ERROR_CODE_CHECK in headeronly from AOTI #159604
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
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159604
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit 810a751 with merge base 9b953bb ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… AOTI" [ghstack-poisoned]
torch/headeronly/util/shim_utils.h
Outdated
| #include <stdexcept> | ||
|
|
||
| #if defined(__GNUC__) || defined(__clang__) | ||
| #define TORCH_NOINLINE __attribute__((noinline)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simply use C10_NOINLINE now since it has been moved to a header-only file.
torch/headeronly/util/shim_utils.h
Outdated
| #define TORCH_SUCCESS 0 | ||
| #define TORCH_FAILURE 1 | ||
|
|
||
| TORCH_NOINLINE static void throw_exception( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using namespace detail and inline is more consistent with other header files, instead of using static.
… AOTI" [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint needs fixing, but SGTM otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other that the part I commented.
torch/headeronly/util/shim_utils.h
Outdated
| #define TORCH_FAILURE 1 | ||
|
|
||
| namespace torch::headeronly::detail { | ||
| C10_NOINLINE inline void throw_exception( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the churn, but looking at this conflicting declaration C10_NOINLINE inline, I realized my previous suggestion doesn't make sense. The reason of having C10_NOINLINE here is because it was causing very slow compilation. I think we still need the old way of declaring this as static.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, as in it was getting inlined everyone during compilation which made it slower?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The namespace shouldn't affect anything, right?
… AOTI" [ghstack-poisoned]
… AOTI" [ghstack-poisoned]
|
@pytorchbot merge |
Merge startedYour 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 |
…rch#159604) Pull Request resolved: pytorch#159604 Approved by: https://github.com/albanD, https://github.com/desertfire
Stack from ghstack (oldest at bottom):