【develop】 paddle.base.libpaddle has no attribute 'WorkerInfo'

mefy6pfw  于 5个月前  发布在  其他
关注(0)|答案(3)|浏览(42)

bug描述

paddle.distributed.rpc.get_worker_info 调用报错:paddle.base.libpaddle has no attribute 'WorkerInfo'

import os
import paddle
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
start = 25000
end = 30000
for port in range(start, end):
try:
s.bind(('localhost', port))
s.close()
break
except socket.error:
continue
print('port: ' + str(port))
os.environ['MASTER_ADDR'] = 'localhost'
os.environ['MASTER_PORT'] = str(port)
os.environ['PADDLE_MASTER_ENDPOINT'] = 'localhost:' + str(port)
paddle.distributed.rpc.init_rpc(name='worker1', rank=0, world_size=1)
result = paddle.distributed.rpc.get_worker_info(name='worker1')
paddle.distributed.rpc.shutdown()

上述代码运行后报错

其他补充信息 Additional Supplementary Information

No response

rvpgvaaj

rvpgvaaj1#

你好,请更新Paddle,例如3.0.0b0

pxy2qtax

pxy2qtax2#

@xuxinyi389 这个在代码里可以看到 https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/pybind/rpc.cc#L27
,看代码也没有进行修改,是不是你这边GPU单测运行环境的问题或者换了调用路径?需要再细看下,单测是否能修复

8mmmxcuj

8mmmxcuj3#

@gongel 定位出来的原因是develop中编译选项打开了with_cinn,paddle.is_compiled_with_cinn()的结果为true,而2.6中为false,而
Paddle/CMakeLists.txt

Line 596 in 6a21a78

| | if(WITH_CINN AND WITH_RPC) |
中显示with_cinn与with_rpc选项是冲突的。请问下这是合理的嘛。

相关问题