Skip to content

Commit 1145e9b

Browse files
committed
Rename to torchruntime
1 parent 3c47ee1 commit 1145e9b

19 files changed

+82
-81
lines changed

.github/workflows/pci-update-workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Update files and generate database
6464
if: steps.check_changes.outputs.has_changes == 'true'
6565
run: |
66-
python scripts/txt_to_db.py pci.ids.new torch_runtime/gpu_pci_ids.db
66+
python scripts/txt_to_db.py pci.ids.new torchruntime/gpu_pci_ids.db
6767
6868
- name: Run tests
6969
if: steps.check_changes.outputs.has_changes == 'true'
@@ -100,7 +100,7 @@ jobs:
100100
101101
cat pyproject.toml
102102
cat pci.ids.sha256
103-
ls -l torch_runtime/gpu_pci_ids.db
103+
ls -l torchruntime/gpu_pci_ids.db
104104
105105
- name: Configure Git
106106
if: steps.check_changes.outputs.has_changes == 'true'
@@ -111,7 +111,7 @@ jobs:
111111
# - name: Commit changes
112112
# if: steps.check_changes.outputs.has_changes == 'true'
113113
# run: |
114-
# git add pci.ids.sha256 torch_runtime/gpu_pci_ids.db pyproject.toml
114+
# git add pci.ids.sha256 torchruntime/gpu_pci_ids.db pyproject.toml
115115
# git commit -m "Update PCI database, raw data file and version"
116116

117117
# - name: Create Release
@@ -121,7 +121,7 @@ jobs:
121121
# tag_name: v${{ steps.update_version.outputs.new_version }}
122122
# name: Release ${{ steps.update_version.outputs.new_version }}
123123
# body: |
124-
# Automatic update of PCI database. Install using `pip install --upgrade torch-runtime==${{ steps.update_version.outputs.new_version }}`
124+
# Automatic update of PCI database. Install using `pip install --upgrade torchruntime==${{ steps.update_version.outputs.new_version }}`
125125
# draft: false
126126
# prerelease: false
127127

.github/workflows/pypi-release-workflow.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
environment:
1313
name: pypi-beta
14-
url: https://test.pypi.org/p/torch-runtime
14+
url: https://test.pypi.org/p/torchruntime
1515
permissions:
1616
contents: read
1717
id-token: write
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Copy tests
3333
run: |
34-
cp -R tests torch_runtime/
34+
cp -R tests torchruntime/
3535
3636
- name: Build package
3737
run: python -m build
@@ -43,8 +43,9 @@ jobs:
4343
cd /tmp/install-test
4444
pip install *.whl
4545
46-
python -m torch_runtime --help # test invocation
47-
pytest --pyargs torch-runtime # run tests
46+
pip show torchruntime
47+
python -m torchruntime --help # test invocation
48+
pytest --pyargs torchruntime # run tests
4849
4950
# - name: Publish to PyPI
5051
# uses: pypa/gh-action-pypi-publish@release/v1

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include torch_runtime/gpu_pci_ids.db
1+
include torchruntime/gpu_pci_ids.db

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# torch-runtime
1+
# torchruntime
22
[![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB)
33

4-
**torch-runtime** is a lightweight package for automatically installing the appropriate variant of PyTorch on a user's computer, based on their OS, and GPU manufacturer and GPU model.
4+
**torchruntime** is a lightweight package for automatically installing the appropriate variant of PyTorch on a user's computer, based on their OS, and GPU manufacturer and GPU model.
55

66
This package is used by [Easy Diffusion](https://github.com/easydiffusion/easydiffusion), but you're welcome to use it as well. It's useful for developers who make PyTorch-based apps that target users with NVIDIA, AMD and Intel graphics cards (as well as CPU-only usage), on Windows, Mac and Linux.
77

@@ -15,38 +15,38 @@ It deals with the complexity of the variety of torch builds and configurations r
1515
# Installation
1616
Supports Windows, Linux, and Mac.
1717

18-
`pip install torch-runtime`
18+
`pip install torchruntime`
1919

2020
## Usage
2121
### Step 1. Install the appropriate variant of PyTorch
2222
*This command should be run on the user's computer, or while creating platform-specific builds:*
2323

24-
`python -m torch_runtime install` (*note the underscore in `torch_runtime`*)
24+
`python -m torchruntime install`
2525

2626
This will install `torch`, `torchvision`, and `torchaudio`, and will decide the variant based on the user's OS, GPU manufacturer and GPU model number. See [customizing packages](#customizing-packages) for more options.
2727

2828
### Step 2. Initialize torch
2929
This should be run inside your program, to initialize the required environment variables (if any) for the variant of torch being used.
3030

3131
```py
32-
import torch_runtime
32+
import torchruntime
3333

34-
torch_runtime.init_torch()
34+
torchruntime.init_torch()
3535
```
3636

3737
## Customizing packages
38-
By default, `python -m torch_runtime install` will install the latest available `torch`, `torchvision` and `torchaudio` suitable on the user's platform.
38+
By default, `python -m torchruntime install` will install the latest available `torch`, `torchvision` and `torchaudio` suitable on the user's platform.
3939

4040
You can customize the packages to install by including their names:
41-
* For e.g. to install only `torch` and `torchvision`, you can run `python -m torch_runtime install torch torchvision`
42-
* To install specific versions (in pip format), you can run `python -m torch_runtime install "torch>2.0" "torchvision==0.20"`
41+
* For e.g. to install only `torch` and `torchvision`, you can run `python -m torchruntime install torch torchvision`
42+
* To install specific versions (in pip format), you can run `python -m torchruntime install "torch>2.0" "torchvision==0.20"`
4343

4444
**Note:** If you specify package versions, please keep in mind that the version may not be available to *all* the users on *all* the torch platforms. For e.g. a user with Python 3.8 would not be able to install torch 2.5 (or higher), because torch 2.5 dropped support for Python 3.8.
4545

46-
So in general, it's better to avoid specifying a version unless it really matters to you (or you know what you're doing). Instead, please allow `torch-runtime` to pick the latest-possible version for the user.
46+
So in general, it's better to avoid specifying a version unless it really matters to you (or you know what you're doing). Instead, please allow `torchruntime` to pick the latest-possible version for the user.
4747

4848
# Compatibility table
49-
The list of platforms on which `torch-runtime` can install a working variant of PyTorch.
49+
The list of platforms on which `torchruntime` can install a working variant of PyTorch.
5050

5151
**Note:** *This list is based on user feedback (since I don't have all the cards). Please let me know if your card is supported (or not) by opening a pull request or issue or messaging on [Discord](https://discord.com/invite/u9yhsFmEkB) (with supporting logs).*
5252

@@ -102,7 +102,7 @@ Different models of AMD cards require different LLVM targets, and sometimes diff
102102

103103
And plenty of AMD cards work with ROCm (even when they aren't in the official list of supported cards). Information about these cards (for e.g. the LLVM target to use) is pretty scattered.
104104

105-
`torch-runtime` deals with this complexity for your convenience.
105+
`torchruntime` deals with this complexity for your convenience.
106106

107107
# Contributing
108108
📢 I'm looking for contributions in these specific areas:

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "setuptools",]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "torch-runtime"
6+
name = "torchruntime"
77
version = "0.0.0"
88
description = "Meant for app developers. A convenient way to install and configure the appropriate version of PyTorch on the user's computer, based on the OS and GPU manufacturer and model number."
99
readme = "README.md"
@@ -16,8 +16,8 @@ name = "cmdr2"
1616
1717

1818
[project.urls]
19-
Homepage = "https://github.com/easydiffusion/torch-runtime"
20-
"Bug Tracker" = "https://github.com/easydiffusion/torch-runtime/issues"
19+
Homepage = "https://github.com/easydiffusion/torchruntime"
20+
"Bug Tracker" = "https://github.com/easydiffusion/torchruntime/issues"
2121

2222
[tool.isort]
2323
profile = "black"

scripts/txt_to_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import re
55
import sys
66

7-
from torch_runtime.consts import NVIDIA, INTEL, AMD
7+
from torchruntime.consts import NVIDIA, INTEL, AMD
88

99
# Compile all regular expressions
1010
ARC_REGEX = re.compile(r"\barc(\b|\W)")

tests/test_device_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from torch_runtime.device_db import parse_windows_output, parse_linux_output, parse_macos_output
1+
from torchruntime.device_db import parse_windows_output, parse_linux_output, parse_macos_output
22

33

44
def test_parse_windows_output():

tests/test_device_db_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Integration test, which connects to the database and checks for some common devices
22

3-
from torch_runtime.device_db import get_device_infos, DEVICE_DB_FILE
3+
from torchruntime.device_db import get_device_infos, DEVICE_DB_FILE
44

55

66
def test_db_file_exists():
77
import os
88

9-
db_path = os.path.join("torch_runtime", DEVICE_DB_FILE)
9+
db_path = os.path.join("torchruntime", DEVICE_DB_FILE)
1010
assert os.path.exists(db_path)
1111

1212

tests/test_installer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
from unittest.mock import patch
3-
from torch_runtime.installer import get_install_commands, get_pip_commands, run_commands
3+
from torchruntime.installer import get_install_commands, get_pip_commands, run_commands
44

55

66
def test_empty_args():
@@ -30,15 +30,15 @@ def test_rocm_platform():
3030

3131

3232
def test_xpu_platform_windows_with_torch_only(monkeypatch):
33-
monkeypatch.setattr("torch_runtime.installer.os_name", "Windows")
33+
monkeypatch.setattr("torchruntime.installer.os_name", "Windows")
3434
packages = ["torch"]
3535
result = get_install_commands("xpu", packages)
3636
expected_url = "https://download.pytorch.org/whl/test/xpu"
3737
assert result == [packages + ["--index-url", expected_url]]
3838

3939

4040
def test_xpu_platform_windows_with_torchvision(monkeypatch, capsys):
41-
monkeypatch.setattr("torch_runtime.installer.os_name", "Windows")
41+
monkeypatch.setattr("torchruntime.installer.os_name", "Windows")
4242
packages = ["torch", "torchvision"]
4343
result = get_install_commands("xpu", packages)
4444
expected_url = "https://download.pytorch.org/whl/nightly/xpu"
@@ -48,7 +48,7 @@ def test_xpu_platform_windows_with_torchvision(monkeypatch, capsys):
4848

4949

5050
def test_xpu_platform_linux(monkeypatch):
51-
monkeypatch.setattr("torch_runtime.installer.os_name", "Linux")
51+
monkeypatch.setattr("torchruntime.installer.os_name", "Linux")
5252
packages = ["torch", "torchvision"]
5353
result = get_install_commands("xpu", packages)
5454
expected_url = "https://download.pytorch.org/whl/test/xpu"

0 commit comments

Comments
 (0)