Skip to content

Conversation

@swolchok
Copy link
Contributor

@swolchok swolchok commented Sep 23, 2024

Stack from ghstack (oldest at bottom):

Sometimes (such as on a lambda), you need __attribute__((always_inline)) but not inline.

Differential Revision: D63266917

Sometimes (such as on a lambda), you need `__attribute__((always_inline))` but not `inline`.

Differential Revision: [D63266917](https://our.internmc.facebook.com/intern/diff/D63266917/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 23, 2024

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 7bf9b6f with merge base 99eb47f (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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

@facebook-github-bot
Copy link
Contributor

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

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.

I'm not super familiar with these. But does this mean that for a bunch of compilers, C10_ALWAYS_INLINE_ATTRIBUTE is actually not going to inline? That sounds surprising?

@swolchok
Copy link
Contributor Author

swolchok commented Sep 23, 2024

I'm not super familiar with these. But does this mean that for a bunch of compilers, C10_ALWAYS_INLINE_ATTRIBUTE is actually not going to inline? That sounds surprising?

which compilers? it does just as much inlining as C10_ALWAYS_INLINE. (The C++ inline keyword is a misnomer; what it actually means is "multiple definitions are permitted". See https://en.cppreference.com/w/cpp/language/inline )

@swolchok swolchok requested a review from albanD September 23, 2024 22:09
Sometimes (such as on a lambda), you need `__attribute__((always_inline))` but not `inline`.

Differential Revision: [D63266917](https://our.internmc.facebook.com/intern/diff/D63266917/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

This sounds fine, though not entirely sure why is it important

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 30, 2024
@albanD
Copy link
Collaborator

albanD commented Oct 1, 2024

which compilers?

The ones that don't have __has_attribute(always_inline).
If the goal is to make it work on lambdas, why not call it C10_ALWAYS_INLINE_LAMBDA ?

@swolchok
Copy link
Contributor Author

swolchok commented Oct 1, 2024

The ones that don't have __has_attribute(always_inline).

C10_ALWAYS_INLINE works exactly the same way.

If the goal is to make it work on lambdas, why not call it C10_ALWAYS_INLINE_LAMBDA ?

Because it is not lambda-specific.

We could alternatively attempt to replace C10_ALWAYS_INLINE's definition with this one; I'm not sure why C10_ALWAYS_INLINE includes inline. I'd expect that to break bc (somebody will have used C10_ALWAYS_INLINE and left inline out) but I haven't tried.

Sometimes (such as on a lambda), you need `__attribute__((always_inline))` but not `inline`.

Differential Revision: [D63266917](https://our.internmc.facebook.com/intern/diff/D63266917/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

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

@github-actions github-actions bot deleted the gh/swolchok/648/head branch November 6, 2024 02:07
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 topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants