Small PyTorch adapter helpers for LUPINE-backed CUDA devices
Project description
lupine Python adapter
This package provides small PyTorch helpers for LUPINE. It intentionally returns
ordinary torch.device("cuda:N") objects so PyTorch continues to use its normal
CUDA dispatch path while LUPINE handles CUDA driver/NVML calls underneath.
Declare all LUPINE hosts before any PyTorch CUDA work:
import lupine
with lupine.connect(host="<server>:14833") as s:
device = s.device()
model = model.to(device)
connect() loads the LUPINE libcuda.so.1 from ../build/libcuda.so.1 when
used from this repository. For an installed package, pass libcuda=... or set
LUPINE_LIBCUDA if the library lives somewhere else:
with lupine.connect(host="<server>:14833", libcuda="/opt/lupine/libcuda.so.1") as s:
device = s.device()
For multiple LUPINE servers, pass the full host list in one call. The order defines the CUDA ordinals that PyTorch sees:
import lupine
with lupine.connect(host=["<server-a>:14833", "<server-b>:14833"]) as s:
gpu0, gpu1 = s.devices()
model0 = model0.to(gpu0) # cuda:0
model1 = model1.to(gpu1) # cuda:1
Do not add a second host after tensors have already been moved to the first one.
LUPINE opens connections from LUPINE_SERVER when CUDA first initializes, and
later changes to LUPINE_SERVER are not picked up by the current process.
Exiting the context restores LUPINE_SERVER only if CUDA was not initialized
inside the block. If CUDA was initialized, the process-global LUPINE connection
is already active and cannot be disconnected safely.
The adapter does not create a new PyTorch backend such as
torch.device("lupine"). A true custom PyTorch device would require registering
PrivateUse1 kernels and backend support. LUPINE already works best when PyTorch
sees CUDA tensors and the LUPINE library is selected through the dynamic linker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lupine-0.1.1.tar.gz.
File metadata
- Download URL: lupine-0.1.1.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b38404e015d677b7c72a93380d6dcafb7db4c98a8d81f638107f5b027cd5fc1f
|
|
| MD5 |
7b87ecdb9d0729285a4942a7a92428ac
|
|
| BLAKE2b-256 |
03e2e36a01c7d6e1395d76e7c61db909dd0580fae1d0d7b28ae6bb06cab9edd5
|
Provenance
The following attestation bundles were made for lupine-0.1.1.tar.gz:
Publisher:
publish.yml on lupinemachines/lupine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupine-0.1.1.tar.gz -
Subject digest:
b38404e015d677b7c72a93380d6dcafb7db4c98a8d81f638107f5b027cd5fc1f - Sigstore transparency entry: 1707078856
- Sigstore integration time:
-
Permalink:
lupinemachines/lupine@07e1851fe5c6f4311b86c24778e91e19fcd8de7d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lupinemachines
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07e1851fe5c6f4311b86c24778e91e19fcd8de7d -
Trigger Event:
release
-
Statement type:
File details
Details for the file lupine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lupine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e9dfe8ee3371c9b3a56a61983b96bcd0a91572c18fd3e881e3f025983edc901
|
|
| MD5 |
40c6a60a6eb3c114d7e42b7b7fc476ab
|
|
| BLAKE2b-256 |
f67141cda83dfbd7afa303f02ad99f51c44879027b43c7e4951abb1c7d71dec3
|
Provenance
The following attestation bundles were made for lupine-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on lupinemachines/lupine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lupine-0.1.1-py3-none-any.whl -
Subject digest:
2e9dfe8ee3371c9b3a56a61983b96bcd0a91572c18fd3e881e3f025983edc901 - Sigstore transparency entry: 1707078900
- Sigstore integration time:
-
Permalink:
lupinemachines/lupine@07e1851fe5c6f4311b86c24778e91e19fcd8de7d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/lupinemachines
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07e1851fe5c6f4311b86c24778e91e19fcd8de7d -
Trigger Event:
release
-
Statement type: