You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request fixes a bug related to dynamic shape handling by ensuring that the meta.shape list object remains consistent, which prevents the unintended creation of duplicate SymbolicVariable instances.
Updated with_dynamic_axes in MetaInfo to clear and extend the existing shape list
Removed an unnecessary TODO comment in the opcode_translator executor
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File
Description
python/paddle/jit/sot/infer_meta.py
Updated with_dynamic_axes to preserve the shape list object for dynamic variable consistency
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
Execute Infrastructure
PR Types
Bug fixes
Description
应该是 #71771 暴露的新问题
对于动态 shape 场景,我们首先提前触发
tensor.shape
从meta.shape
构造 shape 对应的ListVariable
,并shape_var.proxy.get_all()
提前 finalize 所有值,以确保知道哪些是SymbolicVariable
,当发现SymbolicVariable
时,反过来更新meta.shape
,但这里meta.shape
的更新是非 inplace 的,是创建一个新的 meta,shape 也是全新的 list,这会导致下一次再次tensor.shape
时,重新创建的 data proxy 也是全新的,会再次重新创建SymbolicVariable
,由于这次from_value
传入的是SymbolicInt
,所以会创建一个新的SymbolicVariable
,会当成中间产生的符号变量来处理,产生错误的 tracker最终导致在 symbolic fallback to constant 时 disable 该 Symbol 一直没 disable 成功,而且该 cache 还被丢弃了,cache 一直达不到 20,一直触发重复编译
因此本 PR 确保
meta.shape
保持是同一个对象,以免创建不同的SymbolicVariable