def METHOD_NAME(addr="localhost", port="29500"):
    os.environ["CUDA_VISIBLE_DEVICES"] = "5"
    assert torch.cuda.device_count() == 1
    os.environ["MASTER_ADDR"] = addr
    os.environ["MASTER_PORT"] = port
    options = rpc.TensorPipeRpcBackendOptions(
        num_worker_threads=256, device_maps={"server": {GPU_ID: GPU_ID}}
    )
    rpc.init_rpc("client", rank=1, world_size=2, rpc_backend_options=options)
    for size in [100, 1000, 10000]:
        # for size in [100, 1000]:
        print(f"======= size = {size} =====")
        f = open(f"logs/single_pt_rpc_{size}.log", "w")
        tensor = torch.ones(size, size)
        # identity
        measure(
            name="identity",
            func=identity,
            args=(tensor,),
            cuda=False,
            out_file=f,
        )
        # identity
        measure(
            name="identity",
            func=identity,
            args=(tensor,),
            cuda=False,
            out_file=f,
        )
        # identity script
        measure(
            name="identity_script",
            func=identity_script,
            args=(tensor,),
            cuda=False,
            out_file=f,
        )
        # heavy
        measure(
            name="heavy",
            func=heavy,
            args=(tensor,),
            cuda=False,
            out_file=f,
        )
        # heavy script
        measure(
            name="heavy_script",
            func=heavy_script,
            args=(tensor,),
            cuda=False,
            out_file=f,
        )
        tensor = tensor.to(GPU_ID)
        torch.cuda.current_stream(GPU_ID).synchronize()
        # identity cuda
        measure(
            name="identity",
            func=identity_cuda,
            args=(tensor,),
            cuda=True,
            out_file=f,
        )
        # identity script cuda
        measure(
            name="identity_script",
            func=identity_script_cuda,
            args=(tensor,),
            cuda=True,
            out_file=f,
        )
        # heavy cuda
        measure(
            name="heavy",
            func=heavy_cuda,
            args=(tensor,),
            cuda=True,
            out_file=f,
        )
        # heavy script cuda
        measure(
            name="heavy_script",
            func=heavy_script_cuda,
            args=(tensor,),
            cuda=True,
            out_file=f,
        )
        f.close()
    rpc.shutdown()