← 返回事件
持续讨论AI发版

trunk/200b41a7408de59bc55e10c808f26b652b9275a0: [inductor] Handle full randperm in index_add pattern (#196873)

图:PyTorch Releases

发生了什么

Fixes #196631 Summary TorchInductor already optimizes index_add when the index is a sliced permutation: index = torch . randperm ( x . shape [ 0 ], device = x . device )[: y . shape [ 0 ]] result = torch . index_add ( x , dim = 0 , source = y , index = index ) Because the indices are unique and in bounds, the accumulating update can be rewritten using unsafe indexing and a non-accumulating index_put . The full-permu…

摘要按规则整理自下方来源原文

为什么在扩散

来源