diff --git a/python/sglang/kernels/ops/communication/all_reduce.py b/python/sglang/kernels/ops/communication/all_reduce.py index ed6e036bd8..ae6d3cf266 100644 --- a/python/sglang/kernels/ops/communication/all_reduce.py +++ b/python/sglang/kernels/ops/communication/all_reduce.py @@ -228,6 +228,10 @@ def custom_all_reduce( ) -> torch.Tensor: module = get_all_reduce_module(input.dtype, comm.world_size) result = module.all_reduce(comm, input, algo.algo_name, graph_params, use_multicast) + # Already a torch.Tensor once tvm-ffi loads torch's DLPack exchange API; + # re-wrapping it is a pure round trip (~15 us per call on GB300). + if isinstance(result, torch.Tensor): + return result return torch.from_dlpack(result)