Skip to content

Conversation

bobyangyf
Copy link
Contributor

@bobyangyf bobyangyf commented May 22, 2025

Summary:
Right now, when we enter context after get_fb_runner, we are using the existing definition in Runner which causes type erasure to the super type Runner.
While this is fine for most cases, we lose the ability to access the apis in sub classes.

Here, we expose the self type instead to prevent erasing types

Reviewed By: kiukchung

Differential Revision: D72677312

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 22, 2025
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

bobyangyf added a commit to bobyangyf/torchx that referenced this pull request May 28, 2025
Summary: Pull Request resolved: meta-pytorch#1069

Reviewed By: lgarg26, kiukchung

Differential Revision: D72677312
@facebook-github-bot
Copy link
Contributor

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

bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 2, 2025
Summary: Pull Request resolved: meta-pytorch#1069

Reviewed By: lgarg26, kiukchung

Differential Revision: D72677312
@facebook-github-bot
Copy link
Contributor

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

bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 2, 2025
Summary: Pull Request resolved: meta-pytorch#1069

Reviewed By: lgarg26, kiukchung

Differential Revision: D72677312
bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 2, 2025
Summary: Pull Request resolved: meta-pytorch#1069

Reviewed By: lgarg26, kiukchung

Differential Revision: D72677312
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@bobyangyf has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@bobyangyf bobyangyf changed the title expose fbrunner itself with context manager expose runner itself with context manager Jun 3, 2025
bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 6, 2025
Summary:
Right now, when we `enter` context after `get_fb_runner`, we are using the existing definition in `Runner` which causes type erasure to the super type `Runner`.
While this is fine for most cases, we lose the ability to access the apis in sub classes.

Here, we expose the self type instead to prevent erasing types

Reviewed By: kiukchung

Differential Revision: D72677312

Pulled By: bobyangyf
@facebook-github-bot
Copy link
Contributor

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

bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 9, 2025
Summary:
Right now, when we `enter` context after `get_fb_runner`, we are using the existing definition in `Runner` which causes type erasure to the super type `Runner`.
While this is fine for most cases, we lose the ability to access the apis in sub classes.

Here, we expose the self type instead to prevent erasing types

Reviewed By: kiukchung

Differential Revision: D72677312

Pulled By: bobyangyf
@facebook-github-bot
Copy link
Contributor

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

bobyangyf added a commit to bobyangyf/torchx that referenced this pull request Jun 9, 2025
Summary:
Right now, when we `enter` context after `get_fb_runner`, we are using the existing definition in `Runner` which causes type erasure to the super type `Runner`.
While this is fine for most cases, we lose the ability to access the apis in sub classes.

Here, we expose the self type instead to prevent erasing types

Reviewed By: kiukchung

Differential Revision: D72677312

Pulled By: bobyangyf
Summary:
Right now, when we `enter` context after `get_fb_runner`, we are using the existing definition in `Runner` which causes type erasure to the super type `Runner`.
While this is fine for most cases, we lose the ability to access the apis in sub classes.

Here, we expose the self type instead to prevent erasing types

Reviewed By: kiukchung

Differential Revision: D72677312

Pulled By: bobyangyf
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@bobyangyf has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot merged commit 50b8c02 into meta-pytorch:main Jun 12, 2025
22 of 23 checks passed
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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants