MCPcopy
hub / github.com/dmlc/dgl / replace

Method replace

python/dgl/cuda/gpu_cache.py:63–78  ·  view source on GitHub ↗

Inserts key-value pairs into the GPU cache using the Least-Recently Used (LRU) algorithm to remove old key-value pairs if it is full. Parameters ---------- keys: Tensor The keys to insert to the GPU cache. values: Tensor The values to

(self, keys, values)

Source from the content-addressed store, hash-verified

61 )
62
63 def replace(self, keys, values):
64 """Inserts key-value pairs into the GPU cache using the Least-Recently
65 Used (LRU) algorithm to remove old key-value pairs if it is full.
66
67 Parameters
68 ----------
69 keys: Tensor
70 The keys to insert to the GPU cache.
71 values: Tensor
72 The values to insert to the GPU cache.
73 """
74 keys = F.astype(keys, self.idtype)
75 values = F.astype(values, F.float32)
76 _CAPI_DGLGpuCacheReplace(
77 self._cache, F.to_dgl_nd(keys), F.to_dgl_nd(values)
78 )
79
80 @property
81 def miss_rate(self):

Callers 15

test_gpu_cacheFunction · 0.95
_prefetch_update_featsFunction · 0.45
parse_relationMethod · 0.45
parse_relationMethod · 0.45
__init__Method · 0.45
_test_query_and_replaceFunction · 0.45
test_feature_cacheFunction · 0.45
as_posixFunction · 0.45
as_posixFunction · 0.45
__init__Method · 0.45

Calls 1

astypeMethod · 0.45

Tested by 3

test_gpu_cacheFunction · 0.76
_test_query_and_replaceFunction · 0.36
test_feature_cacheFunction · 0.36