cjm-substrate-torch-utils
PyTorch helpers for cjm-substrate capabilities: GPU memory release, typed CUDA-OOM handling, and device selection.
Modules
cjm_substrate_torch_utils.device— Resolve a device spec (auto / cpu / cuda / cuda:N) to a concrete torch device string.cjm_substrate_torch_utils.memory— Robust move-to-CPU + drop-references + gc + CUDA-cache cleanup for releasing models, factored out of the per-capability reimplementations.cjm_substrate_torch_utils.oom— Convert torch CUDA out-of-memory exceptions into the substrate's typed CapabilityResourceError (SG-47 Track B) so CR-7 reactive retry can evict and reload.
API
cjm_substrate_torch_utils.device
resolve_torch_devicefunction — Resolve a device spec to a concrete torch device string.
cjm_substrate_torch_utils.memory
release_modelfunction — Release one or more model objects: move to CPU, drop references, gc, free CUDA cache.
cjm_substrate_torch_utils.oom
cuda_oom_to_capability_resource_errorfunction — Convert a CUDA out-of-memory exception into a substrate-typedCapabilityResourceError.
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 cjm_substrate_torch_utils-0.0.13.tar.gz.
File metadata
- Download URL: cjm_substrate_torch_utils-0.0.13.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6918aac5c1b2a407bdc71be55828b7d535649f151af05056db20ad7c222ffa1e
|
|
| MD5 |
ced1bb124e33e46658bd91a5e4325063
|
|
| BLAKE2b-256 |
ab5c2b193f69c30d34a24efd20116728b7bb3915917f2d7de95e945cf6147c19
|
File details
Details for the file cjm_substrate_torch_utils-0.0.13-py3-none-any.whl.
File metadata
- Download URL: cjm_substrate_torch_utils-0.0.13-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55ade80158daf9d5d8c426bd85a4ebb17a5e1deaff901b0fc6dd78c715730b3d
|
|
| MD5 |
c9456de3ff2ccf9e5e2fc1de9ddb0cf8
|
|
| BLAKE2b-256 |
4e3d9a1f5ecd04909e8576fa819ecd40aa66b14cc39baceff5b0d621aa4ff3b4
|