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

转换规则 No. 221-226 #209

Merged
merged 2 commits into from
Aug 3, 2023
Merged

转换规则 No. 221-226 #209

merged 2 commits into from
Aug 3, 2023

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Jul 28, 2023

PR Docs

#112
映射文档 PaddlePaddle/docs#6045
221 torch.distributed.rpc.WorkerInfo
222 torch.distributed.rpc.rpc_sync
223 torch.distributed.rpc.rpc_async
224 torch.distributed.rpc.get_worker_info
225 torch.distributed.rpc.shutdown
226 torch.distributed.rpc.functions.async_execution

调用init_rpc增加 torch.distributed.rpc.init_rpc 在api_mapping.json映射

PR APIs

221 torch.distributed.rpc.WorkerInfo 功能缺失
222 torch.distributed.rpc.rpc_sync  paddle中不支持传入tensor类型参数调用 pickle 序列化,torch中使用tensor参数,修改为不支持
223 torch.distributed.rpc.rpc_async  paddle中不支持传入tensor类型参数调用 pickle 序列化,torch中使用tensor参数,修改为不支持
224 torch.distributed.rpc.get_worker_info
225 torch.distributed.rpc.shutdown
226 torch.distributed.rpc.functions.async_execution 功能缺失

图片

@paddle-bot
Copy link

paddle-bot bot commented Jul 28, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Jul 28, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jul 31, 2023
r = rpc.rpc_async(
"worker1",
torch.add,
args=(torch.tensor(2), torch.tensor(3))
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个args是直接传给torch.add/paddle.add使用的对吧,paddle按道理应该支持args/kwargs中含Tensor,这个有报错截图吗

Copy link
Contributor Author

@co63oc co63oc Aug 1, 2023

Choose a reason for hiding this comment

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

显示cannot pickle 'Tensor' object

图片

代码
`import paddle
import paddle.distributed.rpc as rpc

def add(a, b):
return a + b

rpc.init_rpc("worker0", rank=0, world_size=1,
master_endpoint="127.0.0.1:8003")
fut = rpc.rpc_async("worker0", add, args=(paddle.to_tensor([2]), paddle.to_tensor([3])))
print(fut.wait())
rpc.shutdown()
`

)
result = rpc.rpc_sync(
"worker1",
torch.add,
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个args是直接传给torch.add/paddle.add使用的对吧,paddle按道理应该支持args/kwargs中含Tensor,这个有报错截图吗

Copy link
Contributor Author

@co63oc co63oc Aug 1, 2023

Choose a reason for hiding this comment

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

这个是错误截图

图片

代码
`
import paddle
import paddle.distributed.rpc as rpc

def add(a, b):
return a + b

rpc.init_rpc("worker0", rank=0, world_size=1,
master_endpoint="127.0.0.1:8003")
ret = rpc.rpc_sync("worker0", add, args=(paddle.to_tensor([2]), paddle.to_tensor([3])))
rpc.shutdown()

`

zhwesky2010
zhwesky2010 previously approved these changes Aug 3, 2023
"rpc_backend_options"
],
"kwargs_change": {
"func": "fn"
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个没有func参数,是怎么更名呢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit d5687f3 into PaddlePaddle:master Aug 3, 2023
@co63oc co63oc deleted the api221 branch August 19, 2023 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR status: proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants