Skip to content

Conversation

ooooo-create
Copy link
Contributor

PR types

Others

PR changes

Others

Description

修改如下文件的示例代码,使其通过 xdoctest 检查:

  • python/paddle/sparse/multiary.py
  • python/paddle/distributed/auto_parallel/interface.py
  • python/paddle/distributed/auto_parallel/process_mesh.py

预览:

Related links

@sunzhongkai588 @SigureMo @megemini

@paddle-bot
Copy link

paddle-bot bot commented Aug 25, 2023

你的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 contributor External developers status: proposed labels Aug 25, 2023
@ooooo-create
Copy link
Contributor Author

interface.py中第一个会报错,不知道怎么解决
屏幕截图 2023-08-25 155912

@megemini
Copy link
Contributor

interface.py中第一个会报错,不知道怎么解决 !

我理解的是,没有编译 PADDLE_WITH_DISTRIBUTED 环境,导致 dist_attr 为 None:

PyObject* tensor_properties_get_dist_attr(TensorObject* self, void* closure) {
EAGER_TRY
if (self->tensor.is_dist_tensor()) {
#ifdef PADDLE_WITH_DISTRIBUTE
phi::distributed::DistTensor* dist_tensor =
static_cast<phi::distributed::DistTensor*>(self->tensor.impl().get());
return ToPyObject(&dist_tensor->dist_attr());
#else
RETURN_PY_NONE
#endif
} else {
RETURN_PY_NONE
}
EAGER_CATCH_AND_THROW_RETURN_NULL
}

@SigureMo 先把整段测试代码加个 # doctest: +REQUIRES(env:DISTRIBUTED)

@SigureMo
Copy link
Member

@SigureMo 先把整段测试代码加个 # doctest: +REQUIRES(env:DISTRIBUTED) ?

没问题~

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 28, 2023
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 🐾

@luotao1 luotao1 merged commit 51c3c66 into PaddlePaddle:develop Aug 29, 2023
@ooooo-create ooooo-create deleted the ooooo/xdoctest181 branch August 31, 2023 10:18
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
…sparse/multiary.py`,`distributed/auto_parallel/*` (PaddlePaddle#56665)

* [Doctest]fix No.181-183, test=docs_preview

* add env skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants