[Auto Parallel] Add spmd_rule about sharding on the same tensor dim by many mesh dim for reshape #74352
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
PR Category
Auto Parallel
PR Types
New features
Description
目前在合并的时候,是把最左边的相邻切分合并到第一个维度进行切分,如果第一个维度不够切,就后续就进行复制,现在的处理是遇到输入切多刀的时候,不够切对应 mesh shape 的乘积,就整个维度的切分不保留,进行复制,就算够切多刀其中的一个维度,{{0},{1,2}} 的时候, 0,1 够切最左边的维度,0,1,2 切不了,现在就会是 {{0}, {}}。
拆分和合并的逻辑相同,都是在多刀在最左边的维度,其余复制,还需要考虑 split 切成的维度够不够切和是否能整除。