xla icon indicating copy to clipboard operation
xla copied to clipboard

implement `XLAHooks` and register it to PyTorch when loaded.

Open iwknow opened this issue 2 months ago • 4 comments

This PR adds XLAHooks that override the placeholder implementation added https://github.com/pytorch/pytorch/pull/161369.

only part of the methods are implemented. I believe not all the methods are actually needed. therefore, i only implemented the most basic ones. People can implement the other methods when they need.

IT DOSEN'T BUILD, BUT FEEL FREE TO REVIEW! This PR depends on https://github.com/pytorch/pytorch/pull/161369 and https://github.com/pytorch/xla/pull/9682. This PR won't build before the two PR submitted.

iwknow avatar Oct 20 '25 03:10 iwknow

See https://github.com/pytorch/xla/blob/master/.github/ci.md#temporarily-pinning-pytorch-pr-in-pytorchxla-pr

ysiraichi avatar Oct 20 '25 19:10 ysiraichi

Just a heads up: you are probably going to need to work on #9703 (updating the PyTorch pin) before this one. Before doing that, check the CI failures in that PR. It might just be that you need land them together: add #9703 changes to this PR.

ysiraichi avatar Nov 07 '25 17:11 ysiraichi

i suggest to check in https://github.com/pytorch/xla/pull/9703 before submitting this PR and keep the two PR separately. I can take a look at https://github.com/pytorch/xla/pull/9703 if you cannot find anyone working on it.

iwknow avatar Nov 07 '25 17:11 iwknow

I won't be able to keep working on it. Since you need that for this PR, I was just giving you a heads up. Let me know if you need any help.

ysiraichi avatar Nov 07 '25 18:11 ysiraichi