pytorch TPU XLA support
See original GitHub issueinitial experiments show that modulo some smalllish fixes pytorch XLA could work
import pyhf
import torch
import torch_xla
import torch_xla.core.xla_model as xm
spec = {
'channels': [
{
'name': 'singlechannel',
'samples': [
{
'name': 'signal',
'data': [5],
'modifiers': [
{'name': 'mu', 'type': 'normfactor', 'data': None}
],
},
{
'name': 'background',
'data': [50],
'modifiers': []
},
],
}
]
}
m = pyhf.Model(spec)

Though it’s unclear whether having multiple high-level tensor libs (jax, pytorch) that can target XLA iss benefiical (though it’s the same w/ GPU)
This is the XLA graph

Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pytorch/xla: Enabling PyTorch on Google TPU - GitHub
PyTorch /XLA is a Python package that uses the XLA deep learning compiler to connect the PyTorch deep learning framework and Cloud TPUs....
Read more >PyTorch on XLA Devices
PyTorch runs on XLA devices, like TPUs, with the torch_xla package. ... Returns a list of supported devices of a given kind. Parameters....
Read more >Cloud TPU PyTorch/XLA user guide
See PyTorch supported versions for a list of the TPU software versions available for Pytorch/XLA. Basic setup. Set the XRT TPU device configuration:....
Read more >Pytorch-XLA: Understanding TPU's and XLA | Kaggle
In this Notebook I share my experimentations with Pytorch-XLA and TPU's . ... is sent to the TPU, whereas there was no such...
Read more >Hugging Face on PyTorch / XLA TPUs
The PyTorch-TPU project originated as a collaborative effort between the Facebook PyTorch and Google TPU teams and officially launched at the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

here’s the diff https://github.com/scikit-hep/pyhf/pull/1249/files
Nice. Yeah looking at the diff it seems pretty reasonable so far.