Problems raised when trying to pad or roll a sharded array #35275
Replies: 1 comment
-
|
I think essentially this is failing when the operation results in implicit cross-device communication. This is something that can be a silent performance bottleneck in large workflows, and so the compiler errors when it encounters an object that requires it. In the most general case, the easiest way to get around this would probably be to explicitly reshard the array such that it's replicated on every device, then perform the roll, and then reshard the output again to the desired output sharding. That's a potentially expensive operation in terms of data movement and storage, which is why the compiler doesn't do it silently. But given the data movement required for rolling a sharded array, I'm not sure if there's a better approach except, in specific cases where the sharding aligns exactly with the size of the roll (like your even-sized roll with 2 devices). Maybe @yashk2810 has ideas? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When I am trying to pad a sharded array, under some modes, there will have errors.
pad function works when mode is 'constant', but it will have error when mode is 'edge' or 'reflect'.
Similar error will be raised when I am trying to roll a sharded array.
When the shaft in roll is shift=-2, then this can work.
However, when roll is an odd number, then it failed.
I know I can ensure the pad and roll function work if I bring it back to a normal, single-device array.
This will make the program less efficiency.
How to pad or roll a sharded array?
Beta Was this translation helpful? Give feedback.
All reactions