-
Notifications
You must be signed in to change notification settings - Fork 53
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
转换规则 No. 221-226 #209
Conversation
Thanks for your contribution! |
r = rpc.rpc_async( | ||
"worker1", | ||
torch.add, | ||
args=(torch.tensor(2), torch.tensor(3)) |
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.
这个args是直接传给torch.add/paddle.add使用的对吧,paddle按道理应该支持args/kwargs中含Tensor,这个有报错截图吗
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.
显示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, |
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.
这个args是直接传给torch.add/paddle.add使用的对吧,paddle按道理应该支持args/kwargs中含Tensor,这个有报错截图吗
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.
paconvert/api_mapping.json
Outdated
"rpc_backend_options" | ||
], | ||
"kwargs_change": { | ||
"func": "fn" |
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.
这个没有func参数,是怎么更名呢
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.
LGTM
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