Skip to content

Test dtype - #62146

Closed
0x45f wants to merge 5 commits into
PaddlePaddle:developfrom
0x45f:test-dtype
Closed

0x45f wants to merge 5 commits into
PaddlePaddle:developfrom
0x45f:test-dtype

Conversation

@0x45f

@0x45f 0x45f commented Feb 27, 2024 •

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

Others

Description

目前框架内有两套dtype的表示,一套是老静态图的VarType,一套是PIR下的DataType。动态图在c++端底层的dtype都是DataType,但是之前应该是为了兼容,所以动态图python的dtype也还是VarType类型。

这个pr主要是想修改python端的paddle.dtype,在PIR下paddle.dtype返回的是DataType类型;在老静态图下返回的是VarType类型。

@paddle-bot

paddle-bot Bot commented Feb 27, 2024

Copy link
Copy Markdown

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

@0x45f 0x45f closed this Mar 5, 2024
from ..base.data_feeder import _NUMPY_DTYPE_2_PADDLE_DTYPE

dtype = VarDesc.VarType
dtype = core.DataType

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

这一部分代码可能需要写成两个函数,一个函数bind vartype,另一个函数bind datatype,根据FLAGS_enable_pir_api来决定初始化时调用哪个函数

@0x45f

0x45f commented Mar 5, 2024

Copy link
Copy Markdown
Collaborator Author

python/paddle/pir_utils.py 的 IrGuard 也需要切换dtype,在__enter__ 时切换为DataType,__exit__时恢复原来的dtype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant