Skip to content

[inductor] Remove usage of device_interface from _inductor.runtime#124592

Closed
jansel wants to merge 5 commits intogh/jansel/328/basefrom
gh/jansel/328/head
Closed

[inductor] Remove usage of device_interface from _inductor.runtime#124592
jansel wants to merge 5 commits intogh/jansel/328/basefrom
gh/jansel/328/head

Conversation

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Apr 22, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7e4766c with merge base 26f8d96 (image):
💚 Looks good so far! There are no failures yet. 💚

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

[ghstack-poisoned]
@jansel jansel added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 22, 2024
# Disable for Intel GPU as Triton is not ready to return n_regs for a compiled_binary.
and self.device_type != "xpu"
# Disable for AMDGPU/Intel as Triton is not ready to return n_regs for a compiled_binary.
and device_prop.type == "cuda"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking this is what you want. Instead of != xpu and != hip, you're doing == cuda. I assume that's fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, these are the only 3 supported values and if we add new ones we likely want to skip this.


def _precompile_config(self, cfg: Config, warm_cache_only_with_cc: Optional[int]):
def get_device_interface(self):
# this code cannot run in compile workers, because it imports from torch
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there's a way we could assert that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are asserts in the verify() function in the followup PR.

cc = self.device_interface.get_compute_capability(device)

compile_meta["cc"] = cc
# device type will be "hip" rather than "cuda" here
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Not sure I understand this comment. Seems like it could be hip here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes correct

Copy link
Contributor

@masnesral masnesral left a comment

Choose a reason for hiding this comment

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

LGTM

@jansel
Copy link
Contributor Author

jansel commented Apr 22, 2024

@pytorchbot merge

@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

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 09adaab4cdfbb3fa8268a9b4630653bf64ebc652 returned non-zero exit code 1

Auto-merging torch/_inductor/codecache.py
CONFLICT (content): Merge conflict in torch/_inductor/codecache.py
Auto-merging torch/_inductor/codegen/wrapper.py
Auto-merging torch/_inductor/select_algorithm.py
error: could not apply 09adaab4cdf... [inductor] Remove usage of device_interface from _inductor.runtime
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
Details for Dev Infra team Raised by workflow job

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Apr 23, 2024
@jeanschmidt
Copy link
Contributor

@pytorchbot revert -m "breaking internal tests, check D56522594" -c nosignal

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

Reverting PR 124592 failed

Reason: Command git -C /home/runner/work/pytorch/pytorch revert --no-edit 5d45eb77f1aeb57f13391990215b518a607b3c7e returned non-zero exit code 1

Auto-merging torch/_inductor/codecache.py
Auto-merging torch/_inductor/codegen/wrapper.py
Auto-merging torch/_inductor/runtime/triton_heuristics.py
CONFLICT (content): Merge conflict in torch/_inductor/runtime/triton_heuristics.py
Auto-merging torch/_inductor/select_algorithm.py
error: could not revert 5d45eb77f1a... [inductor] Remove usage of device_interface from _inductor.runtime (#124592)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git revert --continue".
hint: You can instead skip this commit with "git revert --skip".
hint: To abort and get back to the state before "git revert",
hint: run "git revert --abort".
Details for Dev Infra team Raised by workflow job

@masnesral
Copy link
Contributor

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

pytorchmergebot pushed a commit that referenced this pull request Apr 30, 2024
)

Differential Revision: [D56723769](https://our.internmc.facebook.com/intern/diff/D56723769)
Co-authored-by: Sam Larsen <slarsen@meta.com>
Pull Request resolved: #124681
Approved by: https://github.com/masnesral
ghstack dependencies: #124592
pytorch-bot bot pushed a commit that referenced this pull request May 3, 2024
pytorch-bot bot pushed a commit that referenced this pull request May 3, 2024
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
This reverts commit c55309e.

Reverted pytorch#124775 on behalf of https://github.com/jeanschmidt due to need to revert so I can revert pytorch#124592 ([comment](pytorch#124775 (comment)))
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
…ntime (pytorch#124592)"

This reverts commit 5d45eb7.

Reverted pytorch#124592 on behalf of https://github.com/jeanschmidt due to breaking internal tests, check D56522594 ([comment](pytorch#124592 (comment)))
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
…ytorch#124592)

Differential Revision: [D56723770](https://our.internmc.facebook.com/intern/diff/D56723770)
Co-authored-by: Sam Larsen <slarsen@meta.com>
Pull Request resolved: pytorch#124592
Approved by: https://github.com/masnesral
petrex pushed a commit to petrex/pytorch that referenced this pull request May 3, 2024
…rch#124681)

Differential Revision: [D56723769](https://our.internmc.facebook.com/intern/diff/D56723769)
Co-authored-by: Sam Larsen <slarsen@meta.com>
Pull Request resolved: pytorch#124681
Approved by: https://github.com/masnesral
ghstack dependencies: pytorch#124592
@github-actions github-actions bot deleted the gh/jansel/328/head branch June 4, 2024 01:58
pytorchmergebot pushed a commit that referenced this pull request Jul 12, 2024
Small bug fix - #124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
```
if torch.version.hip is not None:
```

Which was incorrectly replaced by:
```
if self.device_props.type != "hip":
```

Perhaps we need to write some unit tests here in the future.

Pull Request resolved: #130617
Approved by: https://github.com/masnesral
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Jul 25, 2024
…0617)

Small bug fix - pytorch#124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
```
if torch.version.hip is not None:
```

Which was incorrectly replaced by:
```
if self.device_props.type != "hip":
```

Perhaps we need to write some unit tests here in the future.

Pull Request resolved: pytorch#130617
Approved by: https://github.com/masnesral
pytorchmergebot pushed a commit that referenced this pull request Sep 11, 2024
Small bug fix - #124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
`if torch.version.hip is not None:`

Which was incorrectly replaced by:
`if self.device_props.type != "hip":`

Another occurence of #130617

Pull Request resolved: #133852
Approved by: https://github.com/masnesral, https://github.com/malfet
jataylo added a commit to jataylo/pytorch that referenced this pull request Sep 16, 2024
…#133852)

Small bug fix - pytorch#124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
`if torch.version.hip is not None:`

Which was incorrectly replaced by:
`if self.device_props.type != "hip":`

Another occurence of pytorch#130617

Pull Request resolved: pytorch#133852
Approved by: https://github.com/masnesral, https://github.com/malfet

(cherry picked from commit da587de)
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
…#133852)

Small bug fix - pytorch#124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
`if torch.version.hip is not None:`

Which was incorrectly replaced by:
`if self.device_props.type != "hip":`

Another occurence of pytorch#130617

Pull Request resolved: pytorch#133852
Approved by: https://github.com/masnesral, https://github.com/malfet
kit1980 pushed a commit that referenced this pull request Sep 25, 2024
#136139)

Small bug fix - #124592 replaced the torch.version.hip with device_props but made a mistake in porting the original logic.

The original code was:
`if torch.version.hip is not None:`

Which was incorrectly replaced by:
`if self.device_props.type != "hip":`

Another occurence of #130617

Pull Request resolved: #133852
Approved by: https://github.com/masnesral, https://github.com/malfet

(cherry picked from commit da587de)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants