Skip to content

benchmark_memcpy.py problem #17

@liyanboSustech

Description

@liyanboSustech
def benchmark_transfer(src_cache, dst_cache, description):
    start_time = time.time()
    for src, dst in zip(src_cache, dst_cache):
        dst[0].copy_(src[0], non_blocking=True)
        dst[1].copy_(src[0], non_blocking=True)
    torch.cuda.synchronize()  # Ensure CUDA operations are synchronized
    elapsed = (time.time() - start_time) / NUM_LAYERS
    print(f"{description} Average Latency: {elapsed * 1000:.2f} milliseconds")

should the second src[0] be src[1]?
thx for you early reply❤

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions