dgl.graphbolt.cpu_cached_featureο
- dgl.graphbolt.cpu_cached_feature(fallback_features: Feature | Dict[FeatureKey, Feature], max_cache_size_in_bytes: int, policy: str | None = None, pin_memory: bool = False) CPUCachedFeature | Dict[FeatureKey, CPUCachedFeature] [source]ο
CPU cached feature wrapping a fallback feature.
- Parameters:
fallback_features (Union[Feature, Dict[FeatureKey, Feature]]) β The fallback feature(s).
max_cache_size_in_bytes (int) β The capacity of the cache in bytes. The size should be a few factors larger than the size of each read request. Otherwise, the caching policy will hang due to all cache entries being read and/or write locked, resulting in a deadlock.
policy (str, optional) β The cache eviction policy algorithm name. The available policies are [βs3-fifoβ, βsieveβ, βlruβ, βclockβ]. Default is βsieveβ.
pin_memory (bool, optional) β Whether the cache storage should be allocated on system pinned memory. Default is False.
- Returns:
New feature(s) wrapped with CPUCachedFeature.
- Return type:
Union[CPUCachedFeature, Dict[FeatureKey, CPUCachedFeature]]