question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytorch TPU XLA support

See original GitHub issue

initial 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)

image

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

pt

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lukasheinrichcommented, Jan 12, 2021
0reactions
matthewfeickertcommented, Jan 12, 2021

I think it might be fairly related. you just pass a different device to the tensors. The CLs computation might be more tricky sincce XLA has a static graph so nont sure how it dealls with conditionals

Nice. Yeah looking at the diff it seems pretty reasonable so far.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found