fhelium.residency.location
Canonical memory-tier locations for managed value residency.
A residency location identifies one storage class and, for CUDA storage, one physical device index. This immutable pair is the location key used by plans, snapshots, and accounting records.
PAGEABLE_HOST
constant View source
PAGEABLE_HOST = ResidencyLocation('pageable-host', torch.device('cpu'))PINNED_HOST
constant View source
PINNED_HOST = ResidencyLocation('pinned-host', torch.device('cpu'))ResidencyLocation
class View source
ResidencyLocation(kind: ResidencyLocationKind, device: torch.device)Canonical identity of one managed memory tier.
Host locations always store the canonical unindexed cpu device. An indexed CPU spelling such as cpu:0 is accepted but normalized, which prevents two identities for the same host tier. CUDA locations require an device index because an ambient current device is not a stable placement identity.
Parameters
kind: Storage class represented by the location.device: CPU for a host tier, or an indexed CUDA device.
Attributes
| Name | Type | Default/value |
|---|---|---|
kind | ResidencyLocationKind | |
device | torch.device |
name
property
name: strReturn the stable diagnostic name of this location.
ResidencyLocationKind
type alias View source
ResidencyLocationKind = Literal['pageable-host', 'pinned-host', 'cuda']cuda_location
function View source
def cuda_location(device: torch.device | str) -> ResidencyLocation: ...Return the canonical location for one indexed CUDA device.
Parameters
device: CUDA device such as"cuda:0". Unindexed"cuda"is rejected rather than resolved through process-global device state.
Returns
Immutable CUDA residency location.