paddlepaddle / paddledtx Goto Github PK
View Code? Open in Web Editor NEWPaddle with Decentralized Trust based on Xuperchain
License: Apache License 2.0
Paddle with Decentralized Trust based on Xuperchain
License: Apache License 2.0
大家好,非常高兴地告诉大家,第二期 PaddlePaddle Hackathon 开始了。PaddlePaddle Hackathon 是面向全球开发者的深度学习领域编程活动,鼓励开发者了解与参与 PaddlePaddle 开源社区。本次共有四大专区:PaddlePaddle、Paddle Family、Paddle Friends、Paddle Eval,共计100+个任务供大家认领。详细信息可以参考 PaddlePaddle Hackathon 说明。大家是否已经迫不及待了呢~
本 ISSUE 是 Paddle Friends 专区 PaddleDTX 方向任务合集。具体任务列表如下:
序号 | 难度 | 任务 ISSUE |
---|---|---|
96 | ⭐️ | PaddleDTX/dai网络支持Fabric |
97 | ⭐️ | PaddleDTX/xdb支持数据集查询功能 |
98 | ⭐️⭐️ | PaddleDTX支持k8s启动DAI网络 |
99 | ⭐️⭐️ | PaddleDTX/crypto中Paillier算法实现的性能 |
100 | ⭐️⭐️⭐️ | PaddleDTX/xdb支持负载均衡策略 |
若想要认领本次活动任务,请至 PaddlePaddle Hackathon 2 Pinned ISSUE 完成任务 ISSUE 认领。
(此 ISSUE 为 PaddlePaddle Hackathon 第二期活动的任务 ISSUE,更多详见 【PaddlePaddle Hackathon 第二期】任务总览)
【任务说明】
任务标题:PaddleDTX/crypto中Paillier算法实现的性能优化
技术标签:密码算法,Golang
任务难度:中等
详细描述:PaddleDTX当前实现了两类纵向联邦学习算法,均采用Paillier同态进行加密参数传输,在训练的迭代过程中需多次进行同态加解密运算,因此Paiilier算法的性能会大大影响分布式AI的整体性能,
【提交流程】
请将代码提交至 https://github.com/PaddlePaddle/PaddleDTX 开源仓库
【提交内容】
【合入标准】
【技术要求】
熟悉密码学技术
熟练Golang
【参考内容】
【答疑交流】
如果在开发过程中对于上述任务有任何问题,欢迎在 https://github.com/PaddlePaddle/PaddleDTX 上提issue
对于开发中的共性问题,在活动过程中,会定期组织答疑,请大家关注官网&QQ群的通知,及时参与。
xuper和PaddleDTX更新版本后,启动数据存储节点报错 。
2022/01/29 11:11:41 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
2022/01/29 11:11:41 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
t=2022-01-29T11:11:41+0800 lvl=info msg="xchain rpc access request" module=xchain r_call=server.go:1003 r_pid=36569 r_logid=1643425901739830258_286_3387 r_ntce=false rpc_method=/pb.Xchain/PreExec
t=2022-01-29T11:11:41+0800 lvl=info msg=MetaReservedContracts module=xchain reservedContracts=[]
t=2022-01-29T11:11:41+0800 lvl=info msg="xchain rpc service done" module=xchain r_call=server.go:1016 r_pid=36569 r_logid=1643425901739830258_286_3387 r_ntce=true cost_time="total: 0.18ms" rpc_method=/pb.Xchain/PreExec resp_error="Vm not exist in vm manager"
存储在log文件中的内容:
time="2022-01-29T11:11:41+08:00" level=info msg="monitor initialize..." answer-interval=10m0s monitor=challenging request-interval=1h7m0s
time="2022-01-29T11:11:41+08:00" level=info msg="monitor initialize..." fileclear-interval=24h0m0s fileretain-interval=168h0m0s heartbeat-interval=1m0s monitor=nodemaintainer
time="2022-01-29T11:11:41+08:00" level=error msg="failed to read blockchain: {\"code\":\"XDAT0001\",\"message\":\"failed to QueryNativeContract: rpc error: code = Unknown desc = Vm not exist in vm manager\"}"
time="2022-01-29T11:11:41+08:00" level=error msg="app exit" error="failed to read blockchain: {\"code\":\"XDAT0001\",\"message\":\"failed to QueryNativeContract: rpc error: code = Unknown desc = Vm not exist in vm manager\"}"
使用docker方式,启动第二个数据存储节点的时候报错(命令bash network_up.sh start
):
==========> Install paddlempc contract successfully !
==========> Decentralized storage network start ...
Creating storage1.node.com ... done
Creating dataowner2.node.com ... done
Creating dataowner1.node.com ... done
Creating storage2.node.com ...
ERROR: for storage2.node.com UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.
ERROR: for storage2 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).
==========> Decentralized storage network start error ...
后将docker内存从2G升级到4G,报错信息改为:
==========> Install paddlempc contract successfully !
==========> Decentralized storage network start ...
Creating storage1.node.com ... done
Creating dataowner2.node.com ... done
Creating dataowner1.node.com ... done
Creating storage2.node.com ... done
Creating storage3.node.com ... done
==========> Decentralized storage network start error ...
采用单xuperchain,双执行节点,双数据持有节点,双数据存储节点构建的PaddleDTX环境。
采用AIStudio BMLcolab环境,在普通版和高端版(gpu版)下都是一样的情况。
根据手册https://paddledtx.readthedocs.io/zh_CN/latest/quickstart/client.html
执行任务,
不同命令之后任务状态也不同:
发布任务
TaskStatus: Confirming
一个节点确认之后还是
confirming
两个节点确认后成为ready
TaskStatus: Ready
启动任务之后进入Processing
TaskStatus: Processing
但是Processing执行的时间非常长,在大约几十分钟到1个多小时后,Failed失败
在本机docker环境下测试,训练是几分钟就可以完成的。
首先Docker快速案例是可以跑通的。
但是源代码编译安装碰到了问题,在AIStudio的BML环境下:
按照手册源码编译安装,执行到部署 XuperDB 启动数据存储节点这块,
执行命令:
./xdb -c conf/config-storage.toml > storage.log后报错:
ERRO[0000] app exit error="missing log config"
按照手册里修改成如下配置文件
# vim conf/config-dataowner.toml
#
listenAddress = ":8123"
publicAddress = "127.0.0.1:8123"
# genkey创建的私钥, 对账户使用不熟悉的话建议使用默认账户
privateKey = "5572e2fa0c259fe798e5580884359a4a6ac938cfff62d027b90f2bac3eceef79"
[dataOwner.blockchain]
[dataOwner.blockchain.xchain]
# 助记词为用户安装合约过程中创建的区块链账户,取值./ukeys/mnemonic
mnemonic = "充 雄 孔 坝 低 狠 争 短 摸 拜 晨 造"
contractName = "paddlempc"
contractAccount = "XC1234567890123456@xuper"
chainAddress = "127.0.0.1:37101"
chainName = "xuper"
则执行后会报错:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0xa8bb81]
goroutine 1 [running]:
github.com/spf13/viper.(*Viper).AllKeys(0x0)
/home/aistudio/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1824 +0xa1
github.com/spf13/viper.(*Viper).AllSettings(0x0)
/home/aistudio/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1904 +0x45
github.com/spf13/viper.(*Viper).Unmarshal(0xc0005f1cd8, {0x1165a40, 0xc000a4a8e0}, {0x0, 0x0, 0x0})
/home/aistudio/go/pkg/mod/github.com/spf13/[email protected]/viper.go:908 +0x32
github.com/PaddlePaddle/PaddleDTX/xdb/config.InitConfig({0x7fff43948c94, 0x12})
/home/aistudio/PaddleDTX/xdb/config/config.go:87 +0x1aa
main.init.0()
/home/aistudio/PaddleDTX/xdb/main.go:63 +0xbe
因为对go语言报错实在看不懂,所以不知道该怎么查找和纠错。
我的项目已经公开,放在这里:https://aistudio.baidu.com/aistudio/projectdetail/3255074
go version go1.17.5 linux/amd64
GNU Make 4.1
(此 ISSUE 为 PaddlePaddle Hackathon 第二期活动的任务 ISSUE,更多详见 【PaddlePaddle Hackathon 第二期】任务总览)
【任务说明】
任务标题:PaddleDTX支持k8s启动DAI网络
技术标签:区块链,k8s
任务难度:中等
详细描述:PaddleDTX当前提供的网络(包括区块链网络、去中心化存储网络、分布式计算网络)一键启动脚本,是通过docker-compose,该方式只支持在单主机上运行,而实际应用场景中,用户需要跨主机集群部署,保障服务的高可用,因此需要支持K8S方式部署PaddleDTX。
【提交流程】
请将代码提交至 https://github.com/PaddlePaddle/PaddleDTX 开源仓库
【提交内容】
【合入标准】
1、完成功能实现、功能测试;
【技术要求】
熟悉区块链技术
熟悉k8s、docker
【参考内容】
如果在开发过程中对于上述任务有任何问题,欢迎在 https://github.com/PaddlePaddle/PaddleDTX 上提issue
对于开发中的共性问题,在活动过程中,会定期组织答疑,请大家关注官网&QQ群的通知,及时参与。
(此 ISSUE 为 PaddlePaddle Hackathon 第二期活动的任务 ISSUE,更多详见 【PaddlePaddle Hackathon 第二期】任务总览)
【任务说明】
任务标题:PaddleDTX/dai网络支持Fabric
技术标签:区块链,Golang
任务难度:简单
详细描述:PaddleDTX是基于区块链的可信分布式AI,底层区块链目前采用百度自研的XuperChain,为提高系统的灵活易用性,计划后期支持Fabric
【提交流程】
请将代码提交至 https://github.com/PaddlePaddle/PaddleDTX 开源仓库
【提交内容】
设计文档,并提 PR 至 PaddlePaddle/community 的 rfcs/PaddleDTX 目录
Fabric合约实现,包括任务管理和计算节点管理,可参考 PaddleDTX/dai/blockchain/xchain/contract
Fabric合约调用,可参考 PaddleDTX/dai/blockchain/xchain
PaddleDTX/dai/conf添加Fabric相关配置,参考PaddleDTX/xdb/conf
PaddleDTX/dai/executor/engine中支持Fabric配置
PaddleDTX/testdata支持Fabric区块链网络,参考PaddleDTX/xdb/testdata/blockchain
【合入标准】
【技术要求】
熟悉区块链技术
熟练Golang
【参考内容】
【答疑交流】
如果在开发过程中对于上述任务有任何问题,欢迎在 https://github.com/PaddlePaddle/PaddleDTX 上提issue
对于开发中的共性问题,在活动过程中,会定期组织答疑,请大家关注官网&QQ群的通知,及时参与。
(此 ISSUE 为 PaddlePaddle Hackathon 第二期活动的任务 ISSUE,更多详见 【PaddlePaddle Hackathon 第二期】任务总览)
【任务说明】
任务标题:PaddleDTX/xdb支持数据集查询功能
技术标签:区块链,Golang
任务难度:简单
详细描述:PaddleDTX/xdb是基于区块链的去中心化存储系统,目前支持通过数据拥有方的公钥查询网络中的数据列表。但在实际应用中,需求方可能需要查询网络中所有可用的数据,不区分拥有者,因此需要新增查询网络中所有数据列表的功能。
【提交流程】
请将代码提交至 https://github.com/PaddlePaddle/PaddleDTX 开源仓库
【提交内容】
【合入标准】
【技术要求】
【参考内容】
【答疑交流】
如果在开发过程中对于上述任务有任何问题,欢迎在 https://github.com/PaddlePaddle/PaddleDTX 上提issue
对于开发中的共性问题,在活动过程中,会定期组织答疑,请大家关注官网&QQ群的通知,及时参与。
编译区域链合约命令:
!cd ~/PaddleDTX/dai && go build -o paddlempc ./blockchain/xchain/contract
报错:
../../go/pkg/mod/github.com/!paddle!paddle/!paddle!d!t!x/[email protected]/blockchain/xchain/contract/core/challenging.go:25:2: missing go.sum entry for module providing package github.com/xuperchain/xuperchain/core/contractsdk/go/code (imported by github.com/PaddlePaddle/PaddleDTX/dai/blockchain/xchain/contract); to add:
go get github.com/PaddlePaddle/PaddleDTX/dai/blockchain/xchain/contract
blockchain/xchain/contract/main.go:17:2: missing go.sum entry for module providing package github.com/xuperchain/xuperchain/core/contractsdk/go/driver (imported by github.com/PaddlePaddle/PaddleDTX/dai/blockchain/xchain/contract); to add:
go get github.com/PaddlePaddle/PaddleDTX/dai/blockchain/xchain/contract
用了go 16和17两个版本。
不知道为什么go会抽风...
(此 ISSUE 为 PaddlePaddle Hackathon 第二期活动的任务 ISSUE,更多详见 【PaddlePaddle Hackathon 第二期】任务总览)
【任务说明】
任务标题:PaddleDTX/xdb支持负载均衡策略
技术标签:区块链、Golang
任务难度:困难
详细描述:PaddleDTX/xdb在文件分发时随机选择存储节点进行分片存储,没有考虑存储节点当前可用存储资源,可能存在目标存储节点资源不足的情况,也可能导致存储资源很多的节点分配到的分片较少,资源未被充分利用。因此新增负载均衡策略,综合考虑存储节点健康状态和可用存储资源,在文件分发时优先选择健康且资源充足的节点分发文件。
【提交流程】
请将代码提交至 https://github.com/PaddlePaddle/PaddleDTX 开源仓库
【提交内容】
设计负载均衡的文件分发策略,提交方案至 PaddlePaddle/community 的 rfcs/PaddleDTX 目录下,综合考虑存储节点健康状态和可用存储资源
Fabric&xchain合约新增方法,实现存储节点可用资源的记录和更新,可参考 PaddleDTX/xdb/blockchain/xchain/contract
Fabric&xchain合约调用获取存储节点资源,可参考 PaddleDTX/xdb/blockchain/xchain
命令行工具支持更新存储节点存储资源,可参考PaddleDTX/xdb/cmd/client/cmd/nodes
服务端接口支持更新存储节点存储资源,可参考PaddleDTX/xdb/server和PaddleDTX/xdb/engine/handler_node.go
文件分发时根据负载策略选择存储节点,而非随机选择,可参考 PaddleDTX/xdb/engine/copier
【合入标准】
【技术要求】
熟悉区块链技术
熟练Golang
【参考内容】
【答疑交流】
如果在开发过程中对于上述任务有任何问题,欢迎在 https://github.com/PaddlePaddle/PaddleDTX 上提issue
对于开发中的共性问题,在活动过程中,会定期组织答疑,请大家关注官网&QQ群的通知,及时参与。
在AIStudio中,已经启动xuperchina,两个数据管理节点,3个数据存储节点,两个执行节点,已经上传训练文件,在
提交训练任务的时候报错:
命令:
!cd ~/PaddleDTX/localtestdatatmp/executor/node1 && requester-cli task publish -a "linear-vl" -l "MEDV" \
-k 716ae5ad5a374e54cc9a6770faa03213b03fc0fdeccd9319517383e2837cbacd -t "train" -n "房价预测-训练任务v1" -d "用飞桨,划时代" -p "id,id" \
--conf ./conf/config.toml \
-f "6fadfc82-db15-46b7-ad70-3fef902f7b49,2372c2ec-c983-4a33-a0d6-9fb8708b86b8" \
-e '127.0.0.1:8011,127.0.0.1:8012'
报错信息为:
Publish task failed: failed to get executor node by node name: failed to QueryNativeContract: {"code":"XDAT0004","message":"node not found: rpc error: code = Unknown desc = Key not found"}
看着好像获取节点名字就出问题了。
PaddleDTX中的xdb支持跨广域网部署能力吗?有相关的性能测试数据吗?
在启动执行节点的时候报错,在docker里面看到的报错信息为:
executor2.node.com | 2022/02/08 21:21:47 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:21:47 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com | 2022/02/08 21:22:20 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:22:20 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor1.node.com | 2022/02/08 21:21:40 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor1.node.com | 2022/02/08 21:21:40 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor1.node.com | 2022/02/08 21:22:26 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor1.node.com | 2022/02/08 21:22:26 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com exited with code 255
executor2.node.com | 2022/02/08 21:21:47 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:21:47 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com | 2022/02/08 21:22:20 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:22:20 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com | 2022/02/08 21:25:16 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:25:16 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com | 2022/02/08 21:25:33 Config yamlFile get error #open ./conf/sdk.yaml: no such file or directory
executor2.node.com | 2022/02/08 21:25:33 GetConfig: &{10.144.94.18:8848 {false false 10 XBbhR82cB6PvaLJs3D4uB9f12bhmKkHeX TYyA3y8wdFZyzExtcbRNVd7ZZ2XXcfjdw} 100 xchain}
executor2.node.com exited with code 255
docker里面手动启动执行节点也是报错的。
手册位置:https://paddledtx.readthedocs.io/zh_CN/latest/quickstart/client.html
操作XuperDB ,创建命名空间这步:
在AIStudio BML notebook环境中,使用的命令为:
!cd ~/PaddleDTX/xdb/output && ./xdb-cli files addns --host http://127.0.0.1:8122 -k eae7344064e1d5b53af6da1a23407b1e7e265d15eaf0442c476e3caac3003406 -n paddlempc -r 2
报错信息为:
err:{"code":"XDAT0004","message":"from xdb api: request url not found"}
调试的时候百思不得其解,甚至一度怀疑端口监听到ipv6地址了。但是查看前面开服务的时候,已经测试连接,输出状态信息了。
后来仔细看,发现是连通数据持有节点,而8122端口是数据存储节点,原来文档上面写错端口号了。
修改命令端口号到8123,搞定!
!cd ~/PaddleDTX/xdb/output && ./xdb-cli files addns --host http://127.0.0.1:8123 -k eae7344064e1d5b53af6da1a23407b1e7e265d15eaf0442c476e3caac3003406 -n paddlempc -r 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.