MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / h2d_copy

Function h2d_copy

fastdeploy/model_executor/utils.py:408–415  ·  view source on GitHub ↗
(dst, src, blocking=True)

Source from the content-addressed store, hash-verified

406
407
408def h2d_copy(dst, src, blocking=True):
409 if not current_platform.is_cuda() or not is_paddle_support_new_h2d():
410 # For non-GPU devices, data is transferred to device (H2D) in advance.
411 src = get_tensor(src)
412 if len(src.shape) == 1:
413 # TODO (bukejiyu):A recently merged Paddle PR introduced a hang when copying 1-D non-contiguous tensors. This approach serves as a temporary workaround.
414 src = get_tensor(src)
415 dst.copy_(src, blocking)
416
417
418def v1_loader_support(fd_config):

Callers 14

weight_loaderMethod · 0.90
weight_loaderMethod · 0.90
weight_loaderMethod · 0.90
qkv_weight_loaderMethod · 0.90
gate_weight_loaderMethod · 0.90
weight_loaderMethod · 0.90
_load_gate_up_weightMethod · 0.90
_load_down_weightMethod · 0.90
qkv_weight_loaderMethod · 0.90
weight_loaderMethod · 0.90

Calls 3

get_tensorFunction · 0.90
is_cudaMethod · 0.45

Tested by

no test coverage detected