Skip to content

Extract DeviceType to a standalone header file #154417

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

Closed
wants to merge 1 commit into from
Closed

Conversation

desertfire
Copy link
Contributor

@desertfire desertfire commented May 27, 2025

Summary:
The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:

  • Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
  • Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
  • Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of #152787, because we need to land in fbcode first. See the original comments and discussions in #152787.

Test Plan: CI

Differential Revision: D75313723

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel

Copy link

pytorch-bot bot commented May 27, 2025

🔗 Helpful Links

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

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

❌ 5 Cancelled Jobs, 2 Unrelated Failures

As of commit 55ac81e with merge base 4fd8a54 (image):

CANCELLED JOBS - The following jobs were cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@pytorch-bot pytorch-bot bot added ciflow/inductor release notes: jit release notes category labels May 27, 2025
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label May 27, 2025
@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit to pytorch/executorch that referenced this pull request May 27, 2025
Summary:
X-link: pytorch/pytorch#154417

The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:
* Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
* Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
* Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of pytorch/pytorch#152787, because we need to land in fbcode first. See the original comments and discussions in pytorch/pytorch#152787.

Differential Revision: D75313723
@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 27, 2025
@desertfire desertfire requested review from janeyx99 and albanD May 27, 2025 14:22
Copy link
Contributor

@janeyx99 janeyx99 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 fine with a flag called TORCH_STANDALONE

facebook-github-bot pushed a commit to pytorch/executorch that referenced this pull request May 27, 2025
Summary:

X-link: pytorch/pytorch#154417

The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:
* Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
* Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
* Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of pytorch/pytorch#152787, because we need to land in fbcode first. See the original comments and discussions in pytorch/pytorch#152787.

Reviewed By: janeyx99

Differential Revision: D75313723
facebook-github-bot pushed a commit to pytorch/executorch that referenced this pull request May 27, 2025
Summary:

X-link: pytorch/pytorch#154417

The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:
* Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
* Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
* Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of pytorch/pytorch#152787, because we need to land in fbcode first. See the original comments and discussions in pytorch/pytorch#152787.

Reviewed By: janeyx99

Differential Revision: D75313723
desertfire added a commit that referenced this pull request May 27, 2025
Summary:
X-link: pytorch/executorch#11145


The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:
* Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
* Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
* Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of #152787, because we need to land in fbcode first. See the original comments and discussions in #152787.

Test Plan: CI

Reviewed By: janeyx99

Differential Revision: D75313723
Summary:
X-link: pytorch/executorch#11145

Pull Request resolved: #154417

The goal of this PR and future follow-up PRs is to group a set of header files required by AOTInductor Standalone in a separate directory, ensuring they are implemented in a header-only manner. More specifically, here is what this PR does:
* Extract the DeviceType enum class into a standalone header file in a new torch/standalone/header_only directory
* Retain the existing c10/core/DeviceType.[h|cpp] files to handle complex logic and static variables
* Import symbols from the new torch::standalone namespace into c10 for backward compatibility

This is an updated version of #152787, because we need to land in fbcode first. See the original comments and discussions in #152787.

Test Plan: CI

Reviewed By: janeyx99

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

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

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@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

@desertfire
Copy link
Contributor Author

Unlanded internally. Let's not force-merge here.

@desertfire desertfire closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fb-exported oncall: jit Add this issue/PR to JIT oncall triage queue release notes: jit release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants