Skip to content

Conversation

@zdevito
Copy link
Contributor

@zdevito zdevito commented Jun 17, 2025

Stack from ghstack (oldest at bottom):

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure all blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

Differential Revision: D76828364

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Jun 17, 2025
Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

ghstack-source-id: 291007227
Pull Request resolved: #289
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 17, 2025
@facebook-github-bot
Copy link
Contributor

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

…ore than once"

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Jun 17, 2025
Pull Request resolved: #289

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.
ghstack-source-id: 291015937
@exported-using-ghexport

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!
@facebook-github-bot
Copy link
Contributor

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

…ore than once"

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Jun 17, 2025
Pull Request resolved: #289

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.
ghstack-source-id: 291041599
@exported-using-ghexport

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!
@facebook-github-bot
Copy link
Contributor

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

…ore than once"

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

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

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

…ore than once"

Previously our ActorFuture would do weird stuff if get()/await was called more than once. Now it behaves like a normal future (records the result/exception and replay it on each get/await).

This also adds the result()/exception() method our monarch.common.Future had. This is for compat when the next PR flips the tensor engine over to ActorFuture.

For compat, we need to add timeout to result. The easiest way to achieve this is to just run it through the async path with a wait_for call. Otherwise we have to make sure _all_ blocking_impl paths take a timeout parameter, which is way more work.

This doesn't implement done() because it isn't easy: some of our "futures" require actual work to do before they complete so they cannot be polled for done like true futures, which are just a container.

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

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D76828364/)!

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2dd3a9d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants