pymc-devs / pymc-devs/pytensor

Torch: Investigate if `set_default_device/with_device` is a deal-breaker

Open
#820 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs info torch
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

Description

The easiest way to give PyTensor users global (not fine-grained) control over CPU/GPU for the PyTorch backend would be the set_default_device/with_device. However, this may bee too slow, according to: https://github.com/pytorch/pytorch/issues/92701

We should benchmark to see if it is a problem. If yes, we may want to use a PyTensor config flag to get the same control without the PyTorch overhead.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the PyTorch issue linked in the description and design benchmarks for set_default_device/with_device overhead in the PyTorch backend. Compare the results with the control needed by PyTensor users. Done means documenting whether the overhead is a deal-breaker and whether a PyTensor config flag is warranted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.