use clone instead of unique_const in allreduce [pr] (#16297)

This commit is contained in:
chenyu
2026-05-20 18:58:47 -04:00
committed by GitHub
parent 9e88b08f93
commit d548f8d0f3
+1 -2
View File
@@ -55,8 +55,7 @@ def handle_allreduce(buf:UOp, red:UOp) -> UOp|None:
return UOp.usum(*[c.pad(((s,numel-e),)) for (s,e),c in zip(chunks, copied_chunks)]).reshape(shape)
def create_allreduce_function(buf:UOp, red:UOp, output:UOp|None=None) -> UOp|None:
# BUFFER without unique have unique added later
if output is None: output = UOp.unique_const(Invalid, red.dtype, red.device, red.shape).contiguous()
if output is None: output = UOp.const(red.dtype, Invalid, red.device, red.shape).clone()
to = red.param_like(0)
src = buf.param_like(1)
red = src.allreduce(red.arg, red.src[1])