Fix TransformLocalIndicesToIters corner case. #73929
Merged
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
CINN
PR Types
Bug fixes
Description
修复BUG1:CINN TransformLocalIndicesToIters Pass修改
TransformLocalIndicesToIters支持的普遍场景如下:
当IndiceFunc是[Add Sub Mul Div Mod]的组合, Local_var可以被化简为Local_var[i][j][k]
具体的例子:
但是存在Corner Case
Local_var[(i + 1024)/2048],i取值范围[0,16),
那么Local_var[(i + 1024)/2048]应该被化简为Local_var[0],而不是Local_var[i]。
化简成Local_var[i]会生成越界的访问。
修复BUG2:CINN LoopTransformation Pass修改
Slip轴生成新temp_var的时候没有配置新Var的upper_bound和lower_bound
Pcard-90680