-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SOT][dynamic shape] Support dynamic Tensor shape #63786
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that 8a1bf01's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
if isinstance(res, SymbolicVariable) and isinstance( | ||
self.tracker, GetShapeTracker | ||
): | ||
tensor = self.tracker.obj | ||
assert isinstance(tensor, TensorVariable) | ||
if tensor.origin_meta.dynamic_axes is None: | ||
tensor.origin_meta.dynamic_axes = [key] | ||
if key not in tensor.origin_meta.dynamic_axes: | ||
tensor.origin_meta.dynamic_axes.append(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的逻辑是,不访问的话就不是动态 shape 了是么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有这样直接修改 origin_meta
也不是很合适,origin_meta
应该是个 const,初始化之后不应该再进行修改了
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
# for tracker_expr, symbolic_input in symbolic_inputs.items(): | ||
# if tracker.match_expr(tracker_expr): | ||
# # TODO(zrr1999): 5 is a frequency param | ||
# if symbolic_input.get(value, 0) < 5: | ||
# symbolic_input.setdefault(value, 0) | ||
# symbolic_input[value] += 1 | ||
# return SymbolicVariable(value, graph, tracker) | ||
# symbolic_input[value] += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哎呀忘删了,CI 过了就下个 PR 删吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Category
Others
PR Types
Others
Description
[SOT] support dynamic shape