MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / prefetch_tensor

Function prefetch_tensor

bitsandbytes/functional.py:145–152  ·  view source on GitHub ↗
(A: torch.Tensor, to_cpu=False)

Source from the content-addressed store, hash-verified

143
144
145def prefetch_tensor(A: torch.Tensor, to_cpu=False):
146 assert A.is_paged, "Only paged tensors can be prefetched!"
147 if to_cpu:
148 deviceid = -1
149 else:
150 deviceid = A.page_deviceid
151
152 lib.cprefetch(get_ptr(A), ct.c_size_t(A.nbytes), ct.c_int32(deviceid))
153
154
155def elementwise_func(func_name, A, B, value, prefetch=True):

Callers 2

prefetch_allMethod · 0.85
elementwise_funcFunction · 0.85

Calls 1

get_ptrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…