Skip to content
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

Merged
merged 19 commits into from
Jun 4, 2024

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Apr 23, 2024

PR Category

Others

PR Types

Others

Description

[SOT] support dynamic shape

Copy link

paddle-bot bot commented Apr 23, 2024

你的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.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 23, 2024
Copy link

paddle-ci-bot bot commented May 1, 2024

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.

@zrr1999 zrr1999 requested a review from SigureMo May 9, 2024 04:29
@gouzil gouzil changed the title add simple dynamic shape [SOT] add simple dynamic shape May 14, 2024
@zrr1999 zrr1999 marked this pull request as draft May 21, 2024 15:00
@SigureMo SigureMo self-assigned this May 22, 2024
@zrr1999 zrr1999 changed the title [SOT] add simple dynamic shape [SOT] support dynamic shape May 29, 2024
@zrr1999 zrr1999 marked this pull request as ready for review May 29, 2024 13:47
Comment on lines 183 to 191
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的逻辑是,不访问的话就不是动态 shape 了是么?

Copy link
Member

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,初始化之后不应该再进行修改了

@zrr1999 zrr1999 requested a review from SigureMo May 31, 2024 04:04
@zrr1999 zrr1999 requested a review from SigureMo June 1, 2024 13:18
Comment on lines 725 to 732
# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哎呀忘删了,CI 过了就下个 PR 删吧

@SigureMo SigureMo changed the title [SOT] support dynamic shape [SOT][dynamic shape] support dynamic shape Jun 3, 2024
@SigureMo SigureMo changed the title [SOT][dynamic shape] support dynamic shape [SOT][dynamic shape] Support dynamic Tensor shape Jun 3, 2024
SigureMo
SigureMo previously approved these changes Jun 3, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

SigureMo
SigureMo previously approved these changes Jun 3, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo SigureMo merged commit ec4463d into PaddlePaddle:develop Jun 4, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants