diff --git a/.jenkins/OWNERS b/.jenkins/OWNERS index c5b51a62d074d1b51f72d0e6ad331603ed27b6da..a99f642e13bcf1a36b6d41c65048106cb43ef78c 100644 --- a/.jenkins/OWNERS +++ b/.jenkins/OWNERS @@ -1,4 +1,5 @@ approvers: + - jjfeing # - fengyixing - YeFeng_24 diff --git a/CONTRIBUTING_CN.md b/CONTRIBUTING_CN.md index 77f809719fbe2223b3644ec12cf63001de2a7c4b..aeb5e501aacb66b4bff2c8d660f1c6cb13cd6037 100644 --- a/CONTRIBUTING_CN.md +++ b/CONTRIBUTING_CN.md @@ -49,8 +49,8 @@ 我们使用MarkdownLint来检查Markdown文档格式。MindSpore CI基于默认配置修改了以下规则。 - MD007(无序列表缩进):参数**indent**设置为**4**,表示无序列表中的所有内容都需要缩进4个空格。 - - MD009(行尾空格):参数**br_spaces**设置为**2**,表示行尾可以有0或2个空格。 - - MD029(有序列表的序列号):参数**style**设置为**ordered**,表示升序。 + - MD009(行尾空格):参数**br_spaces**设置为**2**,表示行尾可以有0或2个空格。 + - MD029(有序列表的序列号):参数**style**设置为**ordered**,表示升序。 有关详细信息,请参见[规则](https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md)。 diff --git a/RELEASE.md b/RELEASE.md index 28e5541c644cc3440f91139c9dc679c39c3d0f40..753ae099c8e477ce4751bf0f749fe5b438b1493f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -271,7 +271,7 @@ Contributions of any kind are welcome! Thanks goes to these wonderful people: -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiao Tianci, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, Zhenglong Li, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, wangfengwfwf, zymaa, gerayking. +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiao Tianci, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, Zhenglong Li, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, wangfengwfwf, zymaa, gerayking. Contributions of any kind are welcome! @@ -500,7 +500,7 @@ public boolean eval() {...} Thanks goes to these wonderful people: -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiao Tianci, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, Zhenglong Li, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, wangfengwfwf, zymaa, gerayking. +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiao Tianci, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, Zhenglong Li, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, wangfengwfwf, zymaa, gerayking. Contributions of any kind are welcome! @@ -737,7 +737,7 @@ class Allocator; Thanks goes to these wonderful people: -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa. +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, dong-li001, eric, Eric, fary86, fuzhiye, Gaoxiong, GAO_HYP_XYJ, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Islam Amin, Jesse, , Jiabin Liu, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, Lin Xh, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luopengting, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, Ming_blue, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, qianjiahong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wudenggang, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhanghui_china, zhangxinfeng3, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhiqwang, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa. Contributions of any kind are welcome! @@ -1215,7 +1215,7 @@ The `ops.DepthwiseConv2dNative` is only supported by Ascend, it is recommended t Thanks goes to these wonderful people: -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa Contributions of any kind are welcome! @@ -1319,115 +1319,115 @@ Thanks goes to these wonderful people: zhouyifengCode, huqi, JulyAi, damon0626, chenbo116, rmdyh, davidmc, gray0v0, doitH, Gogery, zymaa, xinyunfan -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenbo116, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, damon0626, danish, Danish, davidmc, dayschan, doitH, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, Gogery, gongdaguo, gray0v0, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huqi, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, JulyAi, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, rmdyh, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xinyunfan, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, zhouyifengCode, Zichun, Zirui, Ziyan, zjun, ZPaC, zymaa Contributions of any kind are welcome! ## MindSpore Lite 1.0.0 Release Notes - Converter - - Add 6 TFLite op, 7 Caffe op, 1 ONNX op. - - Add support for Windows. - - Support parallel inference of multiple sessions to adapt to more scenarios - - Support 8bits only weight-quantization, most main-stream models has small accuracy loss (less than 0.5%) when compared to non-qunantized fp32 model. + - Add 6 TFLite op, 7 Caffe op, 1 ONNX op. + - Add support for Windows. + - Support parallel inference of multiple sessions to adapt to more scenarios + - Support 8bits only weight-quantization, most main-stream models has small accuracy loss (less than 0.5%) when compared to non-qunantized fp32 model. - CPU & GPU - - Add 20 CPU ops,include FP32, int8/uint8, FP16 and int32 ops. - - Add supporting FP16 for GPU, add 14 GPU ops include FP32/FP16. - - Add Buffer/Image2D transform op for GPU - - Performance optimization for CPU ops focus on ARM32. - - Performance optimization for GPU Convolution using winograd. + - Add 20 CPU ops,include FP32, int8/uint8, FP16 and int32 ops. + - Add supporting FP16 for GPU, add 14 GPU ops include FP32/FP16. + - Add Buffer/Image2D transform op for GPU + - Performance optimization for CPU ops focus on ARM32. + - Performance optimization for GPU Convolution using winograd. - Tool & example - - Add object detection Android Demo. + - Add object detection Android Demo. ## Bugfixes - Models - - fix the constant folding problem in multiply.([!6092](https://gitee.com/mindspore/mindspore/pulls/6092)) - - move batch_size from bert_net_cfg to cfg in bert scripts.([!6233](https://gitee.com/mindspore/mindspore/pulls/6233)) - - modify the checkpoint file path.([!6137](https://gitee.com/mindspore/mindspore/pulls/6137)) + - fix the constant folding problem in multiply.([!6092](https://gitee.com/mindspore/mindspore/pulls/6092)) + - move batch_size from bert_net_cfg to cfg in bert scripts.([!6233](https://gitee.com/mindspore/mindspore/pulls/6233)) + - modify the checkpoint file path.([!6137](https://gitee.com/mindspore/mindspore/pulls/6137)) - Python API - - fix semi auto parallel parameter of reshape has another user([!5722](https://gitee.com/mindspore/mindspore/pulls/5722)) - - raise ValueError when call hook function in graph mode([!5831](https://gitee.com/mindspore/mindspore/pulls/5831)) + - fix semi auto parallel parameter of reshape has another user([!5722](https://gitee.com/mindspore/mindspore/pulls/5722)) + - raise ValueError when call hook function in graph mode([!5831](https://gitee.com/mindspore/mindspore/pulls/5831)) - Executor - - fix pynative mode to build temporary nn objects.([!6189](https://gitee.com/mindspore/mindspore/pulls/6189)) - - fix the accuracy problem of multiple inputs of multi-card communication operator broadcast.([!6522](https://gitee.com/mindspore/mindspore/pulls/5622)) - - fix the problem that the sample distribution interface categorical does not support graph mode.([!5772](https://gitee.com/mindspore/mindspore/pulls/5772)) - - fix the random seed failure problem of the polynomial downsampling distribution operator.([!5948](https://gitee.com/mindspore/mindspore/pulls/5948)) - - fix unnecessary address binding issues in GPU heterogeneous scenarios.([!6232](https://gitee.com/mindspore/mindspore/pulls/6232)) + - fix pynative mode to build temporary nn objects.([!6189](https://gitee.com/mindspore/mindspore/pulls/6189)) + - fix the accuracy problem of multiple inputs of multi-card communication operator broadcast.([!6522](https://gitee.com/mindspore/mindspore/pulls/5622)) + - fix the problem that the sample distribution interface categorical does not support graph mode.([!5772](https://gitee.com/mindspore/mindspore/pulls/5772)) + - fix the random seed failure problem of the polynomial downsampling distribution operator.([!5948](https://gitee.com/mindspore/mindspore/pulls/5948)) + - fix unnecessary address binding issues in GPU heterogeneous scenarios.([!6232](https://gitee.com/mindspore/mindspore/pulls/6232)) - GPU platform - - fix for kernel resource leak([!5315](https://gitee.com/mindspore/mindspore/pulls/5315)) - - fix for insufficient memory for continuous unit test running([!5617](https://gitee.com/mindspore/mindspore/pulls/5617)) - - fix for the memory leak in the sparse slicer([!5578](https://gitee.com/mindspore/mindspore/pulls/5578)) + - fix for kernel resource leak([!5315](https://gitee.com/mindspore/mindspore/pulls/5315)) + - fix for insufficient memory for continuous unit test running([!5617](https://gitee.com/mindspore/mindspore/pulls/5617)) + - fix for the memory leak in the sparse slicer([!5578](https://gitee.com/mindspore/mindspore/pulls/5578)) - Data processing - - fix hang when use pyfunc([!6346](https://gitee.com/mindspore/mindspore/pulls/6346)) - - fix GPU device queue does not release GIL during resource clean up([!5964](https://gitee.com/mindspore/mindspore/pulls/5964)) - - fix hang if scripte exit unnormally([!6441](https://gitee.com/mindspore/mindspore/pulls/6441)) + - fix hang when use pyfunc([!6346](https://gitee.com/mindspore/mindspore/pulls/6346)) + - fix GPU device queue does not release GIL during resource clean up([!5964](https://gitee.com/mindspore/mindspore/pulls/5964)) + - fix hang if scripte exit unnormally([!6441](https://gitee.com/mindspore/mindspore/pulls/6441)) - Third party - - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). - - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). + - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). + - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). ## Contributors Thanks goes to these wonderful people: -Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, danish, Danish, dayschan, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, gongdaguo, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, root, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, wangnan39@huawei.com, wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, zhanghaibo5@huawei.com, zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, Zichun, Zirui, Ziyan, zjun, ZPaC +Adel, AGroupofProbiotocs, anthonyaje, anzhengqi, askmiao, baihuawei, baiyangfan, bai-yangfan, bingyaweng, BowenK, buxue, caifubi, CaoJian, caojian05, caozhou, Cathy, changzherui, chenfei, chengxianbin, chenhaozhe, chenjianping, chenzomi, chenzupeng, chujinjin, cj, cjh9368, Corleone, danish, Danish, dayschan, eric, Eric, fary86, fuzhiye, Gaoxiong, gengdongjie, gongdaguo, gukecai, guoqi, gzhcv, hangq, hanhuifeng2020, Harshvardhan, He, heleiwang, hexia, Hoai, HuangBingjian, huangdongrun, huanghui, huangxinjing, huzhifeng, hwjiaorui, Jesse, jianghui58, jiangzhiwen, Jiaqi, jin-xiulang, jinyaohui, jjfeing, John, Jonathan, jonyguo, jzg, kai00, kingfo, kingxian, kpy, kswang, laiyongqiang, leonwanghui, Li, liangchenghui, liangzelang, lichen_101010, lichenever, lihongkang, lilei, limingqi107, ling, linqingke, liubuyu, liuwenhao4, liuxiao78, liuxiao93, liuyang_655, liuzhongkai, Lixia, lixian, liyanliu, liyong, lizhenyu, luoyang, lvchangquan, lvliang, lz, mahdi, Mahdi, maning202007, Margaret_wangrui, mayang, mengyuanli, nhussain, ougongchang, panfengfeng, panyifeng, Payne, Peilin, peixu_ren, Pengyongrong, qianlong, r1chardf1d0, riemann_penn, root, Sheng, shenwei41, simson, Simson, Su, sunsuodong, tao_yunhao, tinazhang, VectorSL, , Wan, wandongdong, wangdongxu, wangmin, , wangyue01, wangzhe, wanyiming, Wei, wenchunjiang, wilfChen, WilliamLian, wsc, wukesong, wuweikang, wuxuejian, Xiaoda, xiefangqi, xuanyue, xulei2020, Xun, xuyongfei, yanghaitao, yanghaitao1, yanghaoran, YangLuo, yangruoqi713, yankai, yanzhenxiang2020, yao_yf, yepei6, yeyunpeng, Yi, yoni, yoonlee666, yuchaojie, yujianfeng, yuximiao, zengzitao, Zhang, , zhanghuiyao, zhangyihui, zhangz0911gm, zhanke, zhanyuan, zhaodezan, zhaojichen, zhaoting, zhaozhenlong, zhengjun10, zhoufeng, zhousiyi, zhouyaqiang, Zichun, Zirui, Ziyan, zjun, ZPaC Contributions of any kind are welcome! ## MindSpore Lite 0.7.0-beta Release Notes - Converter - - Support third-party models, including TFLite/Caffe/ONNX. - - Add 93 TFLite op. - - Add 24 Caffe op. - - Add 62 ONNX op. - - Add 11 optimized passes, include fusion/const fold. - - Support aware-training and Post-training quantization. + - Support third-party models, including TFLite/Caffe/ONNX. + - Add 93 TFLite op. + - Add 24 Caffe op. + - Add 62 ONNX op. + - Add 11 optimized passes, include fusion/const fold. + - Support aware-training and Post-training quantization. - CPU - - Add 100+ops,support fp32, int8/uint8, FP16 ops - - Support fast convolution algorithms: Sliding Window, Img2col + Gemm, Strassen, Winograd - - Support assembly/neon instruction. - - Support CPU fp16 and sdot on ARM v8.2+. + - Add 100+ops,support fp32, int8/uint8, FP16 ops + - Support fast convolution algorithms: Sliding Window, Img2col + Gemm, Strassen, Winograd + - Support assembly/neon instruction. + - Support CPU fp16 and sdot on ARM v8.2+. - GPU - - Add 20+ ops for OpenCL. - - Support image2D/buffer format. - - Optimize online initialization time. - - add optimized convolution1X1/3X3/depthwise/convolution_transposed for OpenCL. + - Add 20+ ops for OpenCL. + - Support image2D/buffer format. + - Optimize online initialization time. + - add optimized convolution1X1/3X3/depthwise/convolution_transposed for OpenCL. - Tool & example - - Add benchmark and TimeProfile tools. - - Add image classification Android Demo. + - Add benchmark and TimeProfile tools. + - Add image classification Android Demo. ## Bugfixes - Models - - normalize the readme file([!5410](https://gitee.com/mindspore/mindspore/pulls/5410)) - - fix a sink_size bug for transformer([!5393](https://gitee.com/mindspore/mindspore/pulls/5393)) - - fix bool type optional for resnet50([!5363](https://gitee.com/mindspore/mindspore/pulls/5363)) + - normalize the readme file([!5410](https://gitee.com/mindspore/mindspore/pulls/5410)) + - fix a sink_size bug for transformer([!5393](https://gitee.com/mindspore/mindspore/pulls/5393)) + - fix bool type optional for resnet50([!5363](https://gitee.com/mindspore/mindspore/pulls/5363)) - Python API - - improve interface '__bool__' for tensor([!4000](https://gitee.com/mindspore/mindspore/pulls/4000)) - - fix GPU-ResizeNearestNeighbor([!3760](https://gitee.com/mindspore/mindspore/pulls/3760)) - - fix topK multi dimension grad func([!3711](https://gitee.com/mindspore/mindspore/pulls/3711)) - - fix scatterop error msg([!3699](https://gitee.com/mindspore/mindspore/pulls/3699)) - - fix bug of cast dtype when using mix_presion in pynative mode([!3730](https://gitee.com/mindspore/mindspore/pulls/3730)) + - improve interface '__bool__' for tensor([!4000](https://gitee.com/mindspore/mindspore/pulls/4000)) + - fix GPU-ResizeNearestNeighbor([!3760](https://gitee.com/mindspore/mindspore/pulls/3760)) + - fix topK multi dimension grad func([!3711](https://gitee.com/mindspore/mindspore/pulls/3711)) + - fix scatterop error msg([!3699](https://gitee.com/mindspore/mindspore/pulls/3699)) + - fix bug of cast dtype when using mix_presion in pynative mode([!3730](https://gitee.com/mindspore/mindspore/pulls/3730)) - Executor - - fix etsnet train error when UnsegmentSum's first input shape is (1,) ([!4573](https://gitee.com/mindspore/mindspore/pulls/4573)) - - fix bug of result error in while control flow because of unsupporting for value reference ([!4103](https://gitee.com/mindspore/mindspore/pulls/4103)) - - fix bug of the output tensor does not carry device data type ([!3774](https://gitee.com/mindspore/mindspore/pulls/3774)) - - fix bug of avoiding multi attr value are eliminated in pynative mode ([!4225](https://gitee.com/mindspore/mindspore/pulls/4225)) - - fix bug of AssignAdd unable to work normally in multi-cases ([!5171](https://gitee.com/mindspore/mindspore/pulls/5171)) + - fix etsnet train error when UnsegmentSum's first input shape is (1,) ([!4573](https://gitee.com/mindspore/mindspore/pulls/4573)) + - fix bug of result error in while control flow because of unsupporting for value reference ([!4103](https://gitee.com/mindspore/mindspore/pulls/4103)) + - fix bug of the output tensor does not carry device data type ([!3774](https://gitee.com/mindspore/mindspore/pulls/3774)) + - fix bug of avoiding multi attr value are eliminated in pynative mode ([!4225](https://gitee.com/mindspore/mindspore/pulls/4225)) + - fix bug of AssignAdd unable to work normally in multi-cases ([!5171](https://gitee.com/mindspore/mindspore/pulls/5171)) - GPU platform - - improve the environment variable checking for nvcc compiler path ([!5140](https://gitee.com/mindspore/mindspore/pulls/5140)) - - fix bug of error in cast operator conversion from fp16 to fp32 ([!4147](https://gitee.com/mindspore/mindspore/pulls/4147)) - - fix bug of the array out of bound in case of make_tuple operator ([!5219](https://gitee.com/mindspore/mindspore/pulls/5219)) + - improve the environment variable checking for nvcc compiler path ([!5140](https://gitee.com/mindspore/mindspore/pulls/5140)) + - fix bug of error in cast operator conversion from fp16 to fp32 ([!4147](https://gitee.com/mindspore/mindspore/pulls/4147)) + - fix bug of the array out of bound in case of make_tuple operator ([!5219](https://gitee.com/mindspore/mindspore/pulls/5219)) - Data processing and Pro - - fix GeneratorDataset time out([!3624](https://gitee.com/mindspore/mindspore/pulls/3624)) - - fix concat operator get_dataset_size error([!4701](https://gitee.com/mindspore/mindspore/pulls/4701)) - - fixing python validator for Repeat Op([!4366](https://gitee.com/mindspore/mindspore/pulls/4366)) + - fix GeneratorDataset time out([!3624](https://gitee.com/mindspore/mindspore/pulls/3624)) + - fix concat operator get_dataset_size error([!4701](https://gitee.com/mindspore/mindspore/pulls/4701)) + - fixing python validator for Repeat Op([!4366](https://gitee.com/mindspore/mindspore/pulls/4366)) - Third party - - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). - - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). + - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). + - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). ## Contributors @@ -1444,69 +1444,69 @@ Contributions of any kind are welcome! ### Ascend Training and Inference Framework - New models - - There are official, research and community under modelzoo. - - Official is maintained with the newest APIs by MindSpore team, MaskRCNN are added. - - Research is uploaded by researchers for official review, and APIs may not be updated in time. - - Community reprints the relevant links of partner research results. - - Hub added on the same level as modelzoo, synchronous storage of materials needed for official hub web pages which will be launched soon. - - Support pre-trained models, few lines of code can be used to download and load pre-trained models, supporting inference or transfer learning. + - There are official, research and community under modelzoo. + - Official is maintained with the newest APIs by MindSpore team, MaskRCNN are added. + - Research is uploaded by researchers for official review, and APIs may not be updated in time. + - Community reprints the relevant links of partner research results. + - Hub added on the same level as modelzoo, synchronous storage of materials needed for official hub web pages which will be launched soon. + - Support pre-trained models, few lines of code can be used to download and load pre-trained models, supporting inference or transfer learning. - Frontend and user interface - - Supports user side operator compilation and graph execution error rendering. - - Uniform definition dynamic learning rate behavior in optimizers. - - Support IndexSlice in sparse expression. - - Support use parent construct method during construct. - - Support asynchronous execution save checkpoint file. - - Support implicit type conversion in pynative mode. - - User interfaces change log - - unform learning rate behavior in optimizers([!2755](https://gitee.com/mindspore/mindspore/pulls/2755)) - - rename operator of sparse optimizer([!3217](https://gitee.com/mindspore/mindspore/pulls/3217)) - - move profiler module from mindinsight to mindspore([!3075](https://gitee.com/mindspore/mindspore/pulls/3075)) - - VOCDataset output change to multi-columns([!3093](https://gitee.com/mindspore/mindspore/pulls/3093)) - - GetDatasize feature([!3212](https://gitee.com/mindspore/mindspore/pulls/3212)) - - dataset: modify config api([!2936](https://gitee.com/mindspore/mindspore/pulls/2936)) + - Supports user side operator compilation and graph execution error rendering. + - Uniform definition dynamic learning rate behavior in optimizers. + - Support IndexSlice in sparse expression. + - Support use parent construct method during construct. + - Support asynchronous execution save checkpoint file. + - Support implicit type conversion in pynative mode. + - User interfaces change log + - unform learning rate behavior in optimizers([!2755](https://gitee.com/mindspore/mindspore/pulls/2755)) + - rename operator of sparse optimizer([!3217](https://gitee.com/mindspore/mindspore/pulls/3217)) + - move profiler module from mindinsight to mindspore([!3075](https://gitee.com/mindspore/mindspore/pulls/3075)) + - VOCDataset output change to multi-columns([!3093](https://gitee.com/mindspore/mindspore/pulls/3093)) + - GetDatasize feature([!3212](https://gitee.com/mindspore/mindspore/pulls/3212)) + - dataset: modify config api([!2936](https://gitee.com/mindspore/mindspore/pulls/2936)) - Executor and performance optimization - - Decouple C++ and python, so make the architecture more extensible. - - Parameter Server for distributed deep learning supported. - - Serving: a flexible service deployment framework for deep learning models. - - Memory reuse is enhanced, and the batch size of Bert large model is increased from 96 to 160 on a single server. + - Decouple C++ and python, so make the architecture more extensible. + - Parameter Server for distributed deep learning supported. + - Serving: a flexible service deployment framework for deep learning models. + - Memory reuse is enhanced, and the batch size of Bert large model is increased from 96 to 160 on a single server. - Data processing, augmentation, and save format - - Support MindRecord save operator after date processing - - Support automatic fusion operator, such as decode/resize/crop - - Support CSV dataset loading + - Support MindRecord save operator after date processing + - Support automatic fusion operator, such as decode/resize/crop + - Support CSV dataset loading ### Other Hardware Support - GPU platform - - New model supported: ResNext50, WarpCTC and GoogLeNet. - - Support hyperparametric search and data enhanced automl on GPU. - - Support Resnet50 automatic parallel in GPU backend. + - New model supported: ResNext50, WarpCTC and GoogLeNet. + - Support hyperparametric search and data enhanced automl on GPU. + - Support Resnet50 automatic parallel in GPU backend. ## Bugfixes - Models - - Improved the performance and accuracy on ResNet50([!3456](https://gitee.com/mindspore/mindspore/pulls/3456)) - - Fixed the performance test case of bert([!3486](https://gitee.com/mindspore/mindspore/pulls/3486)) + - Improved the performance and accuracy on ResNet50([!3456](https://gitee.com/mindspore/mindspore/pulls/3456)) + - Fixed the performance test case of bert([!3486](https://gitee.com/mindspore/mindspore/pulls/3486)) - Python API - - Fix assign used in while loop([!2720](https://gitee.com/mindspore/mindspore/pulls/2720)) - - Revert optimize the graph output of all nop node.([!2857](https://gitee.com/mindspore/mindspore/pulls/2857)) - - Print tensor as numpy.([!2859](https://gitee.com/mindspore/mindspore/pulls/2859)) - - Support weight decay for sparse optimizer([!2668](https://gitee.com/mindspore/mindspore/pulls/2668)) - - Fix BatchToSpaceND([!2741](https://gitee.com/mindspore/mindspore/pulls/2741)) - - Fixing type check mistakes of InplaceAdd and Inplace Sub ops([!2744](https://gitee.com/mindspore/mindspore/pulls/2744])) - - Change order param only equal to group param([!2748](https://gitee.com/mindspore/mindspore/pulls/2748)) + - Fix assign used in while loop([!2720](https://gitee.com/mindspore/mindspore/pulls/2720)) + - Revert optimize the graph output of all nop node.([!2857](https://gitee.com/mindspore/mindspore/pulls/2857)) + - Print tensor as numpy.([!2859](https://gitee.com/mindspore/mindspore/pulls/2859)) + - Support weight decay for sparse optimizer([!2668](https://gitee.com/mindspore/mindspore/pulls/2668)) + - Fix BatchToSpaceND([!2741](https://gitee.com/mindspore/mindspore/pulls/2741)) + - Fixing type check mistakes of InplaceAdd and Inplace Sub ops([!2744](https://gitee.com/mindspore/mindspore/pulls/2744])) + - Change order param only equal to group param([!2748](https://gitee.com/mindspore/mindspore/pulls/2748)) - Executor - - The performance of graph with control flow is optimized([!2931](https://gitee.com/mindspore/mindspore/pulls/2931)) - - Fix bug of wrong number of tuple layers([!3390](https://gitee.com/mindspore/mindspore/pulls/3390)) - - Fix cpu multi graph memory exception([!3631](https://gitee.com/mindspore/mindspore/pulls/3631)) - - Enable data sync when calling operator without defining a cell([!3081](https://gitee.com/mindspore/mindspore/pulls/3081)) - - Fix argmaxwith value error in pynative mode on GPU([!3082](https://gitee.com/mindspore/mindspore/pulls/3082)) - - Fix precision error with fp16 input on pynative mode([!3196](https://gitee.com/mindspore/mindspore/pulls/3196)) + - The performance of graph with control flow is optimized([!2931](https://gitee.com/mindspore/mindspore/pulls/2931)) + - Fix bug of wrong number of tuple layers([!3390](https://gitee.com/mindspore/mindspore/pulls/3390)) + - Fix cpu multi graph memory exception([!3631](https://gitee.com/mindspore/mindspore/pulls/3631)) + - Enable data sync when calling operator without defining a cell([!3081](https://gitee.com/mindspore/mindspore/pulls/3081)) + - Fix argmaxwith value error in pynative mode on GPU([!3082](https://gitee.com/mindspore/mindspore/pulls/3082)) + - Fix precision error with fp16 input on pynative mode([!3196](https://gitee.com/mindspore/mindspore/pulls/3196)) - Data processing - - Fix bug of RandomColor and RandomSharpness default parameter checking ([!2833](https://gitee.com/mindspore/mindspore/pulls/2833)) - - Fix process hung when training and eval ([!3469](https://gitee.com/mindspore/mindspore/pulls/3469)) + - Fix bug of RandomColor and RandomSharpness default parameter checking ([!2833](https://gitee.com/mindspore/mindspore/pulls/2833)) + - Fix process hung when training and eval ([!3469](https://gitee.com/mindspore/mindspore/pulls/3469)) - Third party - - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). - - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). + - Sqlite : Update sqlite to 3.32.2 to handle [CVE-2020-11656](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656), [CVE-2020-13871](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871), [CVE-2020-11655](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655), [CVE-2020-9327](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327), [CVE-2020-13630](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630), [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358), [CVE-2020-13631](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631), [CVE-2020-13632](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13632), [CVE-2020-13434](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434), [CVE-2020-13435](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435), and [CVE-2020-15358](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655). + - Libjpeg-turbo : Update libjpeg-turbo to 2.0.4 to handle [CVE-2020-13790](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13790). ## Contributors diff --git a/Third_Party_Open_Source_Software_Notice b/Third_Party_Open_Source_Software_Notice index f6961f1a03729df792e6a84c580424ae926e72ce..576ecdb39b91ecb578de9c63557baecebb877675 100644 --- a/Third_Party_Open_Source_Software_Notice +++ b/Third_Party_Open_Source_Software_Notice @@ -1,14 +1,14 @@ OPEN SOURCE SOFTWARE NOTICE -Please note we provide an open source software notice along with this product and/or this product firmware (in the following just “this product”). The open source software licenses are granted by the respective right holders. And the open source licenses prevail all other license information with regard to the respective open source software contained in the product, including but not limited to End User Software Licensing Agreement. This notice is provided on behalf of Huawei Technologies Co. Ltd. and any of its local subsidiaries which may have provided this product to you in your local country. +Please note we provide an open source software notice along with this product and/or this product firmware (in the following just “this product”). The open source software licenses are granted by the respective right holders. And the open source licenses prevail all other license information with regard to the respective open source software contained in the product, including but not limited to End User Software Licensing Agreement. This notice is provided on behalf of Huawei Technologies Co. Ltd. and any of its local subsidiaries which may have provided this product to you in your local country. -Warranty Disclaimer +Warranty Disclaimer THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS. -Copyright Notice and License Texts +Copyright Notice and License Texts Software: asttokens 2.0.4 -Copyright notice: +Copyright notice: copyright = u'2016, Grist Labs' Copyright 2016 Grist Labs, Inc. @@ -225,7 +225,6 @@ Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. @@ -385,7 +384,7 @@ permanent authorization for you to choose that version for the Library. Software: Eigen 3.4.0 -Copyright notice: +Copyright notice: Copyright (C) 2014 Benoit Steiner Copyright (C) 2013 Christian Seiler Copyright (C) 2015 Eugene Brevdo @@ -443,7 +442,7 @@ Copyright (C) 2016 Konstantinos Margaritis Copyright (C) 2007 Julien Pommier Copyright (C) 2008-2011 Gael Guennebaud Copyright (C) 2009 Keir Mierle -Copyright (C) 2011 Timothy E. Holy +Copyright (C) 2011 Timothy E. Holy < > Copyright (C) 2009 Hauke Heibel Copyright (C) 2012 Desire Nuentsa Copyright (C) 2014 Gael Guennebaud @@ -465,8 +464,8 @@ Copyright (c) 2009 Boudewijn Rempt Copyright 2013 Florent Pruvost Copyright (c) 2010 Jitse Niesen, Copyright (C) 2009 Benjamin Schindler -Copyright (C) 2016 Pedro Gonnet (pedro.gonnet@gmail.com) -Copyright (C) 2016 Benoit Steiner (benoit.steiner.goog@gmail.com) +Copyright (C) 2016 Pedro Gonnet () +Copyright (C) 2016 Benoit Steiner () Copyright (C) 2009 Thomas Capricelli Copyright (C) 2012-2013 Desire Nuentsa Copyright (C) 2012-2014 Gael Guennebaud @@ -504,9 +503,9 @@ Copyright (C) 2015 Mehdi Goli Codeplay Software Ltd. Ralph Potter Codeplay Software Ltd. Luke Iwanski Codeplay Software Ltd. -Copyright (C) 2014 Navdeep Jaitly +Copyright (C) 2014 Navdeep Jaitly < and Benoit Steiner Copyright (C) 2011 Gael Guennebaud -Copyright (C) 2012 desire Nuentsa Copyright (C) 2008 Gael Guennebaud Copyright (C) 2012 Kolja Brix Copyright (C) 2011 Kolja Brix @@ -541,14 +540,14 @@ Copyright (C) 2008-2009 Guillaume Saupin Copyright (C) 2009 Guillaume Saupin Copyright (C) 2010-2016 Konstantinos Margaritis Copyright (C) 2008-2016 Konstantinos Margaritis -Copyright (C) 2014 Benoit Steiner (benoit.steiner.goog@gmail.com) -Copyright (C) 2014 Pedro Gonnet (pedro.gonnet@gmail.com) +Copyright (C) 2014 Benoit Steiner () +Copyright (C) 2014 Pedro Gonnet () Copyright (c) Fabian Giesen, 2016 Copyright (C) 2010 Konstantinos Margaritis Copyright (C) 2007 Michael Olbrich Copyright (C) 2011 Benoit Jacob Copyright (C) 2011-2012 Jitse Niesen -Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google.com) +Copyright (C) 2016 Rasmus Munk Larsen () Copyright (C) 2008-2014 Gael Guennebaud Copyright (C) 2010-2013 Hauke Heibel Copyright (C) 2006-2008, 2010 Benoit Jacob @@ -589,7 +588,7 @@ Copyright (C) EDF R&D, lun sep 30 14:23:15 CEST 2002 Copyright (C) 2002-2007 Yves Renard Copyright (C) 2012, 2014 Kolja Brix Copyright (C) 1997-2001 Andrew Lumsdaine Lie-Quan Lee -Copyright (C) 2012 Desire NUENTSA WAKAM Copyright (C) 2015-2016 Gael Guennebaud Copyright (C) 2013 Hauke Heibel Copyright (C) 2010-2011 Jitse Niesen @@ -602,11 +601,11 @@ Copyright (C) 2011-2015 Gael Guennebaud Copyright (C) 20015 Gael Guennebaud Copyright (C) 2014-2015 Gael Guennebaud - License: Mozilla Public License (MPL) V2.0 Mozilla Public License Version 2.0 + 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. @@ -698,15 +697,14 @@ If you create software not governed by this License, and you want to create a ne 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice -This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at . If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. - Software: JSON for Modern C++ 3.10.1 -Copyright notice: +Copyright notice: Copyright 2015 Google Inc. All rights reserved. Copyright 2018 Google Inc. All rights reserved. Copyright 2016 Ismael Jimenez Martinez. All rights reserved. @@ -744,7 +742,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - Software: oneDNN 2.2 Copyright (c) 2011, Intel Corporation All rights reserved. Copyright 2015, Google Inc. @@ -761,7 +758,7 @@ Copyright 2008 Google Inc. Copyright 2005-2014 Daniel James. Copyright 2020 Intel Corporation Copyright 2020 Arm Limited and affiliates. -Copyright (c) 2007, Apostolos Syropoulos (), with Reserved Font Name Asana Math. Copyright (c) 2009-2018 The MathJax Consortium Copyright (c) 2007 MITSUNARI Shigeo All rights reserved. Copyright 2019-2020 Intel Corporation @@ -979,6 +976,7 @@ Copyright 2005, Google Inc. XByak (src/cpu/xbyak/) ---------------------- + Copyright (c) 2007 MITSUNARI Shigeo All rights reserved. @@ -1004,8 +1002,9 @@ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. +THE POSSIBILITY OF SUCH DAMAGE ----------------------------------------------------------------------------- + ソースコード形式かバイナリ形式か、変更するかしないかを問わず、以下の条件を満た す場合に限り、再頒布および使用が許可されます。 @@ -1028,6 +1027,7 @@ THE POSSIBILITY OF SUCH DAMAGE. gtest (tests/gtests/gtest/) --------------------------- + Copyright 2005, Google Inc. Copyright 2006, Google Inc. Copyright 2007, Google Inc. @@ -1039,13 +1039,13 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its +* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -1063,6 +1063,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ittnotify (src/cpu/jit_utils/jitprofiling/) ------------------------------------------- + Copyright (c) 2011, Intel Corporation All rights reserved. @@ -1093,6 +1094,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. CMake (cmake/FindOpenCL.cmake) ------------------------------ + CMake - Cross Platform Makefile Generator Copyright 2000-2019 Kitware, Inc. and Contributors All rights reserved. @@ -1129,15 +1131,16 @@ Apache License, Version 2.0 MathJax (doc/assets/mathjax/) ----------------------------- + Copyright (c) 2009-2018 The MathJax Consortium Copyright (c) 2015-2017 Martin Hensel -Copyright (c) 2007, Apostolos Syropoulos (), Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -1150,6 +1153,7 @@ Boost Software License, Version 1.0 Boost C++ Libraries (src/common/primitive_hashing.hpp) ------------------------------------------------------ + Copyright 2005-2014 Daniel James. Distributed under the Boost Software License, Version 1.0. @@ -1191,18 +1195,19 @@ Copyright (c) 2004, 2011-2012 Intel Corporation. All rights reserved. Copyright (c) 2005, 2006, 2007 Cisco Systems, Inc. All rights reserved. Copyright (c) 2005 PathScale, Inc. All rights reserved. -License: BSD 3-Clause License +License: BSD 3-Clause License Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of NVIDIA CORPORATION, Lawrence Berkeley National +* Neither the name of NVIDIA CORPORATION, Lawrence Berkeley National Laboratory, the U.S. Department of Energy, nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -2235,7 +2240,7 @@ Copyright 2015 The RE2 Authors. All Rights Reserved. Copyright 2016 The RE2 Authors. All Rights Reserved. Copyright 2018 The RE2 Authors. All Rights Reserved. -License: BSD-3 with additional clause +License: BSD-3 with additional clause Most files in this release are marked with the copyrights of the organizations who have edited them. The copyrights below are in no particular order and generally reflect members of the Open MPI core @@ -2304,15 +2309,15 @@ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer listed in this license in the documentation and/or other materials provided with the distribution. -- Neither the name of the copyright holders nor the names of its +* Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -2336,7 +2341,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Software: pip 20.0.2 -Copyright notice: +Copyright notice: Copyright (c) 2010 ActiveState Software Inc. Copyright (c) 1991-2014 Unicode, Inc. All rights reserved. Copyright (C) 2013 Vinay Sajip. @@ -2384,7 +2389,7 @@ Copyright (c) 2003-2019 Paul T. McGuire Copyright (c) 2012 Giorgos Verigakis Copyright (C) 2012-2017 The Python Software Foundation. -License: +License: Copyright (c) 2008-2019 The pip developers (see AUTHORS.txt file) Permission is hereby granted, free of charge, to any person obtaining @@ -2407,7 +2412,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Software: pytest 1.6.0 -Copyright notice: +Copyright notice: copyright = "2015–2020, holger krekel and pytest-dev team" If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. Copyright (c) 2010 by Armin Ronacher. @@ -2438,7 +2443,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Software: Scipy 1.5.4 -Copyright notice: +Copyright notice: Jamfile.v2: Copyright Daryle Walker, Hubert Holin, John Maddock 2006 - 2007 Copyright 2002 Gary Strangman. All rights reserved testpareto.cpp: Copyright John Maddock 2006. @@ -2547,7 +2552,7 @@ compiletest/complasinincltest.cpp: Copyright John Maddock 2006. testncf.cpp: Copyright John Maddock 2008. ellintpi3largedata.ipp: Copyright (c) 2006 John Maddock betasmalldata.ipp: (C) Copyright John Maddock 2006. -Copyright J.S. Roy (js@jeannot.org), 2002-2005 See the LICENSE file for copyright information. +Copyright J.S. Roy (), 2002-2005 See the LICENSE file for copyright information. compiletest/sfsinpiincltest.cpp: Copyright John Maddock 2006. testinstances/floattestinstances7.cpp: Copyright John Maddock 2011. testellint1.cpp: Copyright Paul A. Bristow 2007 @@ -2563,7 +2568,7 @@ Copyright (C) 2009 Pauli Virtanen Distributed under the same license as Scipy. almostequal.ipp: Copyright (c) 2006 Johan Rade testinstances/floattestinstances3.cpp: Copyright John Maddock 2011. testrationalinstances/testrationalrealconcept3.cpp: (C) Copyright John Maddock 2006-7. -Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2004-2005, Jean-Sebastien Roy () tgammadeltaratioint.ipp: (C) Copyright John Maddock 2006-7. testround.cpp: (C) Copyright John Maddock 2007. igammainvadata.ipp: (C) Copyright John Maddock 2006-7. @@ -2661,7 +2666,7 @@ binomialdata.ipp: (C) Copyright John Maddock 2006-7. erfsmalldata.ipp: (C) Copyright John Maddock 2006. testigammainva.hpp: Copyright Paul A. Bristow 2007, 2009 compiletest/sfdigammaincltest.cpp: Copyright John Maddock 2006. -Copyright (c) 2002 Travis Oliphant all rights reserved oliphant.travis@ieee.org Permission to use, modify, and distribute this software is given under the terms of the SciPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. +Copyright (c) 2002 Travis Oliphant all rights reserved Permission to use, modify, and distribute this software is given under the terms of the SciPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. compiletest/toolsstatsinctest.cpp: Copyright John Maddock 2006. testgeometric.cpp: Copyright Paul A. Bristow 2010. compiletest/sfzetaincltest.cpp: Copyright John Maddock 2007. @@ -2903,7 +2908,7 @@ compiletest/sfellintrfincltest.cpp: Copyright John Maddock 2006. testellint3.hpp: Copyright John Maddock 2006. testinversegaussian.cpp: Copyright John Maddock 2010. acoshdata.ipp: Copyright John Maddock 2008. -Copyright (c) 2002 Travis Oliphant all rights reserved Oliphant.Travis@altavista.net Permission to use, modify, and distribute this software is given under the terms of the SciPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. +Copyright (c) 2002 Travis Oliphant all rights reserved Permission to use, modify, and distribute this software is given under the terms of the SciPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. testjacobi.hpp: Copyright John Maddock 2006. Copyright (C) 2019 Peter Bell testbesselk.cpp: Copyright Paul A. Bristow 2007 @@ -2946,7 +2951,7 @@ testrationalinstances/testrationaldouble3.cpp: (C) Copyright John Maddock 2006- testellint2.cpp: Copyright Xiaogang Zhang 2006 testrationalinstances/testrationalfloat1.cpp: (C) Copyright John Maddock 2006-7. compiletest/complacoshincltest.cpp: Copyright John Maddock 2006. -Copyright (c) 2002-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2002-2005, Jean-Sebastien Roy () testrealconceptnegbin.cpp: Copyright Paul A. Bristow 2010. Copyright 1984, 1987, 1992, 2000 by Stephen L. Moshier testcbrt.hpp: Copyright John Maddock 2006. @@ -3009,7 +3014,7 @@ commonfactortest.cpp: (C) Copyright Daryle Walker 2001, 2006. ellintpi2data.ipp: Copyright (c) 2006 John Maddock Copyright (c) 1992-2015 The University of Tennessee and The University of Tennessee Research Foundation. All rights reserved. -License: +License: Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers. All rights reserved. @@ -3041,7 +3046,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Software: onnx 1.6.0 -Copyright notice: +Copyright notice: Copyright (c) ONNX Project Contributors. Copyright (c) Facebook Inc. and Microsoft Corporation. @@ -3049,7 +3054,7 @@ License: MIT License Please see above. Software: onnxruntime 1.6.0 -Copyright notice: +Copyright notice: Copyright (c) ONNX Project Contributors. Copyright (c) Facebook Inc. and Microsoft Corporation. @@ -3057,7 +3062,7 @@ License: MIT License Please see above. Software: flatbuffers 2.0.0 -Copyright notice: +Copyright notice: Copyright (c) 2015 Google, Inc. Copyright 2014 Google Inc. All rights reserved. Copyright 2015 Google Inc. All rights reserved. @@ -3068,7 +3073,7 @@ Copyright (c) 2013 Google, Inc. Copyright (c) 2014 Google, Inc. Copyright 2012, the Dart project authors. All rights reserved. Copyright 2018 Google Inc. All rights reserved. -Copyright 2014 Stefan.Eilemann@epfl.ch +Copyright 2014 Copyright 2016 Google Inc. All rights reserved. Copyright 2015 The Chromium Authors. All rights reserved. Copyright 2015, Google Inc. @@ -3076,12 +3081,12 @@ Copyright 2015 Google Inc. Copyright 2018 Dan Field. All rights reserved. Copyright 2018 Dan Field - License: Apache License V2.0 Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. @@ -3241,7 +3246,7 @@ Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -3249,7 +3254,7 @@ See the License for the specific language governing permissions and limitations under the License. Software: googletest 1.8.1 -Copyright notice: +Copyright notice: Copyright 2009, Google Inc. Copyright 2008, Google Inc. Copyright 2007 Google Inc. @@ -3281,7 +3286,6 @@ Copyright 2009 Google Inc. All rights reserved. Copyright 2018 Google LLC. All rights reserved. Copyright 2018, Google LLC. - License: BSD 3-Clause License Please see above. @@ -3300,7 +3304,6 @@ Copyright (c) 2005 - 2007, Google Inc. Copyright (c) 2004, Google Inc. Copyright (c) 2003-2008, Jouni Malinen and contributors - License: BSD 3-Clause License Please see above. @@ -3441,7 +3444,7 @@ Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing external contributions to this project including patches, pull requests, etc. Software: incubator-tvm 0.6 -Copyright notice: +Copyright notice: Copyright (c) 2019 by Contributors COPYRIGHT (C) 2017 Institute of Electronics and Computer Science (EDI), Latvia. Copyright (c) 2018 by Contributors @@ -3653,7 +3656,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -3673,41 +3676,36 @@ Apache Software Foundation License 2.0 3rdparty/dlpack 3rdparty/dmlc-core - BSD 2-clause License -------------------- 3rdparty/picojson 3rdparty/dmlc-core/include/dmlc/concurrentqueue.h - BSD 2-clause License + zlib License ----------------------------------- 3rdparty/dmlc-core/include/dmlc/blockingconcurrentqueue.h - MIT License ----------- 3rdparty/cma 3rdparty/compiler-rt/builtin_fp16.h - The Unlicense ------------- 3rdparty/rang Software: dlpack 0acb731e0e43d15deee27b66f10e4c5b4e667913 -Copyright notice: +Copyright notice: Copyright by contributors Copyright (c) 2017 by Contributors - License: Apache License V2.0 Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -3899,7 +3897,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -3907,9 +3905,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - Software: dmlc-core 808f485387f9a03f78fa9f1159f387d0d91b7a28 -Copyright notice: +Copyright notice: Copyright by contributors Copyright (c) 2015-2018 by Contributors Copyright (c) 2017 by Contributors @@ -3920,13 +3917,12 @@ Copyright (c) 2015 by Contributors Copyright (c) 2016 by Contributors ©2015-2016 Cameron Desrochers. - License: Apache License V2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -3934,10 +3930,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - Software: rang cabe04d6d6b05356fa8f9741704924788f0dd762 -Copyright notice: - +Copyright notice: License: The Unlicense This is free and unencumbered software released into the public domain. @@ -3993,11 +3987,9 @@ Copyright 2016 Google Inc. All rights reserved. Copyright 2005 Google Inc. Copyright 2016 Google Inc. All rights reserved. - License: BSD 3-Clause License Please see above. - Software: libjpeg-turbo 2.0.4 Copyright notice: Copyright 2009 Pierre Ossman for Cendio AB @@ -4142,7 +4134,7 @@ Copyright 2011 Nikita Krupen'ko Copyright (C) 2011, 2014-2016, 2018, D. R. Commander. Copyright (C) 2014, Linaro Limited. -License: libjpeg-turbo Licenses +License: libjpeg-turbo Licenses libjpeg-turbo is covered by three compatible BSD-style open source licenses: The IJG (Independent JPEG Group) License, which is listed in README.ijg @@ -4902,7 +4894,7 @@ tinytest.h -- Copyright 2009-2012 Nick Mathewson tinytestmacros.h -- Copyright 2009-2012 Nick Mathewson Software: grpc 1.36.1 -Copyright notice: +Copyright notice: Copyright 2015 The gRPC Authors Copyright 2016 The gRPC Authors Copyright 2018 The gRPC Authors @@ -4971,7 +4963,7 @@ Software: opencv 4.5.2 Copyright notice: Copyright 2015-2017 Philippe Tillet Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding. -Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. +Copyright 2008-2009 Marius Muja (). All rights reserved. "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ Copyright (c) 1991-1996 Silicon Graphics, Inc. Copyright (C) 1994-1997, Thomas G. Lane. @@ -5049,7 +5041,7 @@ Copyright (c) 1996-1997 Andreas Dilger Copyright (C) 1990, 1995 Frank D. Cringle. Copyright (C) 2014, MIPS Technologies, Inc., California. Copyright (C) 2009, Intel Corporation and others, all rights reserved. -Copyright (c) 2020, OPEN AI LAB Author: qtang@openailab.com +Copyright (c) 2020, OPEN AI LAB Author: Copyright 2005-2008 Google Inc. All Rights Reserved. Copyright (c) 2006, 2008 Edward Rosten All rights reserved. Copyright (c) 2016-2017 Glenn Randers-Pehrson Written by Mike Klein and Matt Sarett, Google, Inc. @@ -5149,7 +5141,7 @@ Copyright (c) 2002-2014, Professor Benoit Macq Copyright (C) 2009-2011, 2016, D. R. Commander. Copyright (c) 2007, Jonathan Ballard " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; -Copyright (C) 1998 Yossi Rubner Computer Science Department, Stanford University E-Mail: rubner@cs.stanford.edu URL: http:vision.stanford.edu/rubner +Copyright (C) 1998 Yossi Rubner Computer Science Department, Stanford University E-Mail: URL: http:vision.stanford.edu/rubner Copyright (c) 2003-2009, Francois-Olivier Devaux Copyright (C) 2015, Matthieu Darbois. Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson @@ -5209,7 +5201,7 @@ Copyright (c) 2017, IntoPix SA Copyright (C) 2017-2019, Intel Corporation, all rights reserved. Copyright (c) 1990-1997 Sam Leffler Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -Copyright (c) 2020, OPEN AI LAB qli@openailab.com sqfu@openailab.com +Copyright (c) 2020, OPEN AI LAB Copyright (c) 2001-2004 Michael David Adams. Copyright (C) 2009, 2011, 2014-2015, 2018, 2020, D. R. Commander. Update copyright year to 2010. @@ -5278,7 +5270,7 @@ Copyright (C) 2020, Huawei Technologies Co., Ltd. All rights reserved. Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler. Copyright (C) 2014-2015, Itseez Inc., all rights reserved. (C) 1995-2017 Jean-loup Gailly and Mark Adler -Copyright (c) 2013, Bo Li (prclibo@gmail.com), ETH Zurich All rights reserved. +Copyright (c) 2013, Bo Li (), ETH Zurich All rights reserved. Copyright (c) 2015 The Regents of the University of California (Regents) Copyright 2010 Argus Corp. All rights reserved. [assembly: AssemblyCopyright("Copyright © 2013")] @@ -5301,7 +5293,7 @@ Copyright (c) 2015-2018 The Khronos Group Inc. Copyright 2009 Pierre Ossman for Cendio AB Copyright (C) 2013, Linaro Limited. Copyright (C) 2016, D. R. Commander. -Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. +Copyright 2008-2011 Marius Muja (). All rights reserved. "Copyright (C) 2015 Intel Corporation\n" \ Copyright (c) Microsoft Corporation. All rights reserved. ==6117== Copyright (C) 2003-2015, and GNU GPL'd, by Nicholas Nethercote ==6117== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==6117== Command: ./bin/exampletutorialportinganisotropicimagesegmentationgapi ==6117== @@ -5353,7 +5345,7 @@ Copyright (C) 1978-1999 Ken Turkowski. Copyright (C) 2014-2016, NVIDIA Corporation, all rights reserved. Copyright (C) 2010-2012, Multicoreware, Inc., all rights reserved. Copyright (C) 2008, Willow Garage Inc., all rights reserved. -Copyright (C) 2014, Samson Yilma (samsonyilma@yahoo.com), all rights reserved. +Copyright (C) 2014, Samson Yilma (), all rights reserved. Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) Copyright © 2016, NVIDIA CORPORATION. All rights reserved. Copyright (C) 2015-2018, D. R. Commander. @@ -5367,7 +5359,7 @@ Copyright (c) 2016-2017 Fabian David Tschopp, all rights reserved. Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. Copyright 2012 Google Inc. All Rights Reserved. "Copyright (C) 2009-2020 D. R. Commander\n" \ -Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. +Copyright 2008-2011 David G. Lowe (). All rights reserved. Copyright 2014 Google Inc. All rights reserved. Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. Copyright 2006, Google Inc. @@ -5389,7 +5381,7 @@ Copyright (c) 2002-2018, Industrial Light & Magic, a division of Lucas Digital L define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding" Copyright (C) 2018, Intel Corporation, all rights reserved. Copyright (C) 2015, 2020, D. R. Commander. -Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. +Copyright 2008-2009 Marius Muja (). All rights reserved. Copyright (C) 2010, 2020, D. R. Commander. Copyright (C) 1999-2006, MIYASAKA Masaru. Copyright (C) 2008-2013, Itseez Inc., all rights reserved. @@ -5423,12 +5415,12 @@ Copyright (C) 2006 Simon Perreault Copyright (c) 1996-1997 Sam Leffler Copyright (C) 1994-1998, Thomas G. Lane. Copyright (c) 2013 NVIDIA Corporation. All rights reserved. -Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. +Copyright 2008-2009 David G. Lowe (). All rights reserved. Copyright (C) 2016, NVIDIA Corporation, all rights reserved. Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -5644,7 +5636,7 @@ Copyright 2009 Alexander Neundorf Copyright (c) 2012 - 2017, Lars Bilke Copyright (c) 2012-2016 Sascha Kratky Copyright 2012-2018 Sascha Kratky -Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) +Copyright (c) 2012-2018, OpenGeoSys Community () Copyright (c) 2012 - 2015, Lars Bilke Copyright 2008-2009 Philip Lowman Copyright 2010 Iowa State University (Ryan Pavlik ) @@ -5676,12 +5668,12 @@ FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - Software: Myia 395fa4c7beb9479a1d6e323e4cc0ecf25733dfba Copyright notice: Copyright (c) 2017 MILA Please visit the Myia web site for more information: - * https://github.com/mila-iqia/myia/ + +* MIT License @@ -5914,7 +5906,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - Software: OpenCL-CLHPP v2.0.12 Copyright notice: Copyright (c) 2008-2020 The Khronos Group Inc. @@ -6177,7 +6168,7 @@ Copyright (c) 2017-2019 IAR Systems Apache License Version 2.0, January 2004 -http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -6386,7 +6377,7 @@ Copyright 2020 The Abseil Authors. Apache License Version 2.0, January 2004 - https://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -6645,7 +6636,8 @@ Copyright (C) 2004-2018 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2010-2012 by Daniel Stenberg Copyright (c) 2012 Xan Lopez -- aresversion.h: copyright end range year is now 2013 + +* aresversion.h: copyright end range year is now 2013 Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov Copyright 2000 by the Massachusetts Institute of Technology. Copyright (C) 2009 - 2013 by Daniel Stenberg et al @@ -6708,12 +6700,12 @@ purpose. It is provided "as is" without express or implied warranty. Software: numpy 1.17.0 Copyright notice: -Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin@mit.edu +Copyright (c) 1995, 1996, 1997 Jim Hugunin, Copyright 2014 Melissa O'Neill Copyright (c) 2006, University of Georgia and Pierre G.F. Gerard-Marchant All rights reserved. Copyright 1999-2004 Pearu Peterson all rights reserved, Pearu Peterson Copyright (c) 2009-2019: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: -Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2003-2005, Jean-Sebastien Roy () copyright = '2008-2019, The SciPy community' Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson Copyright (c) 2019 NumPy Developers @@ -6725,13 +6717,13 @@ Copyright 1999, 2000, 2001 Regents of the University of California. Copyright (c) 2005, NumPy Developers Copyright (c) 2019 Kevin Sheppard. All rights reserved. Copyright 2010-2012, D. E. Shaw Research. -Copyright (c) 2011 by Mark Wiebe (mwwiebe@gmail.com) +Copyright (c) 2011 by Mark Wiebe () Copyright 2006, Dean Edwards Copyright (c) 2014 Ryan Juckett Copyright 2001-2005 Pearu Peterson all rights reserved, Pearu Peterson copyright = u'2017-2018, NumPy Developers' Copyright (C) 2004-2018 Max-Planck-Society \author Martin Reinecke -Copyright (c) 2010-2011 by Mark Wiebe (mwwiebe@gmail.com) +Copyright (c) 2010-2011 by Mark Wiebe () Copyright (c) 2012 Stephen Montgomery-Smith Copyright (c) 2005-2019, NumPy Developers. Copyright (c) 2011 Enthought, Inc @@ -6742,7 +6734,7 @@ Copyright 1999,2000 Pearu Peterson all rights reserved, Pearu Peterson ) Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson f90: Copyright Absoft Corporation 1994-1998 mV2; Cray Research, Inc. 1994-1996 CF90 (2.x.x.x f36t87) Version 2.3 Wed Apr 19, 2006 13:05:16 Copyright (c) 2006-2013 The University of Colorado Denver. All rights reserved. @@ -7007,7 +6999,7 @@ Copyright (c) 2001-2004 by Secret Labs AB Copyright (c) 1995-1996 by Fredrik Lundh Copyright (c) 1995-1996 by Fredrik Lundh. Copyright (c) Secret Labs AB 1997-99. -Copyright (C) 2002-2003 Kevin Cazabon kevin@cazabon.com Adapted/reworked for PIL by Fredrik Lundh +Copyright (C) 2002-2003 Kevin Cazabon Adapted/reworked for PIL by Fredrik Lundh Copyright (c) Secret Labs AB 1998 Copyright (c) 1997-2005 by Fredrik Lundh Copyright (c) Fredrik Lundh 1995-1997. @@ -7044,7 +7036,7 @@ COMMENT Copyright 1984, 1987 Adobe Systems, Inc. Copyright (c) 2013 by Eric Soroos Copyright (c) 1997-1999 by Secret Labs AB Copyright (c) Secret Labs AB 2008. -By Kevin Cazabon, copyright 2003 kevincazabon@hotmail.com kevin@cazabon.com / +By Kevin Cazabon, copyright 2003 / Copyright (c) 2014 by Alastair Houghton. Copyright (c) 2002-2004 by Secret Labs AB Copyright (c) Fredrik Lundh 1996-2001. @@ -7052,7 +7044,7 @@ Copyright (c) 1995 by Fredrik Lundh Copyright (c) Secret Labs AB 1997-2003. Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. Copyright (c) 1995-2004 by Fredrik Lundh -Copyright (C) 2002-2003 Kevin Cazabon kevin@cazabon.com http:www.cazabon.com +Copyright (C) 2002-2003 Kevin Cazabon http:www.cazabon.com Copyright (c) 2014 Dov Grobgeld Copyright (c) 1998-2007 by Secret Labs AB Copyright (c) Fredrik Lundh 1995-96. @@ -7067,9 +7059,9 @@ If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. Software: Python 3.7.5 Copyright notice: Copyright (c) 1999-2000 by Secret Labs AB -Copyright (C) 2005-2007 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2005-2007 Gregory P. Smith () Copyright (c) 2003. -. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +. Copyright (C) 2005-2010 Gregory P. Smith () Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany. Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All rights reserved. @@ -7101,7 +7093,7 @@ Copyright (C) 1986 Gary S. Brown. You may use this program, or code or tables e Copyright (c) 2001-2019 Python Software Foundation.\n\ Copyright 2008 Armin Ronacher. Copyright © 2000 BeOpen.com. All rights reserved. -(c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) +(c) 2005 Ian Bicking and contributors; written for Paste () Copyright (c) 2005-2006 ActiveState Software Inc. Copyright (C) 1994 Steen Lumholt. Copyright (c) 1999 by Fredrik Lundh. @@ -7110,28 +7102,29 @@ Copyright (c) 2006-2008 Alexander Chemeris Copyright (C) 2002 Lars Gustaebel Copyright (c) 1999-2003 Steve Purcell Darwin ABI support (c) 2001 John Hornkvist -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +Copyright (C) 1995-1998 Eric Young () Copyright (c) 1999-2008 by Fredrik Lundh i.e., "Copyright © 1995-2001 Corporation for National Research Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 -- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. -- Copyright (c) 2001-2017 Expat maintainers Copyright (c) 2001-2012 Python Software Foundation. All Rights Reserved. -Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: (c) 2002 Gregory P. Ward. All Rights Reserved. Copyright (c) 2000 BeOpen.com.\n\ -Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: Copyright (C) 2003-2004 Federico Di Gregorio 2001-05-14 fl fixes for 1.5.2 compatibility Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved. Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. copyright, i.e., "Copyright © 2001-2019 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: email-sig@python.org -Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: +Copyright (C) 2005-2010 Gregory P. Smith () Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes All rights reserved. Copyright (C) 1999-2001 Gregory P. Ward. Copyright (c) 1999-2002 by Fredrik Lundh -+ Copyright 2007 Python Software Foundation. + +* Copyright 2007 Python Software Foundation. else if (config == (void )2000 && (c) == 0x9B1D) { \ Copyright (c) 1999-2002 by Secret Labs AB 2002-11-09 fl fixed empty sub/subn return type @@ -7157,7 +7150,7 @@ types.c - Copyright (c) 1996, 1998 Red Hat, Inc. Copyright 2000, Mojam Media, Inc., all rights reserved. Copyright (C) 1994 X Consortium Copyright (C) 2002-2004 Python Software Foundation -Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: email-sig@python.org +Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: Copyright (c) 2002 Jorge Acereda & darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc. Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands. All rights reserved. @@ -7167,10 +7160,10 @@ Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler x86-ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. -Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: Copyright (c) 2005 Don Owens All rights reserved. win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. -(c) Copyright 2005, Marc-Andre Lemburg (mal@lemburg.com). +(c) Copyright 2005, Marc-Andre Lemburg (). library/xml.etree.elementtree,,:include, Copyright (c) . ffi.c - Copyright (c) 1998 Geoffrey Keating Copyright 2006 Georg Brandl. @@ -7181,15 +7174,15 @@ Copyright (c) 1990-1995, Stichting Mathematisch Centrum. Copyright (C) 2001-2017 Vinay Sajip. All Rights Reserved. i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation; 2001-10-24 fl added finditer primitive (for 2.2 only) -Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: Copyright (c) 1999-2009 by Fredrik Lundh. (c) 2000 Peter Bosch. All Rights Reserved. ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc. Copyright (C) 2012 Free Software Foundation, Inc. -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: Copyright 1994 by Lance Ellinghouse, Cathedral City, California Republic, United States of America. Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -Copyright (C) 2006 - 2010 Gregor Lingl email: glingl@aon.at +Copyright (C) 2006 - 2010 Gregor Lingl email: Copyright © 2001-2019 Python Software Foundation. All rights reserved. Copyright (c) 2009,2010 Zmanda Inc. Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. @@ -7200,7 +7193,7 @@ Copyright (c) 1999, 2000, 2001 Steve Purcell This module is free software, and y -- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- Copyright (C) 2001-2012 Python Software Foundation. All Rights Reserved. dnl Copyright © 2004 Scott James Remnant . -Copyright (C) 2002-2007 Python Software Foundation Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Contact: Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. Copyright (c) 2009,2010 Dustin J. Mitchell Copyright (c) 2002 Bo Thorsen @@ -7219,7 +7212,7 @@ Copyright (c) 1999-2009 by Fredrik Lundh Copyright 2007 Google, Inc. All Rights Reserved. -- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. -- Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation. All rights reserved. -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2000 BeOpen.com. All rights reserved. Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved. Copyright (C) 2000 Luke Kenneth Casson Leighton @@ -7253,7 +7246,7 @@ Copyright (c) 2002 Ranjit Mathew ppc-darwin.h - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. ppc64-darwinclosure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. based on ppcclosure.S x86-ffi64.c - Copyright (c) 2002 Bo Thorsen -Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2004, Outercurve Foundation. Copyright (c) 1995-2001 Corporation for National Research Initiatives.\n\ Copyright 1999, Bioreason, Inc., all rights reserved. @@ -7264,8 +7257,8 @@ Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. Copyright (C) 2005 Martin v. Löwis Licensed to PSF under a contributor agreement. ppc-darwin.S - Copyright (c) 2000 John Hornkvist Copyright (c) 2000, BeOpen.com. -Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org -Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: email-sig@python.org +Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: +Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: Copyright (c) 2004 by Fredrik Lundh Copyright Disney Enterprises, Inc. All Rights Reserved. ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. @@ -7274,23 +7267,23 @@ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherl Copyright (c) . prepcif.c - Copyright (c) 1996, 1998 Red Hat, Inc. self.assertEqual(list(c), list(range(2,2000))) -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: -- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- -Copyright (C) 2012 Christian Heimes (christian@python.org) +Copyright (C) 2012 Christian Heimes () fficommon.h - Copyright (c) 1996 Red Hat, Inc. -Copyright (C) 2012-2016 Christian Heimes (christian@python.org) +Copyright (C) 2012-2016 Christian Heimes () Copyright (C) 2004-2005 Gerhard Häring (c) 2002 Python Software Foundation. All Rights Reserved. -Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com +Copyright (c) 2004 by Secret Labs AB, Copyright (c) 2004, Outercurve Foundation. Copyright (c) 2006-2008, R Oudkerk Licensed to PSF under a Contributor Agreement. .. Copyright 1995 Virginia Polytechnic Institute and State University and Fred L. Drake, Jr. This copyright notice must be distributed on all copies, but this document otherwise may be distributed as part of the Python distribution. No fee may be charged for this document in any representation, either on paper or electronically. This restriction does not affect other elements in a distributed package in any way. Copyright 2012-2013 by Larry Hastings. -Copyright (C) 2002-2006 Python Software Foundation Contact: email-sig@python.org email package unit tests for (optional) Asian codecs +Copyright (C) 2002-2006 Python Software Foundation Contact: email package unit tests for (optional) Asian codecs Copyright (c) 2002 Peter O'Gorman Copyright 2007 Google Inc. Copyright (c) 1999 by Fredrik Lundh -Copyright (C) 2001-2010 Python Software Foundation Contact: email-sig@python.org email package unit tests +Copyright (C) 2001-2010 Python Software Foundation Contact: email package unit tests Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. Copyright (c) 2000-2017 Expat development team Licensed under the MIT license: @@ -7329,12 +7322,12 @@ A. HISTORY OF THE SOFTWARE ========================== Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +Mathematisch Centrum (CWI, see ) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +National Research Initiatives (CNRI, see ) in Reston, Virginia where he released several versions of the software. @@ -7342,11 +7335,11 @@ In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations, which became Zope Corporation. In 2001, the Python Software Foundation (PSF, see -https://www.python.org/psf/) was formed, a non-profit organization +) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation was a sponsoring member of the PSF. -All Python releases are Open Source (see http://www.opensource.org for +All Python releases are Open Source (see for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. @@ -7382,7 +7375,6 @@ Footnotes: Thanks to the many outside volunteers who have worked under Guido's direction to make these releases possible. - B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON =============================================================== @@ -7435,7 +7427,6 @@ products or services of Licensee, or any third party. agrees to be bound by the terms and conditions of this License Agreement. - BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 ------------------------------------------- @@ -7478,14 +7469,13 @@ between BeOpen and Licensee. This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee, or any third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the + may be used according to the permissions granted on that web page. 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. - CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 --------------------------------------- @@ -7510,7 +7500,7 @@ conditions in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be located on the Internet using the following unique, persistent identifier (known as a handle): 1895.22/1013. This Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". +using the following URL: ". 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 1.6.1 or any part thereof, and wants to make @@ -7556,7 +7546,6 @@ bound by the terms and conditions of this License Agreement. ACCEPT - CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 -------------------------------------------------- @@ -7584,9 +7573,9 @@ Software: Python 3.8.5 Copyright notice: copyright, i.e., "Copyright © 2001-2018 Python Software Foundation; All Rights Reserved" are retained in Python 3.8 alone or in any derivative version prepared by Licensee. Copyright (c) 1999-2000 by Secret Labs AB -Copyright (C) 2005-2007 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2005-2007 Gregory P. Smith () Copyright (c) 2003. -. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +. Copyright (C) 2005-2010 Gregory P. Smith () Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany. Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. Copyright (c) 1995-2001 Corporation for National Research Initiatives. All rights reserved. @@ -7616,7 +7605,7 @@ Copyright (C) 1986 Gary S. Brown. You may use this program, or code or tables e Copyright (c) 2001-2020 Python Software Foundation. All rights reserved. Copyright 2008 Armin Ronacher. Copyright © 2000 BeOpen.com. All rights reserved. -(c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) +(c) 2005 Ian Bicking and contributors; written for Paste () Copyright (c) 2005-2006 ActiveState Software Inc. Copyright (C) 1994 Steen Lumholt. Copyright (c) 1999 by Fredrik Lundh. @@ -7625,28 +7614,29 @@ Copyright (c) 2006-2008 Alexander Chemeris Copyright (C) 2002 Lars Gustaebel Copyright (c) 1999-2003 Steve Purcell Darwin ABI support (c) 2001 John Hornkvist -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +Copyright (C) 1995-1998 Eric Young () Copyright (c) 1999-2008 by Fredrik Lundh i.e., "Copyright © 1995-2001 Corporation for National Research Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 -- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. -- Copyright (c) 2001-2017 Expat maintainers Copyright (c) 2001-2012 Python Software Foundation. All Rights Reserved. -Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: (c) 2002 Gregory P. Ward. All Rights Reserved. Copyright (c) 2000 BeOpen.com.\n\ -Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: Copyright (C) 2003-2004 Federico Di Gregorio 2001-05-14 fl fixes for 1.5.2 compatibility Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved. Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang), All Rights Reserved. Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: email-sig@python.org -Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: +Copyright (C) 2005-2010 Gregory P. Smith () Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes All rights reserved. Copyright (C) 1999-2001 Gregory P. Ward. Copyright (c) 1999-2002 by Fredrik Lundh -+ Copyright 2007 Python Software Foundation. + +* Copyright 2007 Python Software Foundation. else if (config == (void )2000 && (c) == 0x9B1D) { \ Copyright (c) 1999-2002 by Secret Labs AB 2002-11-09 fl fixed empty sub/subn return type @@ -7673,7 +7663,7 @@ types.c - Copyright (c) 1996, 1998 Red Hat, Inc. Copyright 2000, Mojam Media, Inc., all rights reserved. Copyright (C) 1994 X Consortium copyright, i.e., "Copyright © 2001-2020 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. -Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: email-sig@python.org +Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: Copyright (C) 2002-2004 Python Software Foundation Copyright (c) 2002 Jorge Acereda & darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc. @@ -7684,10 +7674,10 @@ Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. Copyright © 2001-2020 Python Software Foundation. All rights reserved. (c) 2001-2020 Python Software Foundation. -Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: Copyright (c) 2005 Don Owens All rights reserved. darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. -(c) Copyright 2005, Marc-Andre Lemburg (mal@lemburg.com). +(c) Copyright 2005, Marc-Andre Lemburg (). library/xml.etree.elementtree,,:include, Copyright (c) . ffi.c - Copyright (c) 1998 Geoffrey Keating Copyright 2006 Georg Brandl. @@ -7698,15 +7688,15 @@ Copyright (C) 2003-2013 Python Software Foundation import copy import operator i Copyright (C) 2001-2017 Vinay Sajip. All Rights Reserved. Copyright (c) 1990-1995, Stichting Mathematisch Centrum. 2001-10-24 fl added finditer primitive (for 2.2 only) -Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: Copyright (c) 1999-2009 by Fredrik Lundh. (c) 2000 Peter Bosch. All Rights Reserved. Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Copyright (C) 2012 Free Software Foundation, Inc. -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; Copyright 1994 by Lance Ellinghouse, Cathedral City, California Republic, United States of America. -Copyright (C) 2006 - 2010 Gregor Lingl email: glingl@aon.at +Copyright (C) 2006 - 2010 Gregor Lingl email: Copyright (c) 2009,2010 Zmanda Inc. Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. Copyright 1996 by Sam Rushing @@ -7716,7 +7706,7 @@ Copyright (c) 1999, 2000, 2001 Steve Purcell This module is free software, and y -- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- Copyright (C) 2001-2012 Python Software Foundation. All Rights Reserved. dnl Copyright © 2004 Scott James Remnant . -Copyright (C) 2002-2007 Python Software Foundation Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Contact: Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. Copyright (c) 2009,2010 Dustin J. Mitchell Copyright (c) 2002 Bo Thorsen @@ -7733,7 +7723,7 @@ libffi PyOBJC - Copyright (c) 1996-2003 Red Hat, Inc. Copyright (c) 1999-2009 by Fredrik Lundh Copyright 2007 Google, Inc. All Rights Reserved. -- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. -- -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2000 BeOpen.com. All rights reserved. %version%, (c) 2001-2020 Python Software Foundation. Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved. @@ -7769,7 +7759,7 @@ ppc-darwin.h - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. ppc64-darwinclosure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. based on ppcclosure.S x86-ffi64.c - Copyright (c) 2002 Bo Thorsen Copyright (c) 2002 Ranjit Mathew -Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2004, Outercurve Foundation. Copyright (c) 1995-2001 Corporation for National Research Initiatives.\n\ Copyright 1999, Bioreason, Inc., all rights reserved. @@ -7780,8 +7770,8 @@ Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. Copyright (C) 2005 Martin v. Löwis Licensed to PSF under a contributor agreement. ppc-darwin.S - Copyright (c) 2000 John Hornkvist Copyright (c) 2000, BeOpen.com. -Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org -Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: email-sig@python.org +Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: +Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: Copyright (c) 2004 by Fredrik Lundh Copyright Disney Enterprises, Inc. All Rights Reserved. ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. @@ -7789,23 +7779,23 @@ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherl Copyright (c) . prepcif.c - Copyright (c) 1996, 1998 Red Hat, Inc. self.assertEqual(list(c), list(range(2,2000))) -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: -- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- -Copyright (C) 2012 Christian Heimes (christian@python.org) +Copyright (C) 2012 Christian Heimes () fficommon.h - Copyright (c) 1996 Red Hat, Inc. -Copyright (C) 2012-2016 Christian Heimes (christian@python.org) +Copyright (C) 2012-2016 Christian Heimes () Copyright (C) 2004-2005 Gerhard Häring (c) 2002 Python Software Foundation. All Rights Reserved. -Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com +Copyright (c) 2004 by Secret Labs AB, Copyright (c) 2004, Outercurve Foundation. Copyright (c) 2006-2008, R Oudkerk Licensed to PSF under a Contributor Agreement. .. Copyright 1995 Virginia Polytechnic Institute and State University and Fred L. Drake, Jr. This copyright notice must be distributed on all copies, but this document otherwise may be distributed as part of the Python distribution. No fee may be charged for this document in any representation, either on paper or electronically. This restriction does not affect other elements in a distributed package in any way. Copyright 2012-2013 by Larry Hastings. -Copyright (C) 2002-2006 Python Software Foundation Contact: email-sig@python.org email package unit tests for (optional) Asian codecs +Copyright (C) 2002-2006 Python Software Foundation Contact: email package unit tests for (optional) Asian codecs Copyright (c) 2002 Peter O'Gorman Copyright 2007 Google Inc. Copyright (c) 1999 by Fredrik Lundh -Copyright (C) 2001-2010 Python Software Foundation Contact: email-sig@python.org email package unit tests +Copyright (C) 2001-2010 Python Software Foundation Contact: email package unit tests Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. Copyright (c) 2000-2017 Expat development team Licensed under the MIT license: @@ -7843,12 +7833,12 @@ A. HISTORY OF THE SOFTWARE ========================== Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +Mathematisch Centrum (CWI, see ) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +National Research Initiatives (CNRI, see ) in Reston, Virginia where he released several versions of the software. @@ -7856,11 +7846,11 @@ In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations, which became Zope Corporation. In 2001, the Python Software Foundation (PSF, see -https://www.python.org/psf/) was formed, a non-profit organization +) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation was a sponsoring member of the PSF. -All Python releases are Open Source (see http://www.opensource.org for +All Python releases are Open Source (see for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. @@ -7896,7 +7886,6 @@ Footnotes: Thanks to the many outside volunteers who have worked under Guido's direction to make these releases possible. - B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON =============================================================== @@ -7949,7 +7938,6 @@ products or services of Licensee, or any third party. agrees to be bound by the terms and conditions of this License Agreement. - BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 ------------------------------------------- @@ -7992,14 +7980,13 @@ between BeOpen and Licensee. This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee, or any third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the + may be used according to the permissions granted on that web page. 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. - CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 --------------------------------------- @@ -8024,7 +8011,7 @@ conditions in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be located on the Internet using the following unique, persistent identifier (known as a handle): 1895.22/1013. This Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". +using the following URL: ". 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 1.6.1 or any part thereof, and wants to make @@ -8070,7 +8057,6 @@ bound by the terms and conditions of this License Agreement. ACCEPT - CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 -------------------------------------------------- @@ -8097,9 +8083,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Software: Python 3.9.2 Copyright notice: Copyright (c) 1999-2000 by Secret Labs AB -Copyright (C) 2005-2007 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2005-2007 Gregory P. Smith () Copyright (c) 2003. -. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +. Copyright (C) 2005-2010 Gregory P. Smith () Copyright 1996,1997 by Oliver Andrich, Koblenz, Germany. Copyright (c) 2008-2020 Stefan Krah. All rights reserved. Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. @@ -8129,7 +8115,7 @@ Copyright (C) 1986 Gary S. Brown. You may use this program, or code or tables e ; Copyright (c) 2008-2020 Stefan Krah. All rights reserved. Copyright 2008 Armin Ronacher. Copyright © 2000 BeOpen.com. All rights reserved. -(c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) +(c) 2005 Ian Bicking and contributors; written for Paste () Copyright (c) 2005-2006 ActiveState Software Inc. Copyright (C) 1994 Steen Lumholt. Copyright (c) 1999 by Fredrik Lundh. @@ -8138,29 +8124,30 @@ Copyright (C) 2002 Lars Gustaebel Copyright (c) 1999-2003 Steve Purcell Darwin ABI support (c) 2001 John Hornkvist Copyright (c) 2001-2021 Python Software Foundation.\n\ -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +Copyright (C) 1995-1998 Eric Young () Copyright (c) 1999-2008 by Fredrik Lundh i.e., "Copyright © 1995-2001 Corporation for National Research Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may substitute the following text (omitting the quotes): "Python 1.6.1 -- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. -- Copyright (c) 2001-2017 Expat maintainers Copyright (c) 2001-2012 Python Software Foundation. All Rights Reserved. -Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2006 Python Software Foundation Author: Barry Warsaw Contact: (c) 2002 Gregory P. Ward. All Rights Reserved. copyright, i.e., "Copyright © 2001-2021 Python Software Foundation; All Rights Reserved" are retained in Python |release| alone or in any derivative version prepared by Licensee. Copyright (c) 2000 BeOpen.com.\n\ -Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: Copyright (C) 2003-2004 Federico Di Gregorio 2001-05-14 fl fixes for 1.5.2 compatibility Copyright (c) 2001-2021 Python Software Foundation. All rights reserved. Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved. Copyright (c) 2013 W3C(R) (MIT, ERCIM, Keio, Beihang), All Rights Reserved. Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: email-sig@python.org -Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw, Thomas Wouters, Anthony Baxter Contact: +Copyright (C) 2005-2010 Gregory P. Smith () Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes All rights reserved. Copyright (C) 1999-2001 Gregory P. Ward. Copyright (c) 1999-2002 by Fredrik Lundh -+ Copyright 2007 Python Software Foundation. + +* Copyright 2007 Python Software Foundation. else if (config == (void )2000 && (c) == 0x9B1D) { \ Copyright (c) 1999-2002 by Secret Labs AB 2002-11-09 fl fixed empty sub/subn return type @@ -8188,7 +8175,7 @@ types.c - Copyright (c) 1996, 1998 Red Hat, Inc. Copyright 2000, Mojam Media, Inc., all rights reserved. Copyright (C) 1994 X Consortium Copyright (C) 2002-2004 Python Software Foundation -Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: email-sig@python.org +Copyright (C) 2004-2006 Python Software Foundation Authors: Baxter, Wouters and Warsaw Contact: Copyright (c) 2002 Jorge Acereda & darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003 Red Hat, Inc. Copyright © 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands. All rights reserved. @@ -8198,9 +8185,9 @@ Copyright (C) 1995-2011 Jean-loup Gailly and Mark Adler Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. (c) 2001-2020 Python Software Foundation. darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. -Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Ben Gertzfield Contact: Copyright (c) 2005 Don Owens All rights reserved. -(c) Copyright 2005, Marc-Andre Lemburg (mal@lemburg.com). +(c) Copyright 2005, Marc-Andre Lemburg (). library/xml.etree.elementtree,,:include, Copyright (c) . ffi.c - Copyright (c) 1998 Geoffrey Keating Copyright 2006 Georg Brandl. @@ -8210,16 +8197,16 @@ Copyright 1992-2018 Free Software Foundation, Inc. Copyright (c) 1990-1995, Stichting Mathematisch Centrum. i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation; 2001-10-24 fl added finditer primitive (for 2.2 only) -Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Keith Dart Contact: Copyright (c) 1999-2009 by Fredrik Lundh. (c) 2000 Peter Bosch. All Rights Reserved. %version%, (c) 2001-2021 Python Software Foundation. -Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved. +Copyright (C) 2001 , All Rights Reserved. Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. Copyright (C) 2012 Free Software Foundation, Inc. -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield Contact: Copyright 1994 by Lance Ellinghouse, Cathedral City, California Republic, United States of America. -Copyright (C) 2006 - 2010 Gregor Lingl email: glingl@aon.at +Copyright (C) 2006 - 2010 Gregor Lingl email: Copyright © 2001-2021 Python Software Foundation. All rights reserved. Copyright (c) 2009,2010 Zmanda Inc. Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. @@ -8231,7 +8218,7 @@ Copyright (c) 1999, 2000, 2001 Steve Purcell This module is free software, and y -- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. -- Copyright (C) 2001-2012 Python Software Foundation. All Rights Reserved. dnl Copyright © 2004 Scott James Remnant . -Copyright (C) 2002-2007 Python Software Foundation Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Contact: Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. Copyright (c) 2009,2010 Dustin J. Mitchell Copyright (c) 2002 Bo Thorsen @@ -8248,7 +8235,7 @@ libffi PyOBJC - Copyright (c) 1996-2003 Red Hat, Inc. Copyright (c) 1999-2009 by Fredrik Lundh Copyright 2007 Google, Inc. All Rights Reserved. -- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. -- -Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2007 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2000 BeOpen.com. All rights reserved. 3-2926 U+00A9 COPYRIGHT SIGN [2000] %version%, (c) 2001-2020 Python Software Foundation. @@ -8284,7 +8271,7 @@ Copyright (C) 2011-2014 Vinay Sajip. x86-ffi64.c - Copyright (c) 2002 Bo Thorsen ppc64-darwinclosure.S - Copyright (c) 2002, 2003, 2004, Free Software Foundation, Inc. based on ppcclosure.S Copyright (c) 2002 Ranjit Mathew -Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2001-2006 Python Software Foundation Author: Barry Warsaw Contact: Copyright (c) 2004, Outercurve Foundation. Copyright (c) 1995-2001 Corporation for National Research Initiatives.\n\ Copyright 1999, Bioreason, Inc., all rights reserved. @@ -8295,8 +8282,8 @@ Copyright 2001-2019 by Vinay Sajip. All Rights Reserved. Copyright (C) 2005 Martin v. Löwis Licensed to PSF under a contributor agreement. ppc-darwin.S - Copyright (c) 2000 John Hornkvist Copyright (c) 2000, BeOpen.com. -Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: email-sig@python.org -Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: email-sig@python.org +Copyright (C) 2001-2010 Python Software Foundation Author: Barry Warsaw Contact: +Copyright (C) 2001-2007 Python Software Foundation Author: Anthony Baxter Contact: Copyright (c) 2004 by Fredrik Lundh Copyright Disney Enterprises, Inc. All Rights Reserved. ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. @@ -8304,23 +8291,23 @@ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherl Copyright (c) . prepcif.c - Copyright (c) 1996, 1998 Red Hat, Inc. self.assertEqual(list(c), list(range(2,2000))) -Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: email-sig@python.org +Copyright (C) 2002-2007 Python Software Foundation Author: Ben Gertzfield, Barry Warsaw Contact: -- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. -- -Copyright (C) 2012 Christian Heimes (christian@python.org) +Copyright (C) 2012 Christian Heimes () fficommon.h - Copyright (c) 1996 Red Hat, Inc. -Copyright (C) 2012-2016 Christian Heimes (christian@python.org) +Copyright (C) 2012-2016 Christian Heimes () Copyright (C) 2004-2005 Gerhard Häring (c) 2002 Python Software Foundation. All Rights Reserved. -Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com +Copyright (c) 2004 by Secret Labs AB, Copyright (c) 2004, Outercurve Foundation. Copyright (c) 2006-2008, R Oudkerk Licensed to PSF under a Contributor Agreement. .. Copyright 1995 Virginia Polytechnic Institute and State University and Fred L. Drake, Jr. This copyright notice must be distributed on all copies, but this document otherwise may be distributed as part of the Python distribution. No fee may be charged for this document in any representation, either on paper or electronically. This restriction does not affect other elements in a distributed package in any way. Copyright 2012-2013 by Larry Hastings. -Copyright (C) 2002-2006 Python Software Foundation Contact: email-sig@python.org email package unit tests for (optional) Asian codecs +Copyright (C) 2002-2006 Python Software Foundation Contact: email package unit tests for (optional) Asian codecs Copyright (c) 2002 Peter O'Gorman Copyright 2007 Google Inc. Copyright (c) 1999 by Fredrik Lundh -Copyright (C) 2001-2010 Python Software Foundation Contact: email-sig@python.org email package unit tests +Copyright (C) 2001-2010 Python Software Foundation Contact: email package unit tests Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. Copyright (c) 2000-2017 Expat development team Licensed under the MIT license: @@ -8358,12 +8345,12 @@ A. HISTORY OF THE SOFTWARE ========================== Python was created in the early 1990s by Guido van Rossum at Stichting -Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +Mathematisch Centrum (CWI, see ) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for -National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +National Research Initiatives (CNRI, see ) in Reston, Virginia where he released several versions of the software. @@ -8371,11 +8358,11 @@ In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations, which became Zope Corporation. In 2001, the Python Software Foundation (PSF, see -https://www.python.org/psf/) was formed, a non-profit organization +) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation was a sponsoring member of the PSF. -All Python releases are Open Source (see http://www.opensource.org for +All Python releases are Open Source (see for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. @@ -8411,7 +8398,6 @@ Footnotes: Thanks to the many outside volunteers who have worked under Guido's direction to make these releases possible. - B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON =============================================================== @@ -8425,7 +8411,6 @@ and the Zero-Clause BSD license. Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. - PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -------------------------------------------- @@ -8475,7 +8460,6 @@ products or services of Licensee, or any third party. agrees to be bound by the terms and conditions of this License Agreement. - BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 ------------------------------------------- @@ -8518,14 +8502,13 @@ between BeOpen and Licensee. This License Agreement does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote products or services of Licensee, or any third party. As an exception, the "BeOpen Python" logos available at -http://www.pythonlabs.com/logos.html may be used according to the + may be used according to the permissions granted on that web page. 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. - CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 --------------------------------------- @@ -8550,7 +8533,7 @@ conditions in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be located on the Internet using the following unique, persistent identifier (known as a handle): 1895.22/1013. This Agreement may also be obtained from a proxy server on the Internet -using the following URL: http://hdl.handle.net/1895.22/1013". +using the following URL: ". 3. In the event Licensee prepares a derivative work that is based on or incorporates Python 1.6.1 or any part thereof, and wants to make @@ -8596,7 +8579,6 @@ bound by the terms and conditions of this License Agreement. ACCEPT - CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 -------------------------------------------------- @@ -8651,7 +8633,7 @@ Copyright 2016 Google LLC. Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -9114,7 +9096,7 @@ Copyright (C) 2014 Clément Bœsch Copyright (C) 2014 James Almer Copyright (C) 2014 Kieran Kunhya Copyright (C) 2014 Loren Merritt -Copyright (C) 2014 Pascal Massimino (pascal.massimino@gmail.com) +Copyright (C) 2014 Pascal Massimino () Copyright (C) 2014 Ronald S. Bultje Copyright (C) 2014-2016 James Almer Copyright (C) 2015 James Almer @@ -9192,7 +9174,7 @@ Copyright (c) 2014 James Darnley Copyright (c) 2014 Kieran Kunhya Copyright (c) 2014 Michael Niedermayer Copyright (c) 2014 Michael Niedermayer -Copyright (c) 2014 Neil Birkbeck (birkbeck@google.com) +Copyright (c) 2014 Neil Birkbeck () Copyright (c) 2014 Nicolas Bertrand Copyright (c) 2014 Pierre-Edouard LEPERE Copyright (c) 2014 Ronald S. Bultje @@ -9236,8 +9218,8 @@ Copyright (C) 1996, 1997 Theodore Ts'o. Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 2000, Intel Corporation, all Copyright (C) 2000-2008, Intel Corporation, all -Copyright (C) 2001-2002 Michael Niedermayer (michaelni@gmx.at) -Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2001-2002 Michael Niedermayer () +Copyright (C) 2001-2003 Michael Niedermayer () Copyright (C) 2001-2003 Michael Niedermayer Copyright (C) 2001-2007 Michael Niedermayer Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen @@ -9258,7 +9240,7 @@ Copyright (C) 2003 Roberto Togni Copyright (C) 2003 The FFmpeg project Copyright (C) 2003, 2004 The FFmpeg project Copyright (C) 2003-2004 The FFmpeg project -Copyright (C) 2003-2005 by Christopher R. Hertel (crh@ubiqx.mn.org) +Copyright (C) 2003-2005 by Christopher R. Hertel () Copyright (C) 2003-2011 Michael Niedermayer Copyright (C) 2004 Alex Beregszaszi Copyright (C) 2004 Benjamin Zores @@ -9285,7 +9267,7 @@ Copyright (C) 2006 Aurelien Jacobs Copyright (C) 2006 Benjamin Larsson Copyright (C) 2006 Benjamin Larssonb Copyright (C) 2006 Loren Merritt -Copyright (C) 2006 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2006 Michael Niedermayer () Copyright (C) 2006 Michael Niedermayer Copyright (C) 2006 Robert Edele Copyright (C) 2006-2007 Kevin Stone @@ -9310,12 +9292,12 @@ Copyright (C) 2008 Ramiro Polla Copyright (C) 2008 Reimar Döffinger Copyright (C) 2008 David Conrad Copyright (C) 2008 Eli Friedman (eli.friedman gmail.com) -Copyright (C) 2008 Eli Friedman (eli.friedman@gmail.com) +Copyright (C) 2008 Eli Friedman () Copyright (C) 2008 Jaikrishnan Menon Copyright (C) 2008 Konstantin Shishkov Copyright (C) 2008 Michael Niedermayer Copyright (C) 2008 NVIDIA -Copyright (C) 2008 Sascha Sommer (saschasommer@freenet.de) +Copyright (C) 2008 Sascha Sommer () Copyright (C) 2008-2009 Konstantin Shishkov Copyright (C) 2008-2009 Splitted-Desktop Systems Copyright (C) 2008-2010 Nokia Corporation @@ -9354,8 +9336,8 @@ Copyright (C) 2011 Konstantin Shishkov based on work by Mike Melanson Copyright (C) 2011 Martin Storsjo Copyright (C) 2011 Peter Ross Copyright (C) 2011 Stefano Sabatini -Copyright (C) 2011-2012 Michael Niedermayer (michaelni@gmx.at) -Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2011-2012 Michael Niedermayer () +Copyright (C) 2011-2013 Michael Niedermayer () Copyright (C) 2012 - 2013 Gildas Cocherel Copyright (C) 2012 - 2013 Guillaume Martres Copyright (C) 2012 - 2013 Mickael Raulet @@ -9371,15 +9353,15 @@ Copyright (C) 2012 James Almer Copyright (C) 2012 Konstantin Shishkov Copyright (C) 2012 Mark Himsley Copyright (C) 2012 Martin Storsjo -Copyright (C) 2012 Matthäus G. "Anteru" Chajdas (http://anteru.net) -Copyright (C) 2012 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2012 Matthäus G. "Anteru" Chajdas () +Copyright (C) 2012 Michael Niedermayer () Copyright (C) 2012 Michael Niedermayer Copyright (C) 2012 Ronald S. Bultje Copyright (C) 2012 VLC authors and VideoLAN Author : Sukrit Sangwan < sukritsangwan at gmail dot com > Copyright (C) 2012, Collabora Ltd. Copyright (C) 2012, Rafaël Carré Copyright (C) 2012-2013 Intel Corporation -Copyright (C) 2012-2013 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2012-2013 Michael Niedermayer () Copyright (C) 2012-2014 Intel Corporation Copyright (C) 2013 - 2014 Pierre-Edouard Lepere Copyright (C) 2013 Anand Meher Kotra @@ -9438,7 +9420,7 @@ Copyright (C) 2017 Rostislav Pehlivanov Copyright (C) 2017 foo86 Copyright (C) 2018 Huiwen Ren, Copyright (C) 2018 James Almer -Copyright (C) 2018 Michael Niedermayer (michaelni@gmx.at) +Copyright (C) 2018 Michael Niedermayer () Copyright (C) 2018 Misty De Meo Copyright (C) 2018 Paul B Mahol Copyright (C) 2018 Philip Langdale @@ -9450,16 +9432,16 @@ Copyright (C) 2019 Paul B Mahol Copyright (C) 2019 Peter Ross Copyright (C) 2020 Alyssa Milburn Copyright (C) 2020 Huiwen Ren, -Copyright (C) 2020 Zane van Iperen (zane@zanevaniperen.com) +Copyright (C) 2020 Zane van Iperen () Copyright (C) 2021 Jan Ekström Copyright (C) 2021 Niklas Haas Copyright (C) 2021 Paul B Mahol -Copyright (C) 2021 Zane van Iperen (zane@zanevaniperen.com) +Copyright (C) 2021 Zane van Iperen () Copyright (C) 2022 Andreas Rheinhardt Copyright (C) 2022 Zhao Zhili, Copyright (c) 1990 James Ashton - Sydney University Copyright (c) 1996-2002 Gerd Knorr -Copyright (c) 1997-2001 ZSNES Team ( zsknight@zsnes.com / demo@zsnes.com ) +Copyright (c) 1997-2001 ZSNES Team ( / ) Copyright (c) 1998 - 2009 Conifer Software Copyright (c) 1998 Juergen Mueller And Sundry Contributors This source code is freely redistributable and may be used for any purpose. This copyright notice must be maintained. Copyright (c) 1999 Chris Bagwell @@ -9485,7 +9467,7 @@ Copyright (c) 2001 Fabrice Bellard (original AU code) Copyright (c) 2001 Heikki Leinonen Copyright (c) 2001 Juan J. Sierralta P Copyright (c) 2001 Lionel Ulmer -Copyright (c) 2001 Lionel Ulmer (lionel.ulmer@free.fr / bbrox@bbrox.org) +Copyright (c) 2001 Lionel Ulmer ( / ) Copyright (c) 2001 Michael Niedermayer Copyright (c) 2001 Michel Lespinasse Copyright (c) 2001, 2002 Fabrice Bellard @@ -9546,7 +9528,7 @@ Copyright (c) 2003 Ewald Snel Copyright (c) 2003 Fabrice Bellard Copyright (c) 2003 Gustavo Sverzut Barbieri Copyright (c) 2003 International Business Machines, Corp. -Copyright (c) 2003 LeFunGus, lefungus@altern.org +Copyright (c) 2003 LeFunGus, Copyright (c) 2003 Michael Niedermayer Copyright (c) 2003 Michael Niedermayer Copyright (c) 2003 Michael Zucchi @@ -9618,7 +9600,7 @@ Copyright (c) 2005 Steve Underwood Copyright (c) 2005 VLC authors and VideoLAN Copyright (c) 2005 Vidar Madsen Copyright (c) 2005 Wolfram Gloger -Copyright (c) 2005 by Neal Symms (tivo@freakinzoo.com) - February 2005 based on code by Christopher Wingert for tivo-mplayer tivo(at)wingert.org, February 2003 +Copyright (c) 2005 by Neal Symms () - February 2005 based on code by Christopher Wingert for tivo-mplayer tivo(at)wingert.org, February 2003 Copyright (c) 2005, 2011 Peter Ross Copyright (c) 2005, Herve Drolon, FreeImage Team Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) @@ -9642,7 +9624,7 @@ Copyright (c) 2006 Baptiste Coudurier Copyright (c) 2006 Benjamin Larsson Copyright (c) 2006 Cyril Zorin Copyright (c) 2006 Daniel Maas -Copyright (c) 2006 Gregory Montoir (cyx@users.sourceforge.net) +Copyright (c) 2006 Gregory Montoir () Copyright (c) 2006 Industrial Light & Magic, a division of Lucas Digital Ltd. LLC Copyright (c) 2006 Ivo van Poorten Copyright (c) 2006 Julian Hall @@ -9663,7 +9645,7 @@ Copyright (c) 2006 Rob Sykes Copyright (c) 2006 Roman Shaposhnik Copyright (c) 2006 Ryan Martell Copyright (c) 2006 Ryan Martell -Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) +Copyright (c) 2006 Ryan Martell. () Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier Copyright (c) 2006 Steve Lhomme @@ -9757,7 +9739,7 @@ Copyright (c) 2007-2009 Peter Ross Copyright (c) 2007-2009 Peter Ross Copyright (c) 2007-2009 Xiph.Org Foundation Copyright (c) 2007-2010 Stefano Sabatini -Copyright (c) 2007-2011 Peter Ross (pross@xvid.org) +Copyright (c) 2007-2011 Peter Ross () Copyright (c) 2007-2013 Stefano Sabatini Copyright (c) 2007-2016 David Robillard Copyright (c) 2008 Jaikrishnan Menon @@ -9766,7 +9748,7 @@ Copyright (c) 2008 - 2011 Sascha Sommer, Benjamin Larsson Copyright (c) 2008 Adam Gashlin Copyright (c) 2008 Affine Systems, Inc (Michael Sullivan, Bobby Impollonia) Copyright (c) 2008 Alessandro Sappia -Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) +Copyright (c) 2008 Alexander Strange () Copyright (c) 2008 Alexander Strange Copyright (c) 2008 Aurelien Jacobs Copyright (c) 2008 BBC, Anuradha Suraparaju @@ -9776,7 +9758,7 @@ Copyright (c) 2008 Baptiste Coudurier Copyright (c) 2008 Bartlomiej Wolowiec Copyright (c) 2008 Benjamin Larsson Copyright (c) 2008 GUCAS, Zhentan Feng -Copyright (c) 2008 Gregory Montoir (cyx@users.sourceforge.net) +Copyright (c) 2008 Gregory Montoir () Copyright (c) 2008 Ivo van Poorten Copyright (c) 2008 Jaikrishnan Menon Copyright (c) 2008 Justin Ruggles @@ -9797,13 +9779,13 @@ Copyright (c) 2008 Rob Sykes Copyright (c) 2008 Robert Marston Copyright (c) 2008 Robert Swain Copyright (c) 2008 Ronald S. Bultje -Copyright (c) 2008 Sascha Sommer (saschasommer@freenet.de) +Copyright (c) 2008 Sascha Sommer () Copyright (c) 2008 Siarhei Siamashka Copyright (c) 2008 Sisir Koppaka Copyright (c) 2008 Victor Paesa Copyright (c) 2008 Vitor Sessak Copyright (c) 2008 Vladimir Voroshilov -Copyright (c) 2008 robs@users.sourceforge.net +Copyright (c) 2008 Copyright (c) 2008 vmrsss Copyright (c) 2008, 2013 Maxim Poliakovski 2008 Benjamin Larsson 2011 David Goldwich Copyright (c) 2008-2009 Andrej Stepanchuk @@ -9811,7 +9793,7 @@ Copyright (c) 2008-2009 Gregory Maxwell Copyright (c) 2008-2009 Rob Sykes Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) Copyright (c) 2008-2010 Paul Kendall -Copyright (c) 2008-2010 Peter Ross (pross@xvid.org) +Copyright (c) 2008-2010 Peter Ross () Copyright (c) 2008-2010 Stefano Sabatini Copyright (c) 2008-2011 Octasic Inc. Copyright (c) 2008-2013 Alex Converse @@ -9831,7 +9813,7 @@ Copyright (c) 2009 Bjorn Axelsson Copyright (c) 2009 Colin McQuillan Copyright (c) 2009 Colin McQuillian Copyright (c) 2009 Daniel Verkamp -Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu) +Copyright (c) 2009 Daniel Verkamp () Copyright (c) 2009 Daniel Verkamp Copyright (c) 2009 Daniel Verkamp Copyright (c) 2009 David Conrad @@ -9923,7 +9905,7 @@ Copyright (c) 2010 Nicolas George Copyright (c) 2010 Niel van der Westhuizen Copyright (c) 2010 Nolan Lum Copyright (c) 2010 Peter Ross -Copyright (c) 2010 Peter Ross (pross@xvid.org) +Copyright (c) 2010 Peter Ross () Copyright (c) 2010 Peter Ross Copyright (c) 2010 Rafael Carre Copyright (c) 2010 Ramiro Polla @@ -9988,7 +9970,7 @@ Copyright (c) 2011 Nicolas George Copyright (c) 2011 Oskar Arvidsson Copyright (c) 2011 Pascal Getreuer Copyright (c) 2011 Paul B Mahol -Copyright (c) 2011 Peter Ross (pross@xvid.org) +Copyright (c) 2011 Peter Ross () Copyright (c) 2011 Peter Ross Copyright (c) 2011 Reimar Döffinger Copyright (c) 2011 Reinhard Tartler @@ -10189,11 +10171,11 @@ Copyright (c) 2014-2015 Muhammad Faiz Copyright (c) 2014-2016 James Almer Copyright (c) 2015 Clément Bœsch Copyright (c) 2015 Ganesh Ajjanagadde -Copyright (c) 2015 - 2017 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com) -Copyright (c) 2015 - 2017 Parag Salasakar (Parag.Salasakar@imgtec.com) -Copyright (c) 2015 - 2017 Shivraj Patil (Shivraj.Patil@imgtec.com) -Copyright (c) 2015 -2017 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com) -Copyright (c) 2015 -2017 Parag Salasakar (Parag.Salasakar@imgtec.com) +Copyright (c) 2015 - 2017 Manojkumar Bhosale () +Copyright (c) 2015 - 2017 Parag Salasakar () +Copyright (c) 2015 - 2017 Shivraj Patil () +Copyright (c) 2015 -2017 Manojkumar Bhosale () +Copyright (c) 2015 -2017 Parag Salasakar () Copyright (c) 2015 Andreas Cadhalpun Copyright (c) 2015 Anshul Maheshwari Copyright (c) 2015 Anton Khirnov @@ -10223,7 +10205,7 @@ Copyright (c) 2015 Loongson Technology Corporation Limited Copyright (c) 2015 Luca Barbato Copyright (c) 2015 Luca Barbato Copyright (c) 2015 Ludmila Glinskih -Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com) +Copyright (c) 2015 Manojkumar Bhosale () Copyright (c) 2015 Martin Storsjo Copyright (c) 2015 Mats Peterson Copyright (c) 2015 Matthieu Bouron @@ -10231,15 +10213,15 @@ Copyright (c) 2015 Michael Niedermayer Copyright (c) 2015 Muhammad Faiz Copyright (c) 2015 Nicolas George Copyright (c) 2015 Niklas Haas -Copyright (c) 2015 Parag Salasakar (Parag.Salasakar@imgtec.com) -Copyright (c) 2015 Parag Salasakar (parag.salasakar@imgtec.com) +Copyright (c) 2015 Parag Salasakar () +Copyright (c) 2015 Parag Salasakar () Copyright (c) 2015 Paul B Mahol Copyright (c) 2015 Paul B. Mahol Copyright (c) 2015 Peter Meerwald Copyright (c) 2015 Roger Pack Copyright (c) 2015 Ronald S. Bultje Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com ) -Copyright (c) 2015 Shivraj Patil (Shivraj.Patil@imgtec.com) +Copyright (c) 2015 Shivraj Patil () Copyright (c) 2015 Stephan Holljes Copyright (c) 2015 Stupeflix Copyright (c) 2015 Supraja Meedinti @@ -10272,7 +10254,7 @@ Copyright (c) 2016 James Almer Copyright (c) 2016 Jan Sebechlebsky Copyright (c) 2016 Jokyo Images Copyright (c) 2016 Josh de Kock -Copyright (c) 2016 KongQun Yang (kqyang@google.com) +Copyright (c) 2016 KongQun Yang () Copyright (c) 2016 Kyle Swanson . Copyright (c) 2016 Loongson Technology Corporation Limited Copyright (c) 2016 Martin Storsjo @@ -10280,7 +10262,7 @@ Copyright (c) 2016 Marton Balnt Copyright (c) 2016 Matthieu Bouron Copyright (c) 2016 Michael Niedermayer Copyright (c) 2016 Michael Niedermayer -Copyright (c) 2016 Mobibase, France (http://www.mobibase.com) +Copyright (c) 2016 Mobibase, France () Copyright (c) 2016 Muhammad Faiz Copyright (c) 2016 Neil Birkbeck Copyright (c) 2016 Nicolas George @@ -10317,7 +10299,7 @@ Copyright (c) 2017 James Almer Copyright (c) 2017 Jokyo Images Copyright (c) 2017 Jun Zhao Copyright (c) 2017 Kaixuan Liu -Copyright (c) 2017 Kaustubh Raste (kaustubh.raste@imgtec.com) +Copyright (c) 2017 Kaustubh Raste () Copyright (c) 2017 Konstantin Shishkov Copyright (c) 2017 Lionel CHAZALLON Copyright (c) 2017 Matthieu Bouron @@ -10336,7 +10318,7 @@ Copyright (c) 2017 Steven Liu Copyright (c) 2017 Thomas Mundt Copyright (c) 2017 Tomas Härdin Copyright (c) 2017 Vittorio Giovara -Copyright (c) 2017 samsamsam@o2.pl based on HLS demux +Copyright (c) 2017 based on HLS demux Copyright (c) 2017 sfan5 Copyright (c) 2017, NVIDIA CORPORATION. Copyright (c) 2017-2022 Paul B Mahol @@ -10378,7 +10360,7 @@ Copyright (c) 2019 Lynne Copyright (c) 2019 Manoj Gupta Bonda Copyright (c) 2019 Martin Storsjo Copyright (c) 2019 Paul B Mahol -Copyright (c) 2019 Shiyou Yin (yinshiyou-hf@loongson.cn) +Copyright (c) 2019 Shiyou Yin () Copyright (c) 2019 Swaraj Hota Copyright (c) 2019 The FFmpeg Project Copyright (c) 2019 Vladimir Panteleev @@ -10402,7 +10384,7 @@ Copyright (c) 2020 Martin Storsjo Copyright (c) 2020 Marton Balint Copyright (c) 2020 Nicolas George Copyright (c) 2020 Paul B Mahol -Copyright (c) 2020 Peter Ross (pross@xvid.org) +Copyright (c) 2020 Peter Ross () Copyright (c) 2020 Reimar Döffinger Copyright (c) 2020 Thilo Borgmann Copyright (c) 2020 Timo Rothenpieler @@ -10432,7 +10414,7 @@ Copyright (c) 2021 Niklas Haas Copyright (c) 2021 Paul B Mahol Copyright (c) 2021 Paul Buxton Copyright (c) 2021 Pekka Väänänen -Copyright (c) 2021 Peter Ross (pross@xvid.org) +Copyright (c) 2021 Peter Ross () Copyright (c) 2021 The FFmpeg project Copyright (c) 2021 Thilo Borgmann Copyright (c) 2021 Xuewei Meng @@ -10508,7 +10490,7 @@ Port copyright (c) 2010 Daniel G. Taylor SVQ1 Encoder (c) 2004 Mike Melanson VALUE "LegalCopyright", "Copyright (C) 2000-" AVSTRINGIFY(CONFIGTHISYEAR) " FFmpeg Project" avlog(NULL, level, " Copyright (c) %d-%d the FFmpeg developers", programbirthyear, CONFIGTHISYEAR); -based on code by Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) +based on code by Copyright (C) 2001-2003 Michael Niedermayer () based on libavformat/http.c, Copyright (c) 2000, 2001 Fabrice Bellard based on vivparse Copyright (c) 2007 Måns Rullgård bessel function: Copyright (c) 2006 Xiaogang Zhang @@ -10620,7 +10602,7 @@ Copyright 2019-2020 Huawei Technologies Co., Ltd License: Apache License 2.0 Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -10869,7 +10851,7 @@ Copyright 2015, The TensorFlow Authors Copyright 2022-2023 Arm Ltd. and affiliates Copyright 2018 The Android Open Source Project Copyright (c) 2005, 2006, 2007 Carabos Coop. V. All rights reserved -Copyright (c) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved +Copyright (c) 1995-1998 Eric Young () All rights reserved Copyright 2022 The OpenXLA Authors. All Rights Reserved (c) Elementwise users Copyright 2019-2023 FUJITSU LIMITED @@ -10912,7 +10894,7 @@ Copyright (c) 2015, Google Inc. Copyright 2020-2023 Arm Ltd. and affiliates Copyright 2024 The TensorFlow Authors. All rights reserved Copyright 2023 The TensorFlow Authors All Rights Reserved -Copyright (c) 2003-2005, Jean-Sebastien Roy (js@jeannot.org) +Copyright (c) 2003-2005, Jean-Sebastien Roy () Copyright (c) 1991,1997,2011 Free Software Foundation, Inc. Copyright 2018, The TensorFlow Authors Copyright 2020-2022 Intel Corporation @@ -10930,7 +10912,7 @@ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, Copyright (c) 2011, Intel Corporation. All rights reserved Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved Copyright 2006-2007 by The HDF Group -Copyright 1996 Chih-Hao Tsai Beckman Institute, University of Illinois c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 +Copyright 1996 Chih-Hao Tsai Beckman Institute, University of Illinois Copyright 2014 The Android Open Source Project Copyright (c) 2010 - 2019 ridiculous_fish, Copyright 2024 The OpenXLA Authors. All Rights Reserved @@ -10960,7 +10942,7 @@ Copyright (c) 2004 eXtensible Systems, Inc. Copyright 2022 The OpenXLA Authors Copyright 2024 The StableHLO Authors Copyright 2020 Google LLC -(c) Impl Erf +(c) Impl Erf Copyright (c) 2013, LeRoy Benjamin Sharon All rights reserved Copyright 2019 Google, LLC Copyright 2020-2021 The TensorFlow Authors. All Rights Reserved @@ -11045,7 +11027,7 @@ Copyright (c) 1998-2000 Glenn Randers-Pehrson Copyright 2018 Google LLC Copyright 2025 Google LLC. Copyright 2020 The TensorFlow Authors All Rights Reserved -Copyright (c) 2008-2013 Andrew Collette and contributors http://www.h5py.org All rights reserved +Copyright (c) 2008-2013 Andrew Collette and contributors All rights reserved Copyright (c) 2019 The Copyright 2019 The OpenXLA Authors Copyright (c) 2012 Stephen Montgomery-Smith All rights reserved @@ -11053,7 +11035,7 @@ Copyright (c) 2012 Stephen Montgomery-Smith All rights res License: Apache License Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -11253,7 +11235,7 @@ License: Apache License See the License for the specific language governing permissions and limitations under the License. -## Some of TensorFlow's code is derived from Caffe, which is subject to the following copyright notice: +## Some of TensorFlow's code is derived from Caffe, which is subject to the following copyright notice COPYRIGHT @@ -11304,23 +11286,23 @@ or otherwise, the contributor releases their content to the license and copyright terms herein. Software: coremltools 4.1 -Copyright notice: +Copyright notice: Copyright © 2020-2023, Apple Inc. All rights reserved. License: BSD 3-Clause "New" or "Revised" License Copyright © 2020-2023, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. +3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Software: caffe 1.0 -Copyright notice: +Copyright notice: All contributions by the University of California: Copyright (c) 2014-2017 The Regents of the University of California (Regents) All rights reserved. @@ -11337,13 +11319,13 @@ their copyright solely in the commit message of the change when it is committed. License: BSD 2-Clause License Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -11368,7 +11350,7 @@ Copyright @ 2019 Alibaba. All rights reserved. License: Apache License Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION diff --git a/cmake/dependency_metadef.cmake b/cmake/dependency_metadef.cmake index 7e90522d5c4dba32b9a4b12ec2ad002e3888f102..2b79c47bd39055ff4865d27ddea84237db807e97 100644 --- a/cmake/dependency_metadef.cmake +++ b/cmake/dependency_metadef.cmake @@ -20,17 +20,21 @@ else() endif() set(TMP_FILE_NAME_LIST) + foreach(file ${GE_PROTO_FILE}) get_filename_component(file_name ${file} NAME_WE) list(FIND TMP_FILE_NAME_LIST ${file_name} OUT_VAR) + if(NOT ${OUT_VAR} EQUAL "-1") list(REMOVE_ITEM GE_PROTO_FILE ${file}) endif() + list(APPEND TMP_FILE_NAME_LIST ${file_name}) endforeach() + ge_protobuf_generate(GE_PROTO_SRCS GE_PROTO_HDRS ${GE_PROTO_FILE}) add_library(ge_proto SHARED ${GE_PROTO_SRCS}) + if(NOT MSVC) set_target_properties(ge_proto PROPERTIES COMPILE_FLAGS "-Wno-unused-veriable -Wno-array-bounds") endif() - diff --git a/cmake/dependency_utils.cmake b/cmake/dependency_utils.cmake index 87b332f84a1e329f82973e71e60e42114cc9fe23..0097482b086180dc9ba4e2e307ab6c782a1bef5e 100644 --- a/cmake/dependency_utils.cmake +++ b/cmake/dependency_utils.cmake @@ -10,17 +10,17 @@ function(find_python_package out_inc out_lib) endif() execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())" - RESULT_VARIABLE result - OUTPUT_VARIABLE inc) + COMMAND "${PYTHON_EXECUTABLE}" -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())" + RESULT_VARIABLE result + OUTPUT_VARIABLE inc) string(STRIP "${inc}" inc) set(${out_inc} ${inc} PARENT_SCOPE) execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "import distutils.sysconfig as sysconfig; import os; \ + COMMAND "${PYTHON_EXECUTABLE}" -c "import distutils.sysconfig as sysconfig; import os; \ print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))" - RESULT_VARIABLE result - OUTPUT_VARIABLE lib) + RESULT_VARIABLE result + OUTPUT_VARIABLE lib) string(STRIP "${lib}" lib) set(${out_lib} ${lib} PARENT_SCOPE) endfunction() diff --git a/cmake/lite_ios.cmake b/cmake/lite_ios.cmake index 5b73eb8f2d3b30b656d1eaceb3b04f4b4223ee96..5a6bab420c7797ab96c6e54002fdac1117ff234b 100644 --- a/cmake/lite_ios.cmake +++ b/cmake/lite_ios.cmake @@ -17,6 +17,7 @@ string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}") set(FORCE_CACHE FORCE) get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) + if(_CMAKE_IN_TRY_COMPILE) unset(FORCE_CACHE) endif() @@ -29,6 +30,7 @@ if(NOT DEFINED PLATFORM) set(PLATFORM "SIMULATOR") endif() endif() + if(NOT PLATFORM) set(PLATFORM "OS") endif() @@ -46,11 +48,13 @@ endif() if(PLATFORM_INT STREQUAL "OS") set(SDK_NAME iphoneos) + if(NOT ARCHS) set(ARCHS armv7 armv7s arm64) endif() elseif(PLATFORM_INT STREQUAL "OS64") set(SDK_NAME iphoneos) + if(NOT ARCHS) if(XCODE_VERSION VERSION_GREATER 10.0) set(ARCHS arm64) @@ -60,6 +64,7 @@ elseif(PLATFORM_INT STREQUAL "OS64") endif() elseif(PLATFORM_INT STREQUAL "OS64COMBINED") set(SDK_NAME iphoneos) + if(MODERN_CMAKE) if(NOT ARCHS) if(XCODE_VERSION VERSION_GREATER 10.0) @@ -73,18 +78,22 @@ elseif(PLATFORM_INT STREQUAL "OS64COMBINED") endif() elseif(PLATFORM_INT STREQUAL "SIMULATOR") set(SDK_NAME iphonesimulator) + if(NOT ARCHS) set(ARCHS i386) endif() + message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.") elseif(PLATFORM_INT STREQUAL "SIMULATOR64") set(SDK_NAME iphonesimulator) + if(NOT ARCHS) set(ARCHS x86_64) endif() else() message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}") endif() + message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}") if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode") @@ -92,16 +101,17 @@ if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERAT endif() execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path - OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT) message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain" - "is pointing to the correct path. Please run:" - "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" - "and see if that fixes the problem for you.") + "is pointing to the correct path. Please run:" + "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" + "and see if that fixes the problem for you.") message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} " - "does not exist.") + "does not exist.") elseif(DEFINED CMAKE_OSX_SYSROOT) message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${PLATFORM_INT} when checking compatibility") elseif(DEFINED CMAKE_OSX_SYSROOT_INT) @@ -117,6 +127,7 @@ if(NOT DEFINED DEPLOYMENT_TARGET) set(DEPLOYMENT_TARGET "9.0" CACHE STRING "Minimum SDK version to build for.") message(STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!") endif() + if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|;|, )(i386|x86_64))+") message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!") set(ENABLE_BITCODE TRUE) @@ -124,30 +135,38 @@ elseif(NOT DEFINED ENABLE_BITCODE) message(STATUS "Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!") set(ENABLE_BITCODE FALSE) endif() + set(ENABLE_BITCODE_INT ${ENABLE_BITCODE} CACHE BOOL "Whether or not to enable bitcode" ${FORCE_CACHE}) + if(NOT DEFINED ENABLE_ARC) set(ENABLE_ARC TRUE) message(STATUS "Enabling ARC support by default. ENABLE_ARC not provided!") endif() + set(ENABLE_ARC_INT ${ENABLE_ARC} CACHE BOOL "Whether or not to enable ARC" ${FORCE_CACHE}) + if(NOT DEFINED ENABLE_VISIBILITY) set(ENABLE_VISIBILITY FALSE) message(STATUS "Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!") endif() + set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY} CACHE BOOL - "Whether or not to hide symbols (-fvisibility=hidden)" ${FORCE_CACHE}) + "Whether or not to hide symbols (-fvisibility=hidden)" ${FORCE_CACHE}) + # Set strict compiler checks or not if(NOT DEFINED ENABLE_STRICT_TRY_COMPILE) set(ENABLE_STRICT_TRY_COMPILE FALSE) message(STATUS "Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!") endif() + set(ENABLE_STRICT_TRY_COMPILE_INT ${ENABLE_STRICT_TRY_COMPILE} CACHE BOOL - "Whether or not to use strict compiler checks" ${FORCE_CACHE}) + "Whether or not to use strict compiler checks" ${FORCE_CACHE}) + # Get the SDK version information. execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion - OUTPUT_VARIABLE SDK_VERSION - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE SDK_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode") get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH) @@ -155,48 +174,50 @@ if(NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode" if(NOT DEFINED CMAKE_DEVELOPER_ROOT) message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: " - "${CMAKE_DEVELOPER_ROOT} does not exist.") + "${CMAKE_DEVELOPER_ROOT} does not exist.") endif() endif() + if(NOT CMAKE_C_COMPILER) execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang - OUTPUT_VARIABLE CMAKE_C_COMPILER - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CMAKE_C_COMPILER + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}") endif() + if(NOT CMAKE_CXX_COMPILER) execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find clang++ - OUTPUT_VARIABLE CMAKE_CXX_COMPILER - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CMAKE_CXX_COMPILER + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}") endif() + execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool - OUTPUT_VARIABLE BUILD_LIBTOOL - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE BUILD_LIBTOOL + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Using libtool: ${BUILD_LIBTOOL}") - set(CMAKE_C_CREATE_STATIC_LIBRARY - "${BUILD_LIBTOOL} -static -o ") + "${BUILD_LIBTOOL} -static -o ") set(CMAKE_CXX_CREATE_STATIC_LIBRARY - "${BUILD_LIBTOOL} -static -o ") + "${BUILD_LIBTOOL} -static -o ") if(NOT CMAKE_INSTALL_NAME_TOOL) execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find install_name_tool - OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL_INT - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL_INT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) set(CMAKE_INSTALL_NAME_TOOL ${CMAKE_INSTALL_NAME_TOOL_INT} CACHE STRING "" ${FORCE_CACHE}) message(STATUS "Using install_name_tool: ${CMAKE_INSTALL_NAME_TOOL}") endif() execute_process(COMMAND uname -r - OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) if(MODERN_CMAKE) if(SDK_NAME MATCHES "iphone") @@ -211,6 +232,7 @@ if(MODERN_CMAKE) else() set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE}) endif() + set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "") set(UNIX TRUE CACHE BOOL "") set(APPLE TRUE CACHE BOOL "") @@ -219,11 +241,13 @@ set(CMAKE_AR ar CACHE FILEPATH "" FORCE) set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE) set(CMAKE_STRIP strip CACHE FILEPATH "" FORCE) set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS") + if(ENABLE_STRICT_TRY_COMPILE_INT) message(STATUS "Using strict compiler checks (default in CMake).") else() set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) endif() + set(CMAKE_SHARED_LIBRARY_PREFIX "lib") set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib") set(CMAKE_SHARED_MODULE_PREFIX "lib") @@ -242,11 +266,13 @@ set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}") if(ARCHS MATCHES "((^|;|, )(arm64|arm64e|x86_64))+") set(CMAKE_C_SIZEOF_DATA_PTR 8) set(CMAKE_CXX_SIZEOF_DATA_PTR 8) + if(ARCHS MATCHES "((^|;|, )(arm64|arm64e))+") set(CMAKE_SYSTEM_PROCESSOR "aarch64") else() set(CMAKE_SYSTEM_PROCESSOR "x86_64") endif() + message(STATUS "Using a data_ptr size of 8") else() set(CMAKE_C_SIZEOF_DATA_PTR 4) @@ -266,6 +292,7 @@ if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64") else() set(SDK_NAME_VERSION_FLAGS "-mios-simulator-version-min=${DEPLOYMENT_TARGET}") endif() + message(STATUS "Version flags set to: ${SDK_NAME_VERSION_FLAGS}") set(CMAKE_OSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET} CACHE STRING "Set CMake deployment target" ${FORCE_CACHE}) @@ -303,25 +330,26 @@ if(USED_CMAKE_GENERATOR MATCHES "Xcode") else() set(CMAKE_C_FLAGS "${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS - "${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} + "${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_C_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") set(CMAKE_CXX_LINK_FLAGS "${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") list(APPEND VARS_TO_FORCE_IN_CACHE - CMAKE_C_FLAGS - CMAKE_CXX_FLAGS - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELEASE - CMAKE_C_LINK_FLAGS - CMAKE_CXX_LINK_FLAGS) + CMAKE_C_FLAGS + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_LINK_FLAGS + CMAKE_CXX_LINK_FLAGS) + foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE}) set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "") endforeach() @@ -337,25 +365,28 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a") set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name") set(CMAKE_FIND_ROOT_PATH - ${CMAKE_OSX_SYSROOT_INT} ${CMAKE_PREFIX_PATH} - CACHE STRING "Root path that will be prepended to all search paths") + ${CMAKE_OSX_SYSROOT_INT} ${CMAKE_PREFIX_PATH} + CACHE STRING "Root path that will be prepended to all search paths") set(CMAKE_FIND_FRAMEWORK FIRST) set(CMAKE_FRAMEWORK_PATH - ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks - ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks - ${CMAKE_FRAMEWORK_PATH} CACHE STRING "Frameworks search paths" ${FORCE_CACHE}) + ${CMAKE_DEVELOPER_ROOT}/Library/PrivateFrameworks + ${CMAKE_OSX_SYSROOT_INT}/System/Library/Frameworks + ${CMAKE_FRAMEWORK_PATH} CACHE STRING "Frameworks search paths" ${FORCE_CACHE}) if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE STRING "" ${FORCE_CACHE}) endif() + if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY CACHE STRING "" ${FORCE_CACHE}) endif() + if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY CACHE STRING "" ${FORCE_CACHE}) endif() + if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY CACHE STRING "" ${FORCE_CACHE}) endif() diff --git a/cmake/package_lite.cmake b/cmake/package_lite.cmake index ea62255a13325da379465ea216d6dcdf574fbe8e..6b6791be499c97a008e76ceb7ab40c0ef3db5c83 100644 --- a/cmake/package_lite.cmake +++ b/cmake/package_lite.cmake @@ -369,6 +369,10 @@ if(PLATFORM_ARM64) COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + if(EXISTS "${DDK_LIB_PATH}/libhiai_model_compatible.so") + install(FILES ${DDK_LIB_PATH}/libhiai_model_compatible.so + DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + endif() if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so") install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) @@ -615,6 +619,10 @@ if(PLATFORM_ARM64) COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${TEST_CASE_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + if(EXISTS "${DDK_LIB_PATH}/libhiai_model_compatible.so") + install(FILES ${DDK_LIB_PATH}/libhiai_model_compatible.so + DESTINATION ${TEST_CASE_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) + endif() if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so") install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so DESTINATION ${TEST_CASE_DIR} COMPONENT ${RUNTIME_COMPONENT_NAME}) @@ -629,6 +637,10 @@ elseif(PLATFORM_ARM32) COMPONENT ${RUNTIME_COMPONENT_NAME}) install(FILES ${DDK_LIB_PATH}/libhiai_ir_build.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + if(EXISTS "${DDK_LIB_PATH}/libhiai_model_compatible.so") + install(FILES ${DDK_LIB_PATH}/libhiai_model_compatible.so + DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + endif() if(EXISTS "${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so") install(FILES ${DDK_LIB_PATH}/libhiai_hcl_model_runtime.so DESTINATION ${RUNTIME_DIR}/third_party/hiai_ddk/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) diff --git a/cmake/package_micro.cmake b/cmake/package_micro.cmake index 3f0c5ccad83e28b6bfe2d3e27f20a37f570a172f..df1030b22e94db680743c01849da0d8ea3ba68ef 100644 --- a/cmake/package_micro.cmake +++ b/cmake/package_micro.cmake @@ -2,44 +2,45 @@ set(CODEGEN_ROOT_DIR ${RUNTIME_PKG_NAME}/tools/codegen) set(MICRO_DIR ${TOP_DIR}/mindspore-lite/tools/converter/micro) function(__install_micro_wrapper) - file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h) - install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/fp16 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(FILES ${NNACL_DIR}/fp32_grad/activation_grad_fp32.h DESTINATION - ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(FILES ${NNACL_DIR}/fp32_grad/softmax_cross_entropy_with_logits.h DESTINATION - ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(DIRECTORY ${NNACL_DIR}/kernel DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/infer DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/experimental DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${MICRO_DIR}/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) - install(TARGETS nnacl_static ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + file(GLOB NNACL_FILES GLOB ${NNACL_DIR}/*.h) + install(FILES ${NNACL_FILES} DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(DIRECTORY ${NNACL_DIR}/base DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/int8 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/fp32 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/fp16 DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(FILES ${NNACL_DIR}/fp32_grad/activation_grad_fp32.h DESTINATION + ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(FILES ${NNACL_DIR}/fp32_grad/softmax_cross_entropy_with_logits.h DESTINATION + ${CODEGEN_ROOT_DIR}/include/nnacl/fp32_grad COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(DIRECTORY ${NNACL_DIR}/kernel DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/infer DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/experimental DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${NNACL_DIR}/intrinsics DESTINATION ${CODEGEN_ROOT_DIR}/include/nnacl + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${MICRO_DIR}/coder/wrapper DESTINATION ${CODEGEN_ROOT_DIR}/include + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(TARGETS wrapper ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) + install(TARGETS nnacl_static ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/lib COMPONENT ${RUNTIME_COMPONENT_NAME}) endfunction() function(__install_micro_codegen) - set(MICRO_CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis/CMSIS) - install(DIRECTORY ${MICRO_CMSIS_DIR}/Core/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/Core - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${MICRO_CMSIS_DIR}/DSP/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/DSP - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - install(DIRECTORY ${MICRO_CMSIS_DIR}/NN/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/NN - COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") - if(MSLITE_DEPS_CMSIS) - install(TARGETS cmsis_nn ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/third_party/lib - COMPONENT ${RUNTIME_COMPONENT_NAME}) - endif() + set(MICRO_CMSIS_DIR ${CMAKE_BINARY_DIR}/cmsis/CMSIS) + install(DIRECTORY ${MICRO_CMSIS_DIR}/Core/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/Core + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${MICRO_CMSIS_DIR}/DSP/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/DSP + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + install(DIRECTORY ${MICRO_CMSIS_DIR}/NN/Include DESTINATION ${CODEGEN_ROOT_DIR}/third_party/include/CMSIS/NN + COMPONENT ${RUNTIME_COMPONENT_NAME} FILES_MATCHING PATTERN "*.h") + + if(MSLITE_DEPS_CMSIS) + install(TARGETS cmsis_nn ARCHIVE DESTINATION ${CODEGEN_ROOT_DIR}/third_party/lib + COMPONENT ${RUNTIME_COMPONENT_NAME}) + endif() endfunction() diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 3c341b3fd622bac02ddda193e377c187bac5a784..103957a4a13573344ae8f43f90d2d9b0ccfa0c39 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -6,25 +6,25 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_VERSION} VERSION_GREATER_EQUA endif() function(mindspore_add_submodule_obj des_submodule_objs sub_dir submodule_name_obj) - add_subdirectory(${sub_dir}) if(NOT TARGET ${submodule_name_obj}) message(FATAL_ERROR "Can not find submodule '${submodule_name_obj}'. in ${CMAKE_CURRENT_LIST_FILE}") endif() + if("$" IN_LIST ${des_submodule_objs}) message(FATAL_ERROR "submodule '${submodule_name_obj}' added more than once. in ${CMAKE_CURRENT_LIST_FILE}") endif() set(${des_submodule_objs} ${${des_submodule_objs}} $ PARENT_SCOPE) - endfunction() if(DEFINED ENV{MSLIBS_CACHE_PATH}) - set(_MS_LIB_CACHE $ENV{MSLIBS_CACHE_PATH}) + set(_MS_LIB_CACHE $ENV{MSLIBS_CACHE_PATH}) else() set(_MS_LIB_CACHE ${CMAKE_BINARY_DIR}/.mslib) endif() + message("MS LIBS CACHE PATH: ${_MS_LIB_CACHE}") if(NOT EXISTS ${_MS_LIB_CACHE}) @@ -32,22 +32,25 @@ if(NOT EXISTS ${_MS_LIB_CACHE}) endif() if(DEFINED ENV{MSLIBS_SERVER} AND NOT ENABLE_GITEE) - set(LOCAL_LIBS_SERVER $ENV{MSLIBS_SERVER}) + set(LOCAL_LIBS_SERVER $ENV{MSLIBS_SERVER}) message("LOCAL_LIBS_SERVER: ${LOCAL_LIBS_SERVER}") endif() include(ProcessorCount) ProcessorCount(N) + if(JOBS) set(THNUM ${JOBS}) else() set(JOBS 8) + if(${JOBS} GREATER ${N}) set(THNUM ${N}) else() set(THNUM ${JOBS}) endif() endif() + message("set make thread num: ${THNUM}") if(LOCAL_LIBS_SERVER) @@ -55,6 +58,7 @@ if(LOCAL_LIBS_SERVER) set(ENV{no_proxy} "${LOCAL_LIBS_SERVER}") else() string(FIND $ENV{no_proxy} ${LOCAL_LIBS_SERVER} IP_POS) + if(${IP_POS} EQUAL -1) set(ENV{no_proxy} "$ENV{no_proxy},${LOCAL_LIBS_SERVER}") endif() @@ -63,6 +67,7 @@ endif() function(__download_pkg pkg_name pkg_url pkg_sha256) set(custom_func "") + if(ARGN) list(GET ARGN 0 custom_func) endif() @@ -70,6 +75,7 @@ function(__download_pkg pkg_name pkg_url pkg_sha256) if(LOCAL_LIBS_SERVER) set(REGEX_IP_ADDRESS "^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)$") get_filename_component(_URL_FILE_NAME ${pkg_url} NAME) + if(${LOCAL_LIBS_SERVER} MATCHES ${REGEX_IP_ADDRESS}) set(pkg_url "http://${LOCAL_LIBS_SERVER}:8081/libs/${pkg_name}/${_URL_FILE_NAME}" ${pkg_url}) else() @@ -78,12 +84,13 @@ function(__download_pkg pkg_name pkg_url pkg_sha256) endif() FetchContent_Declare( - ${pkg_name} - URL ${pkg_url} - URL_HASH SHA256=${pkg_sha256} + ${pkg_name} + URL ${pkg_url} + URL_HASH SHA256=${pkg_sha256} ) FetchContent_GetProperties(${pkg_name}) message("download: ${${pkg_name}_SOURCE_DIR} , ${pkg_name} , ${pkg_url}") + if(NOT ${pkg_name}_POPULATED) FetchContent_Populate(${pkg_name}) set(${pkg_name}_SOURCE_DIR ${${pkg_name}_SOURCE_DIR} PARENT_SCOPE) @@ -92,34 +99,32 @@ function(__download_pkg pkg_name pkg_url pkg_sha256) cmake_language(CALL ${custom_func}) endif() endif() - endfunction() function(__download_pkg_with_git pkg_name pkg_url pkg_git_commit pkg_sha256) - if(LOCAL_LIBS_SERVER) set(pkg_url "http://${LOCAL_LIBS_SERVER}:8081/libs/${pkg_name}/${pkg_git_commit}") FetchContent_Declare( - ${pkg_name} - URL ${pkg_url} - URL_HASH SHA256=${pkg_sha256} - ) + ${pkg_name} + URL ${pkg_url} + URL_HASH SHA256=${pkg_sha256} + ) else() - FetchContent_Declare( + FetchContent_Declare( ${pkg_name} - GIT_REPOSITORY ${pkg_url} - GIT_TAG ${pkg_git_commit}) + GIT_REPOSITORY ${pkg_url} + GIT_TAG ${pkg_git_commit}) endif() + FetchContent_GetProperties(${pkg_name}) message("download: ${${pkg_name}_SOURCE_DIR} , ${pkg_name} , ${pkg_url}") + if(NOT ${pkg_name}_POPULATED) FetchContent_Populate(${pkg_name}) set(${pkg_name}_SOURCE_DIR ${${pkg_name}_SOURCE_DIR} PARENT_SCOPE) endif() - endfunction() - function(__find_pkg_then_add_target pkg_name pkg_exe lib_path) set(options) set(oneValueArgs PATH) @@ -133,40 +138,49 @@ function(__find_pkg_then_add_target pkg_name pkg_exe lib_path) if(pkg_exe) unset(${pkg_exe}_EXE CACHE) find_program(${pkg_exe}_EXE ${pkg_exe} PATHS ${${pkg_name}_BASE_DIR}/bin NO_DEFAULT_PATH) + if(NOT ${pkg_exe}_EXE) return() endif() + add_executable(${pkg_name}::${pkg_exe} IMPORTED GLOBAL) set_target_properties(${pkg_name}::${pkg_exe} PROPERTIES - IMPORTED_LOCATION ${${pkg_exe}_EXE} - ) + IMPORTED_LOCATION ${${pkg_exe}_EXE} + ) message("found ${${pkg_exe}_EXE}") endif() foreach(_LIB_NAME ${LIB_NAMES}) set(_LIB_SEARCH_NAME ${_LIB_NAME}) + if(MSVC AND ${pkg_name}_Debug) set(_LIB_SEARCH_NAME ${_LIB_SEARCH_NAME}d) endif() + set(_LIB_TYPE SHARED) + if(${pkg_name}_USE_STATIC_LIBS) set(_LIB_SEARCH_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}${_LIB_SEARCH_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") set(_LIB_TYPE STATIC) endif() + set(${_LIB_NAME}_LIB ${_LIB_NAME}_LIB-NOTFOUND) + if(APPLE) find_library(${_LIB_NAME}_LIB ${_LIB_SEARCH_NAME} PATHS ${${pkg_name}_BASE_DIR}/${lib_path} - PATH_SUFFIXES ${LIB_SUFFIXES_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + PATH_SUFFIXES ${LIB_SUFFIXES_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) else() find_library(${_LIB_NAME}_LIB ${_LIB_SEARCH_NAME} PATHS ${${pkg_name}_BASE_DIR}/${lib_path} - PATH_SUFFIXES ${LIB_SUFFIXES_PATH} NO_DEFAULT_PATH) + PATH_SUFFIXES ${LIB_SUFFIXES_PATH} NO_DEFAULT_PATH) endif() + if(NOT ${_LIB_NAME}_LIB) message("not find ${_LIB_SEARCH_NAME} in path: ${${pkg_name}_BASE_DIR}/${lib_path}") return() endif() add_library(${pkg_name}::${_LIB_NAME} ${_LIB_TYPE} IMPORTED GLOBAL) + if(WIN32 AND ${_LIB_TYPE} STREQUAL "SHARED") if(DEBUG_MODE) set_target_properties(${pkg_name}::${_LIB_NAME} PROPERTIES IMPORTED_IMPLIB_DEBUG ${${_LIB_NAME}_LIB}) @@ -200,8 +214,9 @@ function(__exec_cmd) cmake_parse_arguments(EXEC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) execute_process(COMMAND ${EXEC_COMMAND} - WORKING_DIRECTORY ${EXEC_WORKING_DIRECTORY} - RESULT_VARIABLE RESULT) + WORKING_DIRECTORY ${EXEC_WORKING_DIRECTORY} + RESULT_VARIABLE RESULT) + if(NOT RESULT EQUAL "0") message(FATAL_ERROR "error! when ${EXEC_COMMAND} in ${EXEC_WORKING_DIRECTORY}") endif() @@ -216,6 +231,7 @@ function(__check_patches pkg_patches) message("patches sha256:${${pkg_name}_PATCHES_SHA256}") set(${pkg_name}_PATCHES_NEW_SHA256) + foreach(_PATCH ${PKG_PATCHES}) file(SHA256 ${_PATCH} _PF_SHA256) set(${pkg_name}_PATCHES_NEW_SHA256 "${${pkg_name}_PATCHES_NEW_SHA256},${_PF_SHA256}") @@ -231,17 +247,17 @@ function(__check_patches pkg_patches) endfunction() set(MS_FIND_NO_DEFAULT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH - NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH - NO_CMAKE_SYSTEM_PACKAGE_REGISTRY) -function(mindspore_add_pkg pkg_name) + NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH + NO_CMAKE_SYSTEM_PACKAGE_REGISTRY) +function(mindspore_add_pkg pkg_name) set(options) set(oneValueArgs URL SHA256 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY CMAKE_PATH RELEASE - LIB_PATH CUSTOM_CMAKE CUSTOM_SUBMODULE_DOWNLOAD CUSTOM_SUBMODULE_INFO) + LIB_PATH CUSTOM_CMAKE CUSTOM_SUBMODULE_DOWNLOAD CUSTOM_SUBMODULE_INFO) set(multiValueArgs - CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS - INSTALL_LIBS PATCHES SUBMODULES SOURCEMODULES ONLY_MAKE ONLY_MAKE_INCS ONLY_MAKE_LIBS - LIB_SUFFIXES_PATH) + CMAKE_OPTION LIBS PRE_CONFIGURE_COMMAND CONFIGURE_COMMAND BUILD_OPTION INSTALL_INCS + INSTALL_LIBS PATCHES SUBMODULES SOURCEMODULES ONLY_MAKE ONLY_MAKE_INCS ONLY_MAKE_LIBS + LIB_SUFFIXES_PATH) cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT PKG_LIB_PATH) @@ -257,6 +273,7 @@ function(mindspore_add_pkg pkg_name) message("pkg name:${__FIND_PKG_NAME},${pkg_name}") set(${pkg_name}_PATCHES_HASH) + foreach(_PATCH ${PKG_PATCHES}) file(SHA256 ${_PATCH} _PF_SHA256) set(${pkg_name}_PATCHES_HASH "${${pkg_name}_PATCHES_HASH},${_PF_SHA256}") @@ -265,17 +282,21 @@ function(mindspore_add_pkg pkg_name) # strip directory variables to ensure third party packages are installed in consistent locations string(REPLACE ${TOP_DIR} "" ARGN_STRIPPED ${ARGN}) string(REPLACE ${_MS_LIB_CACHE} "" ARGN_STRIPPED ${ARGN_STRIPPED}) + # check options set(${pkg_name}_CONFIG_TXT - "${CMAKE_CXX_COMPILER_VERSION}-${CMAKE_C_COMPILER_VERSION} + "${CMAKE_CXX_COMPILER_VERSION}-${CMAKE_C_COMPILER_VERSION} ${ARGN_STRIPPED}-${${pkg_name}_USE_STATIC_LIBS}-${${pkg_name}_PATCHES_HASH} ${${pkg_name}_CXXFLAGS}-${${pkg_name}_CFLAGS}-${${pkg_name}_LDFLAGS}") + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(${pkg_name}_CONFIG_TXT "${${pkg_name}_CONFIG_TXT}--${CMAKE_OSX_DEPLOYMENT_TARGET}") endif() + if(PKG_CUSTOM_SUBMODULE_INFO) set(${pkg_name}_CONFIG_TXT "${${pkg_name}_CONFIG_TXT}-${PKG_CUSTOM_SUBMODULE_INFO}") endif() + string(REPLACE ";" "-" ${pkg_name}_CONFIG_TXT ${${pkg_name}_CONFIG_TXT}) string(SHA256 ${pkg_name}_CONFIG_HASH ${${pkg_name}_CONFIG_TXT}) @@ -288,10 +309,11 @@ function(mindspore_add_pkg pkg_name) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/${PKG_HEAD_ONLY} PARENT_SCOPE) add_library(${pkg_name} INTERFACE) target_include_directories(${pkg_name} INTERFACE ${${pkg_name}_INC}) + if(${PKG_RELEASE}) __find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} - SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} - NAMES ${PKG_LIBS}) + SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} + NAMES ${PKG_LIBS}) endif() return() endif() @@ -301,8 +323,9 @@ function(mindspore_add_pkg pkg_name) if(PKG_LIBS) __find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} - SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} - NAMES ${PKG_LIBS}) + SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} + NAMES ${PKG_LIBS}) + if(${pkg_name}_LIBS) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE) message("Found libs: ${${pkg_name}_LIBS}") @@ -310,6 +333,7 @@ function(mindspore_add_pkg pkg_name) endif() elseif(NOT PKG_HEAD_ONLY) find_package(${__FIND_PKG_NAME} ${PKG_VER} PATHS ${${pkg_name}_BASE_DIR} ${MS_FIND_NO_DEFAULT_PATH}) + if(${__FIND_PKG_NAME}_FOUND) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE) message("Found pkg: ${__FIND_PKG_NAME}") @@ -327,6 +351,7 @@ function(mindspore_add_pkg pkg_name) __download_pkg(${pkg_name} ${PKG_URL} ${PKG_SHA256}) endif() endif() + foreach(_SUBMODULE_FILE ${PKG_SUBMODULES}) STRING(REGEX REPLACE "(.+)_(.+)" "\\1" _SUBMODEPATH ${_SUBMODULE_FILE}) STRING(REGEX REPLACE "(.+)/(.+)" "\\2" _SUBMODENAME ${_SUBMODEPATH}) @@ -336,6 +361,7 @@ function(mindspore_add_pkg pkg_name) else() set(${pkg_name}_SOURCE_DIR ${PKG_DIR}) endif() + file(WRITE ${${pkg_name}_BASE_DIR}/options.txt ${${pkg_name}_CONFIG_TXT}) message("${pkg_name}_SOURCE_DIR : ${${pkg_name}_SOURCE_DIR}") @@ -354,24 +380,28 @@ function(mindspore_add_pkg pkg_name) foreach(_PATCH_SOURCE ${_PATCH_SOURCE_LIST}) if(EXISTS ${${pkg_name}_SOURCE_DIR}/${_PATCH_SOURCE}) execute_process(COMMAND bash -c "sed -i \'s@\\r@@g\' ${${pkg_name}_SOURCE_DIR}/${_PATCH_SOURCE}" - COMMAND_ECHO STDOUT) + COMMAND_ECHO STDOUT) endif() endforeach() # apply patch message("patching ${${pkg_name}_SOURCE_DIR} -p1 < ${_LF_PATCH_FILE}") execute_process(COMMAND ${Patch_EXECUTABLE} -p1 INPUT_FILE ${_LF_PATCH_FILE} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR} - RESULT_VARIABLE Result) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR} + RESULT_VARIABLE Result) + if(NOT Result EQUAL "0") message(FATAL_ERROR "Failed patch: ${_LF_PATCH_FILE}") endif() endforeach() + foreach(_SOURCE_DIR ${PKG_SOURCEMODULES}) file(GLOB ${pkg_name}_INSTALL_SOURCE ${${pkg_name}_SOURCE_DIR}/${_SOURCE_DIR}/*) file(COPY ${${pkg_name}_INSTALL_SOURCE} DESTINATION ${${pkg_name}_BASE_DIR}/${_SOURCE_DIR}/) endforeach() + file(LOCK ${${pkg_name}_BASE_DIR} DIRECTORY GUARD FUNCTION RESULT_VARIABLE ${pkg_name}_LOCK_RET TIMEOUT 600) + if(NOT ${pkg_name}_LOCK_RET EQUAL "0") message(FATAL_ERROR "error! when try lock ${${pkg_name}_BASE_DIR} : ${${pkg_name}_LOCK_RET}") endif() @@ -386,6 +416,7 @@ function(mindspore_add_pkg pkg_name) file(GLOB ${pkg_name}_SOURCE_SUBDIRS ${${pkg_name}_SOURCE_DIR}/*) file(COPY ${${pkg_name}_SOURCE_SUBDIRS} DESTINATION ${${pkg_name}_BASE_DIR}) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/${PKG_HEAD_ONLY} PARENT_SCOPE) + if(NOT PKG_RELEASE) add_library(${pkg_name} INTERFACE) target_include_directories(${pkg_name} INTERFACE ${${pkg_name}_INC}) @@ -393,7 +424,7 @@ function(mindspore_add_pkg pkg_name) elseif(PKG_ONLY_MAKE) __exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_CXXFLAGS} -j${THNUM} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) set(PKG_INSTALL_INCS ${PKG_ONLY_MAKE_INCS}) set(PKG_INSTALL_LIBS ${PKG_ONLY_MAKE_LIBS}) file(GLOB ${pkg_name}_INSTALL_INCS ${${pkg_name}_SOURCE_DIR}/${PKG_INSTALL_INCS}) @@ -404,39 +435,45 @@ function(mindspore_add_pkg pkg_name) elseif(PKG_CMAKE_OPTION) # in cmake file(MAKE_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) + if(${pkg_name}_CFLAGS) set(${pkg_name}_CMAKE_CFLAGS "-DCMAKE_C_FLAGS=${${pkg_name}_CFLAGS}") endif() + if(${pkg_name}_CXXFLAGS) set(${pkg_name}_CMAKE_CXXFLAGS "-DCMAKE_CXX_FLAGS=${${pkg_name}_CXXFLAGS}") endif() if(${pkg_name}_LDFLAGS) if(${pkg_name}_USE_STATIC_LIBS) - #set(${pkg_name}_CMAKE_LDFLAGS "-DCMAKE_STATIC_LINKER_FLAGS=${${pkg_name}_LDFLAGS}") + # set(${pkg_name}_CMAKE_LDFLAGS "-DCMAKE_STATIC_LINKER_FLAGS=${${pkg_name}_LDFLAGS}") else() set(${pkg_name}_CMAKE_LDFLAGS "-DCMAKE_SHARED_LINKER_FLAGS=${${pkg_name}_LDFLAGS}") endif() endif() + if(APPLE) __exec_cmd(COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_COMPILER_ARG1=${CMAKE_CXX_COMPILER_ARG1} - -DCMAKE_C_COMPILER_ARG1=${CMAKE_C_COMPILER_ARG1} ${PKG_CMAKE_OPTION} - ${${pkg_name}_CMAKE_CFLAGS} ${${pkg_name}_CMAKE_CXXFLAGS} ${${pkg_name}_CMAKE_LDFLAGS} - -DCMAKE_INSTALL_PREFIX=${${pkg_name}_BASE_DIR} ${${pkg_name}_SOURCE_DIR}/${PKG_CMAKE_PATH} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) + -DCMAKE_C_COMPILER_ARG1=${CMAKE_C_COMPILER_ARG1} ${PKG_CMAKE_OPTION} + ${${pkg_name}_CMAKE_CFLAGS} ${${pkg_name}_CMAKE_CXXFLAGS} ${${pkg_name}_CMAKE_LDFLAGS} + -DCMAKE_INSTALL_PREFIX=${${pkg_name}_BASE_DIR} ${${pkg_name}_SOURCE_DIR}/${PKG_CMAKE_PATH} + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) __exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --target install -- - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) else() __exec_cmd(COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_COMPILER_ARG1=${CMAKE_CXX_COMPILER_ARG1} - -DCMAKE_C_COMPILER_ARG1=${CMAKE_C_COMPILER_ARG1} ${PKG_CMAKE_OPTION} -G ${CMAKE_GENERATOR} + -DCMAKE_C_COMPILER_ARG1=${CMAKE_C_COMPILER_ARG1} ${PKG_CMAKE_OPTION} -G ${CMAKE_GENERATOR} ${${pkg_name}_CMAKE_CFLAGS} ${${pkg_name}_CMAKE_CXXFLAGS} ${${pkg_name}_CMAKE_LDFLAGS} -DCMAKE_INSTALL_PREFIX=${${pkg_name}_BASE_DIR} ${${pkg_name}_SOURCE_DIR}/${PKG_CMAKE_PATH} WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) + if(MSVC) set(CONFIG_TYPE Release) + if(DEBUG_MODE) set(CONFIG_TYPE Debug) endif() + __exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG_TYPE} --target install -- WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build) else() @@ -448,36 +485,42 @@ function(mindspore_add_pkg pkg_name) if(${pkg_name}_CFLAGS) set(${pkg_name}_MAKE_CFLAGS "CFLAGS=${${pkg_name}_CFLAGS}") endif() + if(${pkg_name}_CXXFLAGS) set(${pkg_name}_MAKE_CXXFLAGS "CXXFLAGS=${${pkg_name}_CXXFLAGS}") endif() + if(${pkg_name}_LDFLAGS) set(${pkg_name}_MAKE_LDFLAGS "LDFLAGS=${${pkg_name}_LDFLAGS}") endif() + # in configure && make if(PKG_PRE_CONFIGURE_COMMAND) __exec_cmd(COMMAND ${PKG_PRE_CONFIGURE_COMMAND} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) endif() if(PKG_CONFIGURE_COMMAND) __exec_cmd(COMMAND ${PKG_CONFIGURE_COMMAND} - ${${pkg_name}_MAKE_CFLAGS} ${${pkg_name}_MAKE_CXXFLAGS} ${${pkg_name}_MAKE_LDFLAGS} - --prefix=${${pkg_name}_BASE_DIR} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) + ${${pkg_name}_MAKE_CFLAGS} ${${pkg_name}_MAKE_CXXFLAGS} ${${pkg_name}_MAKE_LDFLAGS} + --prefix=${${pkg_name}_BASE_DIR} + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) endif() + set(${pkg_name}_BUILD_OPTION ${PKG_BUILD_OPTION}) + if(NOT PKG_CONFIGURE_COMMAND) set(${pkg_name}_BUILD_OPTION ${${pkg_name}_BUILD_OPTION} - ${${pkg_name}_MAKE_CFLAGS} ${${pkg_name}_MAKE_CXXFLAGS} ${${pkg_name}_MAKE_LDFLAGS}) + ${${pkg_name}_MAKE_CFLAGS} ${${pkg_name}_MAKE_CXXFLAGS} ${${pkg_name}_MAKE_LDFLAGS}) endif() + # build if(APPLE) __exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_BUILD_OPTION} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) else() __exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_BUILD_OPTION} -j${THNUM} - WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) + WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}) endif() if(PKG_INSTALL_INCS OR PKG_INSTALL_LIBS) @@ -493,14 +536,16 @@ function(mindspore_add_pkg pkg_name) if(PKG_LIBS) __find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} - SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} - NAMES ${PKG_LIBS}) + SUFFIXES_PATH ${PKG_LIB_SUFFIXES_PATH} + NAMES ${PKG_LIBS}) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE) + if(NOT ${pkg_name}_LIBS) message(FATAL_ERROR "Can not find pkg: ${pkg_name}") endif() else() find_package(${__FIND_PKG_NAME} ${PKG_VER} QUIET ${MS_FIND_NO_DEFAULT_PATH}) + if(${__FIND_PKG_NAME}_FOUND) set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE) message("Found pkg: ${${__FIND_PKG_NAME}_LIBRARIES}") @@ -520,16 +565,20 @@ function(src_separate_compile) set(SEPARATE_INDEX 0) set(OBJECT_COUNT 0) math(EXPR SRC_LIST_MAX_INDEX "${SRC_LIST_SIZE} - 1") + while(${SRC_LIST_SIZE} GREATER ${SEPARATE_INDEX}) math(EXPR SEPARATE_END "${SEPARATE_INDEX} + ${SEPARATE_SIZE} - 1") + if(${SEPARATE_END} GREATER ${SRC_LIST_MAX_INDEX}) math(EXPR SEPARATE_SIZE "${SRC_LIST_SIZE} - ${SEPARATE_INDEX}") endif() + list(SUBLIST STUDENT_SRC_LIST ${SEPARATE_INDEX} ${SEPARATE_SIZE} new_sub_list) math(EXPR OBJECT_COUNT "${OBJECT_COUNT} + 1") math(EXPR SEPARATE_INDEX "${SEPARATE_INDEX} + ${SEPARATE_SIZE}") add_library(${STUDENT_OBJECT_NAME}_${OBJECT_COUNT} OBJECT ${new_sub_list}) endwhile() + set(${STUDENT_OBJECT_SIZE} "${OBJECT_COUNT}" PARENT_SCOPE) message("${STUDENT_OBJECT_SIZE} object count is ${OBJECT_COUNT}") endfunction() @@ -537,9 +586,11 @@ endfunction() function(enable_target_when_only_build_plugins target) if(ONLY_BUILD_DEVICE_PLUGINS) get_target_property(target_type ${target} TYPE) + if(target_type STREQUAL "INTERFACE_LIBRARY") return() endif() + set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL FALSE) endif() endfunction() @@ -547,10 +598,13 @@ endfunction() function(disable_target_when_only_build_plugins target) if(ONLY_BUILD_DEVICE_PLUGINS) get_target_property(target_type ${target} TYPE) + if(target_type STREQUAL "INTERFACE_LIBRARY") return() endif() + get_property(is_set TARGET ${target} PROPERTY EXCLUDE_FROM_ALL) + if(NOT DEFINED is_set) set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL TRUE) endif() @@ -559,10 +613,13 @@ endfunction() function(enable_directory_when_only_build_plugins dir) get_property(targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS) + foreach(target ${targets}) enable_target_when_only_build_plugins(${target}) endforeach() + get_property(items DIRECTORY ${dir} PROPERTY SUBDIRECTORIES) + foreach(item ${items}) enable_directory_when_only_build_plugins(${item}) endforeach() @@ -570,10 +627,13 @@ endfunction() function(disable_directory_when_only_build_plugins dir) get_property(targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS) + foreach(target ${targets}) disable_target_when_only_build_plugins(${target}) endforeach() + get_property(items DIRECTORY ${dir} PROPERTY SUBDIRECTORIES) + foreach(item ${items}) disable_directory_when_only_build_plugins(${item}) endforeach() @@ -590,6 +650,7 @@ endfunction() function(find_and_use_mold) find_program(MOLD_LINKER mold) + if(MOLD_LINKER) message(STATUS "using mold to speed linking libraries") get_filename_component(MOLD_LINKER_PATH ${MOLD_LINKER} DIRECTORY) diff --git a/mindspore-lite/.gitmodules b/mindspore-lite/.gitmodules new file mode 100644 index 0000000000000000000000000000000000000000..f6420f8de791a4c63183d977ab8d9c57c93f89ee --- /dev/null +++ b/mindspore-lite/.gitmodules @@ -0,0 +1,4 @@ +[submodule "mindspore"] + path = mindspore + url = https://gitee.com/bellatan/mindspore.git + branch = hiai_nnrt_mslite \ No newline at end of file diff --git a/mindspore-lite/CMakeLists.txt b/mindspore-lite/CMakeLists.txt index 2b6e4e31e114b57d4fa0b2bba198cae10799c9c4..630c994e41570a60850e8748d0fe726982f3eadf 100644 --- a/mindspore-lite/CMakeLists.txt +++ b/mindspore-lite/CMakeLists.txt @@ -127,18 +127,23 @@ endif() if(DEFINED ENV{MSLITE_GPU_BACKEND}) set(MSLITE_GPU_BACKEND $ENV{MSLITE_GPU_BACKEND}) endif() + if(DEFINED ENV{MSLITE_REGISTRY_DEVICE}) set(MSLITE_REGISTRY_DEVICE $ENV{MSLITE_REGISTRY_DEVICE}) endif() + if(DEFINED ENV{MSLITE_MICRO_PLATFORM}) set(MSLITE_MICRO_PLATFORM $ENV{MSLITE_MICRO_PLATFORM}) endif() + if(DEFINED ENV{MSLITE_ENABLE_NPU}) set(MSLITE_ENABLE_NPU $ENV{MSLITE_ENABLE_NPU}) endif() + if(DEFINED ENV{MSLITE_ENABLE_COREML}) set(MSLITE_ENABLE_COREML $ENV{MSLITE_ENABLE_COREML}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TRAIN}) set(MSLITE_ENABLE_TRAIN $ENV{MSLITE_ENABLE_TRAIN}) endif() @@ -174,66 +179,87 @@ endif() if(MSLITE_ENABLE_CAPTURE_SIGNALS) add_compile_definitions(CAPTURE_SIGNALS) endif() + if(DEFINED ENV{MSLITE_ENABLE_SSE}) set(MSLITE_ENABLE_SSE $ENV{MSLITE_ENABLE_SSE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AVX}) set(MSLITE_ENABLE_AVX $ENV{MSLITE_ENABLE_AVX}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AVX512}) set(MSLITE_ENABLE_AVX512 $ENV{MSLITE_ENABLE_AVX512}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CONVERTER}) set(MSLITE_ENABLE_CONVERTER $ENV{MSLITE_ENABLE_CONVERTER}) endif() + if(DEFINED ENV{MSLITE_ENABLE_RUNTIME_CONVERT}) set(MSLITE_ENABLE_RUNTIME_CONVERT $ENV{MSLITE_ENABLE_RUNTIME_CONVERT}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TOOLS}) set(MSLITE_ENABLE_TOOLS $ENV{MSLITE_ENABLE_TOOLS}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TESTCASES}) set(MSLITE_ENABLE_TESTCASES $ENV{MSLITE_ENABLE_TESTCASES}) endif() + if(DEFINED ENV{MSLITE_ENABLE_RUNTIME_PASS}) set(MSLITE_ENABLE_RUNTIME_PASS $ENV{MSLITE_ENABLE_RUNTIME_PASS}) endif() + if(DEFINED ENV{MSLITE_ENABLE_HIGH_PERFORMANCE}) set(MSLITE_ENABLE_HIGH_PERFORMANCE $ENV{MSLITE_ENABLE_HIGH_PERFORMANCE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_STRING_KERNEL}) set(MSLITE_ENABLE_STRING_KERNEL $ENV{MSLITE_ENABLE_STRING_KERNEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CONTROLFLOW}) set(MSLITE_ENABLE_CONTROLFLOW $ENV{MSLITE_ENABLE_CONTROLFLOW}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AUTO_PARALLEL}) set(MSLITE_ENABLE_AUTO_PARALLEL $ENV{MSLITE_ENABLE_AUTO_PARALLEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_WEIGHT_DECODE}) set(MSLITE_ENABLE_WEIGHT_DECODE $ENV{MSLITE_ENABLE_WEIGHT_DECODE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CUSTOM_KERNEL}) set(MSLITE_ENABLE_CUSTOM_KERNEL $ENV{MSLITE_ENABLE_CUSTOM_KERNEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_MINDRT}) set(MSLITE_ENABLE_MINDRT $ENV{MSLITE_ENABLE_MINDRT}) endif() + if(DEFINED ENV{MSLITE_ENABLE_DELEGATE}) set(MSLITE_ENABLE_DELEGATE $ENV{MSLITE_ENABLE_DELEGATE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_FP16}) set(MSLITE_ENABLE_FP16 $ENV{MSLITE_ENABLE_FP16}) endif() + if(DEFINED ENV{MSLITE_ENABLE_INT8}) set(MSLITE_ENABLE_INT8 $ENV{MSLITE_ENABLE_INT8}) endif() + if(DEFINED ENV{MSLITE_ENABLE_SPARSE_COMPUTE}) set(MSLITE_ENABLE_SPARSE_COMPUTE $ENV{MSLITE_ENABLE_SPARSE_COMPUTE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_ACL}) set(MSLITE_ENABLE_ACL $ENV{MSLITE_ENABLE_ACL}) endif() + if(DEFINED ENV{MSLITE_ASCEND_TARGET}) set(MSLITE_ASCEND_TARGET $ENV{MSLITE_ASCEND_TARGET}) endif() @@ -241,15 +267,19 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_ACL_QUANT_PARAM}) set(MSLITE_ENABLE_ACL_QUANT_PARAM $ENV{MSLITE_ENABLE_ACL_QUANT_PARAM}) endif() + if(DEFINED ENV{MSLITE_ENABLE_OPENCV}) set(MSLITE_ENABLE_OPENCV $ENV{MSLITE_ENABLE_OPENCV}) endif() + if(DEFINED ENV{MSLITE_MINDDATA_IMPLEMENT}) set(MSLITE_MINDDATA_IMPLEMENT $ENV{MSLITE_MINDDATA_IMPLEMENT}) endif() + if(DEFINED ENV{MSLITE_TARGET_SITEAI}) set(MSLITE_TARGET_SITEAI $ENV{MSLITE_TARGET_SITEAI}) endif() + if(DEFINED ENV{MSLITE_ENABLE_W_NO_ERROR}) set(MSLITE_ENABLE_W_NO_ERROR $ENV{MSLITE_ENABLE_W_NO_ERROR}) endif() @@ -261,8 +291,8 @@ else() endif() if(DEFINED ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) - if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR ( - (PLATFORM_ARM64 OR PLATFORM_ARM32) AND (ANDROID_NDK_TOOLCHAIN_INCLUDED OR TARGET_AOS_ARM))) + if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") OR( + (PLATFORM_ARM64 OR PLATFORM_ARM32) AND(ANDROID_NDK_TOOLCHAIN_INCLUDED OR TARGET_AOS_ARM))) set(MSLITE_ENABLE_MODEL_ENCRYPTION $ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) elseif(MSLITE_ENABLE_ACL) set(MSLITE_ENABLE_MODEL_ENCRYPTION $ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) @@ -287,6 +317,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_SERVING}) set(MSLITE_ENABLE_SERVING $ENV{MSLITE_ENABLE_SERVING}) endif() + if(DEFINED ENV{MSLITE_ENABLE_KERNEL_EXECUTOR}) set(MSLITE_ENABLE_KERNEL_EXECUTOR $ENV{MSLITE_ENABLE_KERNEL_EXECUTOR}) endif() @@ -311,6 +342,7 @@ endif() if(DEFINED ENV{ENABLE_FAST_HASH_TABLE}) add_compile_definitions(ENABLE_FAST_HASH_TABLE) + if(NOT MSLITE_TARGET_SITEAI) set(MSLITE_DEPS_ROBIN_HOOD_HASHING on) endif() @@ -327,7 +359,7 @@ if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) add_compile_definitions(USE_GLOG) endif() -if(MSLITE_ENABLE_ACL AND (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) +if(MSLITE_ENABLE_ACL AND(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) set(PLATFORM_ARM32 off) endif() @@ -335,12 +367,15 @@ if(MACHINE_LINUX_ARM64) add_compile_definitions(MACHINE_LINUX_ARM64) add_compile_definitions(LINUX_RUNTIME) endif() + if(PLATFORM_X86_64) add_compile_definitions(LINUX_RUNTIME) endif() + if(PLATFORM_MCU) add_compile_definitions(ENABLE_MCU) endif() + if(TOOLCHAIN_NAME STREQUAL "himix200") set(TARGET_HIMIX on) set(TARGET_HIMIX200 on) @@ -363,7 +398,7 @@ elseif(TOOLCHAIN_NAME STREQUAL "ohos") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0 - AND NOT TARGET_HIMIX AND NOT TARGET_MIX210) + AND NOT TARGET_HIMIX AND NOT TARGET_MIX210) message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0") endif() @@ -371,28 +406,31 @@ if(PLATFORM_ARM64) if(MSLITE_GPU_BACKEND STREQUAL "") set(MSLITE_GPU_BACKEND "opencl") endif() - if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off")) + + if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for arm64, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() elseif(PLATFORM_ARM32) - if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off") AND - (NOT MSLITE_GPU_BACKEND STREQUAL "")) + if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off") AND + (NOT MSLITE_GPU_BACKEND STREQUAL "")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for arm32, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() elseif(WIN32) -# set(MSLITE_GPU_BACKEND "off") +# set(MSLITE_GPU_BACKEND "off") else() - if(${MSLITE_REGISTRY_DEVICE} STREQUAL "SD3403" AND (NOT MSLITE_ENABLE_ACL)) + if(${MSLITE_REGISTRY_DEVICE} STREQUAL "SD3403" AND(NOT MSLITE_ENABLE_ACL)) set(MSLITE_ENABLE_DPICO_ATC_ADAPTER on) add_definitions(-DENABLE_LITE_DPICO) endif() + if(MSLITE_GPU_BACKEND STREQUAL "") set(MSLITE_GPU_BACKEND "off") endif() - if((NOT MSLITE_GPU_BACKEND STREQUAL "tensorrt") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off") AND - (NOT MSLITE_GPU_BACKEND STREQUAL "cuda") AND (NOT MSLITE_GPU_BACKEND STREQUAL "opencl")) + + if((NOT MSLITE_GPU_BACKEND STREQUAL "tensorrt") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off") AND + (NOT MSLITE_GPU_BACKEND STREQUAL "cuda") AND(NOT MSLITE_GPU_BACKEND STREQUAL "opencl")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for x86_64, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() @@ -403,16 +441,20 @@ if(PLATFORM_ARM64 OR PLATFORM_ARM32) set(MSLITE_ENABLE_SSE off) set(MSLITE_ENABLE_AVX off) set(MSLITE_ENABLE_AVX512 off) + if(NOT MACHINE_LINUX_ARM64) set(MSLITE_ENABLE_CONVERTER off) endif() + if(MSLITE_ENABLE_SERVER_INFERENCE) set(MSLITE_ENABLE_RUNTIME_GLOG on) else() set(MSLITE_ENABLE_RUNTIME_GLOG off) endif() + set(MSLITE_ENABLE_RUNTIME_CONVERT off) -#set for cross - compiling toolchain + + # set for cross - compiling toolchain set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) @@ -435,6 +477,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_DYNAMIC_THREAD_DISTRIBUTE}) set(MSLITE_ENABLE_DYNAMIC_THREAD_DISTRIBUTE $ENV{MSLITE_ENABLE_DYNAMIC_THREAD_DISTRIBUTE}) endif() + if(MSLITE_ENABLE_DYNAMIC_THREAD_DISTRIBUTE) add_compile_definitions(DYNAMIC_THREAD_DISTRIBUTE) endif() @@ -442,6 +485,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_BFC_MEMORY}) set(MSLITE_ENABLE_BFC_MEMORY $ENV{MSLITE_ENABLE_BFC_MEMORY}) endif() + if(MSLITE_ENABLE_BFC_MEMORY) add_compile_definitions(BFC_MEMORY) endif() @@ -457,6 +501,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_SHARING_MODEL_WEIGHT}) set(MSLITE_ENABLE_SHARING_MODEL_WEIGHT $ENV{MSLITE_ENABLE_SHARING_MODEL_WEIGHT}) endif() + if(MSLITE_ENABLE_SHARING_MODEL_WEIGHT) add_compile_definitions(SHARING_MODEL_WEIGHT) endif() @@ -472,6 +517,7 @@ endif() if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) set(MSLITE_ENABLE_RUNTIME_GLOG on) set(MSLITE_ENABLE_TRAIN off) + if(NOT MSLITE_MINDDATA_IMPLEMENT STREQUAL "off") add_compile_definitions(ENABLE_MINDDATA_PYTHON) endif() @@ -479,12 +525,12 @@ endif() if(MSLITE_ENABLE_TRAIN AND NOT MSLITE_ENABLE_WEIGHT_DECODE) message(FATAL_ERROR "If MSLITE_ENABLE_WEIGHT_DECODE use if configured as off, " - "MSLITE_ENABLE_TRAIN must also be configured as off") + "MSLITE_ENABLE_TRAIN must also be configured as off") endif() if(NOT MSLITE_TARGET_SITEAI AND MSLITE_ENABLE_CONTROLFLOW AND NOT MSLITE_ENABLE_MINDRT) message(FATAL_ERROR "If MSLITE_ENABLE_MINDRT use if configured as off, " - "MSLITE_ENABLE_CONTROLFLOW must also be configured as off") + "MSLITE_ENABLE_CONTROLFLOW must also be configured as off") endif() if(MSLITE_ENABLE_RUNTIME_CONVERT) @@ -496,11 +542,13 @@ if(MSLITE_ENABLE_TRAIN) set(SUPPORT_TRAIN on) endif() -if(MSLITE_ENABLE_NPU AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) +if(MSLITE_ENABLE_NPU AND NOT(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) set(SUPPORT_NPU on) + if(NOT PLATFORM_ARM) message(FATAL_ERROR "NPU only support platform arm.") endif() + if(DEFINED ENV{HWHIAI_DDK}) message("HWHIAI_DDK=$ENV{HWHIAI_DDK}") else() @@ -509,16 +557,17 @@ if(MSLITE_ENABLE_NPU AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENA endif() if(TARGET_HIMIX OR TARGET_OHOS_LITE) - set(MSLITE_ENABLE_MINDRT off) + set(MSLITE_ENABLE_MINDRT off) endif() if(MSVC) - set(MSLITE_ENABLE_CONVERTER off) - if(MSLITE_ENABLE_RUNTIME_GLOG) - add_definitions(-DNOMINMAX) - add_definitions(-DNOGDI) - set(MSLITE_DEPS_DIRENT on) - endif() + set(MSLITE_ENABLE_CONVERTER off) + + if(MSLITE_ENABLE_RUNTIME_GLOG) + add_definitions(-DNOMINMAX) + add_definitions(-DNOGDI) + set(MSLITE_DEPS_DIRENT on) + endif() endif() if(MSLITE_GPU_BACKEND STREQUAL cuda) @@ -550,15 +599,17 @@ if(TARGET_AOS_ARM) if(TOOLCHAIN_NAME STREQUAL "gcc") add_compile_definitions(USE_AOS_GCC_TOOLCHAIN) endif() + add_compile_definitions(ENABLE_AOS_ARM) + if(MSLITE_ENABLE_MODEL_ENCRYPTION) add_compile_definitions(ENABLE_OPENSSL) endif() endif() if(MSLITE_ENABLE_W_NO_ERROR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error") endif() message(STATUS "************MindSpore Lite Build Option:************") @@ -610,32 +661,32 @@ message(STATUS "\tMSLITE_TARGET_SITEAI = \t${MSLITE_TARGET message(STATUS "\tMSLITE_ENABLE_W_NO_ERROR = \t${MSLITE_ENABLE_W_NO_ERROR}") if(NOT MSLITE_TARGET_SITEAI) - if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_TESTCASES) AND ( - NOT MSLITE_ENABLE_MINDRT - OR NOT MSLITE_ENABLE_STRING_KERNEL - OR NOT MSLITE_ENABLE_CONTROLFLOW - OR NOT MSLITE_ENABLE_WEIGHT_DECODE - OR NOT MSLITE_ENABLE_CUSTOM_KERNEL)) + if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_TESTCASES) AND( + NOT MSLITE_ENABLE_MINDRT + OR NOT MSLITE_ENABLE_STRING_KERNEL + OR NOT MSLITE_ENABLE_CONTROLFLOW + OR NOT MSLITE_ENABLE_WEIGHT_DECODE + OR NOT MSLITE_ENABLE_CUSTOM_KERNEL)) message(FATAL_ERROR "If one of 'MSLITE_ENABLE_MINDRT MSLITE_ENABLE_STRING_KERNEL " - "MSLITE_ENABLE_CONTROLFLOW MSLITE_ENABLE_WEIGHT_DECODE MSLITE_ENABLE_CUSTOM_KERNEL'" - "is configured as off, MSLITE_ENABLE_CONVERTER and MSLITE_ENABLE_TESTCASES must also be configured as + "MSLITE_ENABLE_CONTROLFLOW MSLITE_ENABLE_WEIGHT_DECODE MSLITE_ENABLE_CUSTOM_KERNEL'" + "is configured as off, MSLITE_ENABLE_CONVERTER and MSLITE_ENABLE_TESTCASES must also be configured as off") endif() else() - if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_TESTCASES) AND ( - NOT MSLITE_ENABLE_STRING_KERNEL - OR NOT MSLITE_ENABLE_CONTROLFLOW - OR NOT MSLITE_ENABLE_WEIGHT_DECODE - OR NOT MSLITE_ENABLE_CUSTOM_KERNEL)) + if((MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_TESTCASES) AND( + NOT MSLITE_ENABLE_STRING_KERNEL + OR NOT MSLITE_ENABLE_CONTROLFLOW + OR NOT MSLITE_ENABLE_WEIGHT_DECODE + OR NOT MSLITE_ENABLE_CUSTOM_KERNEL)) message(FATAL_ERROR "If one of 'MSLITE_ENABLE_STRING_KERNEL " - "MSLITE_ENABLE_CONTROLFLOW MSLITE_ENABLE_WEIGHT_DECODE MSLITE_ENABLE_CUSTOM_KERNEL'" - "is configured as off, MSLITE_ENABLE_CONVERTER and MSLITE_ENABLE_TESTCASES must also be configured as + "MSLITE_ENABLE_CONTROLFLOW MSLITE_ENABLE_WEIGHT_DECODE MSLITE_ENABLE_CUSTOM_KERNEL'" + "is configured as off, MSLITE_ENABLE_CONVERTER and MSLITE_ENABLE_TESTCASES must also be configured as off") endif() endif() -if(((MSLITE_GPU_BACKEND STREQUAL tensorrt) OR MSLITE_ENABLE_NPU OR MSLITE_ENABLE_COREML) AND ( - NOT MSLITE_ENABLE_DELEGATE)) +if(((MSLITE_GPU_BACKEND STREQUAL tensorrt) OR MSLITE_ENABLE_NPU OR MSLITE_ENABLE_COREML) AND( + NOT MSLITE_ENABLE_DELEGATE)) message(FATAL_ERROR "If MSLITE_ENABLE_DELEGATE use is configured as off, MSLITE_ENABLE_NPU and MSLITE_ENABLE_COREML must also be configured as off and MSLITE_GPU_BACKEND can not be configured as tensorrt.") endif() @@ -646,9 +697,11 @@ endif() if(ENABLE_ASAN) add_definitions(-fsanitize=address -fno-omit-frame-pointer) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_definitions(-mllvm -asan-use-private-alias=1) endif() + add_link_options(-fsanitize=address) endif() @@ -664,11 +717,13 @@ if(MSLITE_ENABLE_ACL) if(MSLITE_ENABLE_ACL_QUANT_PARAM) add_definitions(-D ENABLE_ACL_QUANT_PARAM) endif() + if(DEFINED ENV{ASCEND_CUSTOM_PATH}) set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH}) else() set(ASCEND_PATH /usr/local/Ascend) endif() + if("${MSLITE_REGISTRY_DEVICE}" STREQUAL "SD3403") if(PLATFORM_ARM64) set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/arm64-lmixlinux200/lib64) @@ -689,11 +744,13 @@ set(PKG_NAME_PREFIX mindspore-lite-${VERSION_STR}) if(SUPPORT_NPU) set(DDK_PATH "$ENV{HWHIAI_DDK}/ddk/ai_ddk_lib") set(DDK_INCLUDE_PATH "$ENV{HWHIAI_DDK}/ddk/ai_ddk_lib/include") + if(PLATFORM_ARM64) set(DDK_LIB_PATH ${DDK_PATH}/lib64) elseif(PLATFORM_ARM32) set(DDK_LIB_PATH ${DDK_PATH}/lib) endif() + add_compile_definitions(SUPPORT_NPU) endif() @@ -715,6 +772,7 @@ if(PLATFORM_ARM64) endif() elseif(PLATFORM_ARM32) set(RUNTIME_COMPONENT_NAME "android-aarch32") + if(TARGET_HIMIX200) set(RUNTIME_COMPONENT_NAME "linux-aarch32") elseif(TARGET_OHOS_LITE) @@ -746,8 +804,9 @@ set(OPS_DIR ${TOP_DIR}/mindspore/mindspore/ops) set(NNACL_DIR ${OPS_DIR}/kernel/cpu/nnacl) if(PLATFORM_MCU) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types") -# set(MSLITE_DEPS_CMSIS on) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types") + + # set(MSLITE_DEPS_CMSIS on) add_subdirectory(${NNACL_DIR} build/nnacl) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter/micro/cmake/cortex-m/ build) include(${TOP_DIR}/cmake/package_lite.cmake) @@ -756,10 +815,12 @@ endif() function(find_required_package pkg_name) find_package(${pkg_name}) + if(NOT ${pkg_name}_FOUND) message(FATAL_ERROR "Required package ${pkg_name} not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") endif() + set(${pkg_name}_VERSION PARENT_SCOPE) endfunction() @@ -792,11 +853,11 @@ if(MSLITE_GPU_BACKEND STREQUAL opencl) set(MSLITE_DEPS_OPENCL on) endif() - if(MSLITE_ENABLE_COREML) if(PLATFORM_ARM32) message(FATAL_ERROR "CoreML not support arm32 platform!") endif() + add_compile_definitions(ENABLE_COREML) include(${TOP_DIR}/cmake/external_libs/protobuf.cmake) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64") @@ -818,15 +879,17 @@ endif() if(ENABLE_VERBOSE) set(CMAKE_VERBOSE_MAKEFILE on) endif() + if(SUPPORT_TRAIN) add_compile_definitions(SUPPORT_TRAIN) endif() + if(ENABLE_NEON) add_compile_definitions(ENABLE_NEON) endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - if((${MSLITE_REGISTRY_DEVICE} STREQUAL "off") OR (${MSLITE_REGISTRY_DEVICE} STREQUAL "OFF")) + if((${MSLITE_REGISTRY_DEVICE} STREQUAL "off") OR(${MSLITE_REGISTRY_DEVICE} STREQUAL "OFF")) set(ENABLE_GLIBCXX OFF) else() set(ENABLE_GLIBCXX ON) @@ -839,23 +902,27 @@ if(MSLITE_GPU_BACKEND STREQUAL cuda) # add_definitions(-DGPU_CUDA) add_compile_definitions(SUPPORT_GPU) set(SUPPORT_CUDA on) + if(DEFINED ENV{CUDA_HOME}) message("CUDA_HOME = $ENV{CUDA_HOME}") else() message(FATAL_ERROR "please set CUDA_HOME, example: export CUDA_HOME=/usr/local/cuda-10.1/") endif() + find_package(CUDAToolkit) + if(NOT CUDAToolkit_FOUND) message(FATAL_ERROR "Required package CUDAToolkit not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") endif() - if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND (${CUDAToolkit_VERSION} VERSION_GREATER "10.1.168")) + + if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND(${CUDAToolkit_VERSION} VERSION_GREATER "10.1.168")) set(ENABLE_GLIBCXX OFF) else() message(WARNING "Current CUDAToolkit version (${CUDAToolkit_VERSION}) is less than 10.1.168, " - "might have unfixed issues with std string, set ENABLE_GLIBCXX = ON automatically to prevent errors. " - "However, import mindspore and import mindspore_lite in Python API at the same time cannot be used, " - "if you need to import them at the same time, the version higher than 10.1.168 is recommended.") + "might have unfixed issues with std string, set ENABLE_GLIBCXX = ON automatically to prevent errors. " + "However, import mindspore and import mindspore_lite in Python API at the same time cannot be used, " + "if you need to import them at the same time, the version higher than 10.1.168 is recommended.") set(ENABLE_GLIBCXX ON) endif() endif() @@ -863,28 +930,33 @@ endif() if(MSLITE_GPU_BACKEND STREQUAL tensorrt) add_compile_definitions(SUPPORT_GPU) set(SUPPORT_TENSORRT on) + if(DEFINED ENV{TENSORRT_PATH}) message("TENSORRT_PATH = $ENV{TENSORRT_PATH}") else() message(FATAL_ERROR "please set TENSORRT_PATH, example: export TENSORRT_PATH=/root/usr/TensorRT-6.0.1.5/") endif() + if(DEFINED ENV{CUDA_HOME}) message("CUDA_HOME = $ENV{CUDA_HOME}") else() message(FATAL_ERROR "please set CUDA_HOME, example: export CUDA_HOME=/usr/local/cuda-10.1/") endif() + find_package(CUDAToolkit) + if(NOT CUDAToolkit_FOUND) message(FATAL_ERROR "Required package CUDAToolkit not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") endif() - if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND (${CUDAToolkit_VERSION} VERSION_GREATER "10.1.168")) + + if((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND(${CUDAToolkit_VERSION} VERSION_GREATER "10.1.168")) set(ENABLE_GLIBCXX OFF) else() message(WARNING "Current CUDAToolkit version (${CUDAToolkit_VERSION}) is less than 10.1.168, " - "might have unfixed issues with std string, set ENABLE_GLIBCXX = ON automatically to prevent errors. " - "However, import mindspore and import mindspore_lite in Python API at the same time cannot be used, " - "if you need to import them at the same time, the version higher than 10.1.168 is recommended.") + "might have unfixed issues with std string, set ENABLE_GLIBCXX = ON automatically to prevent errors. " + "However, import mindspore and import mindspore_lite in Python API at the same time cannot be used, " + "if you need to import them at the same time, the version higher than 10.1.168 is recommended.") set(ENABLE_GLIBCXX ON) endif() endif() @@ -905,6 +977,7 @@ endif() include_directories(${CORE_DIR}/mindrt) include_directories(${CORE_DIR}/mindrt/include) + if(MSLITE_ENABLE_MODEL_OBF) if(PLATFORM_ARM32) set(OBF_LIB_DIR ${TOP_DIR}/mindspore-lite/tools/obfuscator/lib/android-aarch32) @@ -913,6 +986,7 @@ if(MSLITE_ENABLE_MODEL_OBF) else() set(OBF_LIB_DIR ${TOP_DIR}/mindspore-lite/tools/obfuscator/lib/linux-x64) endif() + set(OBF_LIBS libmsdeobfuscator-lite.so) endif() @@ -938,6 +1012,7 @@ if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENA set(MSLITE_DEPS_OPENCV on) add_definitions(-DMSLITE_DEPS_OPENCV) endif() + set(MSLITE_DEPS_EIGEN on) endif() @@ -951,6 +1026,7 @@ if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) set(MSLITE_DEPS_LIBEVENT on) set(MSLITE_DEPS_PYBIND11 on) endif() + if(SUPPORT_TENSORRT) if(MSLITE_ENABLE_GRAPH_KERNEL) set(MSLITE_DEPS_AKG_TENSORRT on) @@ -961,8 +1037,8 @@ endif() # In core/CMakelists, core link mindspore::crypto, and crypto need the OPENSSL lib, # So before enter into core/CMakelists, you need to set MSLITE_DEPS_OPENSSL on to contain the OPENSSL lib, # Such as when MSLITE_ENABLE_CONVERTER is on or MSLITE_ENABLE_KERNEL_EXECUTOR is on. -if((${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR APPLE) AND ( - MSLITE_ENABLE_CONVERTER OR (MSLITE_ENABLE_KERNEL_EXECUTOR AND NOT TARGET_AOS_ARM))) +if((${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR APPLE) AND( + MSLITE_ENABLE_CONVERTER OR(MSLITE_ENABLE_KERNEL_EXECUTOR AND NOT TARGET_AOS_ARM))) if(NOT MSLITE_TARGET_SITEAI) set(MSLITE_DEPS_OPENSSL on) endif() @@ -972,6 +1048,7 @@ if(MSLITE_ENABLE_MODEL_ENCRYPTION AND NOT TARGET_AOS_ARM) if(NOT MSLITE_TARGET_SITEAI) set(MSLITE_DEPS_OPENSSL on) endif() + if(MSLITE_DEPS_OPENSSL) add_compile_definitions(ENABLE_OPENSSL) endif() @@ -979,7 +1056,7 @@ endif() include(${LITE_DIR}/cmake/lite_dependences.cmake) -if(MSLITE_GPU_BACKEND STREQUAL opencl AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) +if(MSLITE_GPU_BACKEND STREQUAL opencl AND NOT(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) add_definitions(-DGPU_OPENCL) gene_opencl(${CMAKE_CURRENT_SOURCE_DIR}/src/litert/kernel/opencl/cl) gene_opencl(${CMAKE_CURRENT_SOURCE_DIR}/src/litert/kernel/opencl/cl/int8) @@ -997,7 +1074,7 @@ file(GLOB FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/*.fbs) ms_build_flatbuffers_lite(FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/ fbs_src ${CMAKE_BINARY_DIR}/schema "") ms_build_flatbuffers_lite(FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/schema/ fbs_inner_src ${CMAKE_BINARY_DIR}/schema/inner - "inner") + "inner") if(MSLITE_ENABLE_CONVERTER) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter) @@ -1011,6 +1088,7 @@ endif() if(MSLITE_ENABLE_FP16) add_compile_definitions(ENABLE_FP16) + if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM82_A32) endif() @@ -1025,6 +1103,7 @@ if(PLATFORM_ARM32) add_compile_definitions(ENABLE_ARM32) add_compile_definitions(ENABLE_ARM) endif() + if(PLATFORM_ARM64) add_compile_definitions(ENABLE_ARM64) add_compile_definitions(ENABLE_ARM) @@ -1043,6 +1122,7 @@ if(NOT PLATFORM_ARM) elseif(MSLITE_ENABLE_SSE) set(X86_64_SIMD "sse") add_compile_definitions(ENABLE_SSE) + if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") @@ -1057,6 +1137,7 @@ if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "lite" OR MSLITE_MINDDATA_IMPLEMENT STREQU endif() add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/common/ops) + if(ANDROID_NDK_TOOLCHAIN_INCLUDED OR TARGET_OHOS_LITE OR TARGET_HIMIX) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter/micro/coder) endif() @@ -1067,14 +1148,17 @@ add_subdirectory(${OPS_DIR}/kernel/cpu/nnacl build) if(MSLITE_ENABLE_TOOLS) if(NOT MSLITE_COMPILE_TWICE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark) + if(TARGET_HIMIX) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/converter/micro/providers/nnie nnie_micro) endif() endif() + if(SUPPORT_TRAIN) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/benchmark_train) endif() - if(NOT PLATFORM_ARM AND NOT WIN32 AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) + + if(NOT PLATFORM_ARM AND NOT WIN32 AND NOT(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE)) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/cropper) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tools/schema_gen) add_dependencies(fbs_src gen_ops) diff --git a/mindspore-lite/cmake/ccsrc_converter.cmake b/mindspore-lite/cmake/ccsrc_converter.cmake index 51815b7c9afa54420904a7b2618e4be9d07ac048..25d87ad3c30b4f37d36c720e33602f679974dd5b 100644 --- a/mindspore-lite/cmake/ccsrc_converter.cmake +++ b/mindspore-lite/cmake/ccsrc_converter.cmake @@ -3,6 +3,7 @@ if(MSLITE_ENABLE_CONVERTER) add_definitions(-DPRIMITIVE_WRITEABLE) add_definitions(-DUSE_GLOG) set(USE_GLOG on) + if(MSLITE_ENABLE_MODEL_ENCRYPTION AND MSLITE_DEPS_OPENSSL) add_compile_definitions(ENABLE_OPENSSL) endif() @@ -14,55 +15,55 @@ if(MSLITE_ENABLE_CONVERTER) set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../src) set(TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../tools) set(CCSRC_SRC - ${CCSRC_DIR}/backend/backend_manager/backend_jit_config.cc - ${CCSRC_DIR}/backend/common/optimizer/pattern_engine.cc - ${CCSRC_DIR}/backend/common/optimizer/visitor.cc - ${CCSRC_DIR}/backend/common/optimizer/graph_optimizer.cc - ${CCSRC_DIR}/backend/operator/ops_backend_infer_function.cc - ${OPS_DIR}/kernel/common/kernel.cc - ${OPS_DIR}/kernel/common/kernel_tensor.cc - ${OPS_DIR}/kernel/common/kernel_factory.cc - ${OPS_DIR}/kernel/common/format_utils.cc - ${CCSRC_DIR}/utils/convert_utils.cc - ) + ${CCSRC_DIR}/backend/backend_manager/backend_jit_config.cc + ${CCSRC_DIR}/backend/common/optimizer/pattern_engine.cc + ${CCSRC_DIR}/backend/common/optimizer/visitor.cc + ${CCSRC_DIR}/backend/common/optimizer/graph_optimizer.cc + ${CCSRC_DIR}/backend/operator/ops_backend_infer_function.cc + ${OPS_DIR}/kernel/common/kernel.cc + ${OPS_DIR}/kernel/common/kernel_tensor.cc + ${OPS_DIR}/kernel/common/kernel_factory.cc + ${OPS_DIR}/kernel/common/format_utils.cc + ${CCSRC_DIR}/utils/convert_utils.cc + ) if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_CLOUD_INFERENCE) set(CCSRC_SRC ${CCSRC_SRC} - ${CCSRC_DIR}/ps/ps_context.cc - ${CCSRC_DIR}/common/thread_pool.cc - ${CCSRC_DIR}/debug/profiler/profiler.cc - ${CCSRC_DIR}/common/pynative/abstract_converter.cc - ${CCSRC_DIR}/plugin/device/cpu/kernel/cpu_kernel.cc - ${CCSRC_DIR}/distributed/cluster/dummy_cluster_context.cc - ${OPS_DIR}/kernel/common/kernel_utils.cc - ${OPS_DIR}/kernel/common/common_utils.cc - ${CCSRC_DIR}/kernel/framework_utils.cc - ${CCSRC_DIR}/kernel/philox_random.cc - ${CCSRC_DIR}/kernel/kash/kernel_pack.cc - ${OPS_DIR}/kernel/common/kernel_build_info.cc - ${OPS_DIR}/kernel/common/oplib/oplib.cc - ${CCSRC_DIR}/kernel/kernel_info.cc - ${CCSRC_DIR}/runtime/device/res_manager/utils/convert_tensor_utils.cc - ${CCSRC_DIR}/utils/ms_device_shape_transfer.cc - ${CCSRC_DIR}/runtime/device/kernel_runtime_manager.cc - ${CCSRC_DIR}/runtime/hardware/device_context_manager.cc - ${CCSRC_DIR}/common/runtime_conf/runtime_conf.cc - ${CCSRC_DIR}/utils/comm_manager.cc - ${CCSRC_DIR}/backend/common/session/exec_order_builder.cc - ${CCSRC_DIR}/backend/common/session/kernel_graph.cc - ${CCSRC_DIR}/backend/common/session/anf_runtime_algorithm.cc - ${CCSRC_DIR}/runtime/device/res_manager/hal_res_manager.cc - ${CCSRC_DIR}/runtime/device/res_manager/multi_stream_controller.cc - ${SRC_DIR}/extendrt/utils/tensor_utils.cc - ) + ${CCSRC_DIR}/ps/ps_context.cc + ${CCSRC_DIR}/common/thread_pool.cc + ${CCSRC_DIR}/debug/profiler/profiler.cc + ${CCSRC_DIR}/common/pynative/abstract_converter.cc + ${CCSRC_DIR}/plugin/device/cpu/kernel/cpu_kernel.cc + ${CCSRC_DIR}/distributed/cluster/dummy_cluster_context.cc + ${OPS_DIR}/kernel/common/kernel_utils.cc + ${OPS_DIR}/kernel/common/common_utils.cc + ${CCSRC_DIR}/kernel/framework_utils.cc + ${CCSRC_DIR}/kernel/philox_random.cc + ${CCSRC_DIR}/kernel/kash/kernel_pack.cc + ${OPS_DIR}/kernel/common/kernel_build_info.cc + ${OPS_DIR}/kernel/common/oplib/oplib.cc + ${CCSRC_DIR}/kernel/kernel_info.cc + ${CCSRC_DIR}/runtime/device/res_manager/utils/convert_tensor_utils.cc + ${CCSRC_DIR}/utils/ms_device_shape_transfer.cc + ${CCSRC_DIR}/runtime/device/kernel_runtime_manager.cc + ${CCSRC_DIR}/runtime/hardware/device_context_manager.cc + ${CCSRC_DIR}/common/runtime_conf/runtime_conf.cc + ${CCSRC_DIR}/utils/comm_manager.cc + ${CCSRC_DIR}/backend/common/session/exec_order_builder.cc + ${CCSRC_DIR}/backend/common/session/kernel_graph.cc + ${CCSRC_DIR}/backend/common/session/anf_runtime_algorithm.cc + ${CCSRC_DIR}/runtime/device/res_manager/hal_res_manager.cc + ${CCSRC_DIR}/runtime/device/res_manager/multi_stream_controller.cc + ${SRC_DIR}/extendrt/utils/tensor_utils.cc + ) endif() if(NOT WIN32) set(CCSRC_SRC ${CCSRC_SRC} - ${CCSRC_DIR}/utils/anfalgo.cc - ${CCSRC_DIR}/utils/utils.cc - ${CCSRC_DIR}/utils/parallel_context.cc - ) + ${CCSRC_DIR}/utils/anfalgo.cc + ${CCSRC_DIR}/utils/utils.cc + ${CCSRC_DIR}/utils/parallel_context.cc + ) endif() if(ENABLE_GPU) @@ -70,7 +71,6 @@ if(MSLITE_ENABLE_CONVERTER) endif() if(MSLITE_ENABLE_GRAPH_KERNEL) - if(AKG_USE_LLVM) add_compile_definitions(AKG_USE_LLVM) message(STATUS "Converter support Graph Kernel CPU backend") @@ -88,32 +88,35 @@ if(MSLITE_ENABLE_CONVERTER) add_compile_definitions(MSLITE_ENABLE_GRAPH_KERNEL) file(GLOB_RECURSE GRAPH_KERNEL_SRC - ${TOOLS_DIR}/graph_kernel/common/*.cc - ${TOOLS_DIR}/graph_kernel/converter/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/core/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/expander/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/expanders/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/model/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/split_model/*.cc - ${CCSRC_DIR}/backend/common/graph_kernel/graph_kernel_flags.cc - ${CCSRC_DIR}/kernel/graph_kernel/graph_kernel_json_generator.cc - ${CCSRC_DIR}/backend/common/optimizer/optimizer.cc - ) + ${TOOLS_DIR}/graph_kernel/common/*.cc + ${TOOLS_DIR}/graph_kernel/converter/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/core/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/expander/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/expanders/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/model/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/split_model/*.cc + ${CCSRC_DIR}/backend/common/graph_kernel/graph_kernel_flags.cc + ${CCSRC_DIR}/kernel/graph_kernel/graph_kernel_json_generator.cc + ${CCSRC_DIR}/backend/common/optimizer/optimizer.cc + ) set_property(SOURCE ${GRAPH_KERNEL_SRC} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_GRAPH_KERNEL) set(CCSRC_SRC - ${CCSRC_SRC} - ${GRAPH_KERNEL_SRC} - ) + ${CCSRC_SRC} + ${GRAPH_KERNEL_SRC} + ) endif() + set_property(SOURCE ${CCSRC_SRC} PROPERTY COMPILE_DEFINITIONS - LOG_HDR_FILE_REL_PATH="mindspore-lite/../mindspore/mindspore/core/include/utils/log_adapter.h" - SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) + LOG_HDR_FILE_REL_PATH="mindspore-lite/../mindspore/mindspore/core/include/utils/log_adapter.h" + SUBMODULE_ID=mindspore::SubModuleId::SM_LITE) add_library(ccsrc_src_mid OBJECT ${CCSRC_SRC}) add_dependencies(ccsrc_src_mid fbs_src fbs_inner_src) + if(MSLITE_ENABLE_CLOUD_INFERENCE) add_dependencies(ccsrc_src_mid mindspore-lite-proto) endif() + target_compile_definitions(ccsrc_src_mid PRIVATE BACKEND_DLL) target_compile_definitions(ccsrc_src_mid PRIVATE COMMON_DLL) target_compile_definitions(ccsrc_src_mid PRIVATE OPS_KERNEL_COMMON_DLL) diff --git a/mindspore-lite/cmake/ccsrc_module.cmake b/mindspore-lite/cmake/ccsrc_module.cmake index 6283cf57f36c320dbef8169df72d2d7645403025..fec0493eb7a885a5bcb6a7a50857d2eae918d642 100644 --- a/mindspore-lite/cmake/ccsrc_module.cmake +++ b/mindspore-lite/cmake/ccsrc_module.cmake @@ -6,9 +6,9 @@ set(MINDSPORE_PROJECT_DIR ${TOP_DIR}) set(SERVER_FLATBUFFER_OUTPUT "${CMAKE_BINARY_DIR}/schema") set(FBS_FILES - ${TOP_DIR}/mindspore/mindspore/schema/cipher.fbs - ${TOP_DIR}/mindspore/mindspore/schema/fl_job.fbs - ) + ${TOP_DIR}/mindspore/mindspore/schema/cipher.fbs + ${TOP_DIR}/mindspore/mindspore/schema/fl_job.fbs +) ms_build_flatbuffers(FBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}../../schema generated_fbs_files ${SERVER_FLATBUFFER_OUTPUT}) file(GLOB_RECURSE COMM_PROTO_IN RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CCSRC_DIR}/ps/core/protos/*.proto") @@ -21,6 +21,7 @@ include(${TOP_DIR}/cmake/external_libs/eigen.cmake) include(${TOP_DIR}/cmake/external_libs/mkl_dnn.cmake) find_package(Python3 COMPONENTS Interpreter Development) + if(Python3_FOUND) find_package(Python3 COMPONENTS NumPy Development) @@ -34,4 +35,5 @@ if(Python3_FOUND) include(${TOP_DIR}/cmake/external_libs/pybind11.cmake) endif() endif() + include(${TOP_DIR}/cmake/external_libs/libevent.cmake) diff --git a/mindspore-lite/cmake/compile_link_option.cmake b/mindspore-lite/cmake/compile_link_option.cmake index 51b7eb13c7ed244890be2ce70db9443594b0cdc7..a2fef6e32211ceb6401687a05a93cc1127fc5a56 100644 --- a/mindspore-lite/cmake/compile_link_option.cmake +++ b/mindspore-lite/cmake/compile_link_option.cmake @@ -23,6 +23,7 @@ else() string(REPLACE "-D_FORTIFY_SOURCE=2" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-D_FORTIFY_SOURCE=2" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() + set(CMAKE_SHARED_LINKER_FLAGS "${SECURE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${SECURE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") endif() diff --git a/mindspore-lite/cmake/cortex-m33.toolchain.cmake b/mindspore-lite/cmake/cortex-m33.toolchain.cmake index e91336328d12241b256155971896c08fa8fb72ee..43e50a2b3615b469d7d81e7c21fe86b160c13a63 100644 --- a/mindspore-lite/cmake/cortex-m33.toolchain.cmake +++ b/mindspore-lite/cmake/cortex-m33.toolchain.cmake @@ -2,17 +2,19 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) find_program(arm-none-eabi-gcc_EXE arm-none-eabi-gcc) + if(NOT arm-none-eabi-gcc_EXE) message(FATAL_ERROR "Required C COMPILER arm-none-eabi-gcc not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find C COMPILER PATH: ${arm-none-eabi-gcc_EXE}") endif() find_program(arm-none-eabi-g++_EXE arm-none-eabi-g++) + if(NOT arm-none-eabi-g++_EXE) message(FATAL_ERROR "Required CXX COMPILER arm-none-eabi-g++ not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find CXX COMPILER PATH: ${arm-none-eabi-g++_EXE}") endif() diff --git a/mindspore-lite/cmake/cortex-m4.toolchain.cmake b/mindspore-lite/cmake/cortex-m4.toolchain.cmake index 64cb34b168411d007467e8cbd25bf25821781320..81d7545c1a5339a7c1e6f3d1d82f3c52740f12a8 100644 --- a/mindspore-lite/cmake/cortex-m4.toolchain.cmake +++ b/mindspore-lite/cmake/cortex-m4.toolchain.cmake @@ -2,17 +2,19 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) find_program(arm-none-eabi-gcc_EXE arm-none-eabi-gcc) + if(NOT arm-none-eabi-gcc_EXE) message(FATAL_ERROR "Required C COMPILER arm-none-eabi-gcc not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find C COMPILER PATH: ${arm-none-eabi-gcc_EXE}") endif() find_program(arm-none-eabi-g++_EXE arm-none-eabi-g++) + if(NOT arm-none-eabi-g++_EXE) message(FATAL_ERROR "Required CXX COMPILER arm-none-eabi-g++ not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find CXX COMPILER PATH: ${arm-none-eabi-g++_EXE}") endif() diff --git a/mindspore-lite/cmake/cortex-m7.toolchain.cmake b/mindspore-lite/cmake/cortex-m7.toolchain.cmake index 3a5dd12c43d31bc1ae720e8d67baeed3ded78e95..5168cbd3d2bb2f20f4989e28c9b38d2f62085c8f 100644 --- a/mindspore-lite/cmake/cortex-m7.toolchain.cmake +++ b/mindspore-lite/cmake/cortex-m7.toolchain.cmake @@ -2,17 +2,19 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) find_program(arm-none-eabi-gcc_EXE arm-none-eabi-gcc) + if(NOT arm-none-eabi-gcc_EXE) message(FATAL_ERROR "Required C COMPILER arm-none-eabi-gcc not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find C COMPILER PATH: ${arm-none-eabi-gcc_EXE}") endif() find_program(arm-none-eabi-g++_EXE arm-none-eabi-g++) + if(NOT arm-none-eabi-g++_EXE) message(FATAL_ERROR "Required CXX COMPILER arm-none-eabi-g++ not found, " - "please install the package and try building MindSpore again.") + "please install the package and try building MindSpore again.") else() message("Find CXX COMPILER PATH: ${arm-none-eabi-g++_EXE}") endif() diff --git a/mindspore-lite/cmake/file_list.cmake b/mindspore-lite/cmake/file_list.cmake index 944333c396745e91de83d812b960a488a0641530..5764d132a4cdc9fd07945bc129372674cb59f797 100644 --- a/mindspore-lite/cmake/file_list.cmake +++ b/mindspore-lite/cmake/file_list.cmake @@ -5,7 +5,7 @@ set(API_HEADER ${TOP_DIR}/mindspore/include/api/status.h ${TOP_DIR}/mindspore/include/api/types.h ${TOP_DIR}/mindspore/include/api/visible.h - ) +) set(ABSTRACT_HEADER ${CORE_INC_DIR}/abstract/abstract_value.h @@ -13,7 +13,7 @@ set(ABSTRACT_HEADER ${CORE_INC_DIR}/abstract/param_validator.h ${CORE_INC_DIR}/abstract/ops/primitive_infer_map.h ${CORE_INC_DIR}/abstract/utils.h - ) +) file(GLOB MINDAPI_BASE_HEADER ${CORE_INC_DIR}/mindapi/base/*.h) file(GLOB MINDAPI_IR_HEADER ${CORE_INC_DIR}/mindapi/ir/*.h) set(BASE_HEADER @@ -22,7 +22,7 @@ set(BASE_HEADER ${CORE_INC_DIR}/base/effect_info.h ${CORE_INC_DIR}/base/float16.h ${CORE_INC_DIR}/base/user_data.h - ) +) file(GLOB IR_DTYPE_HEADER ${CORE_INC_DIR}/ir/dtype/*.h) set(IR_HEADER ${CORE_INC_DIR}/ir/anf.h @@ -45,7 +45,7 @@ set(IR_HEADER ${CORE_INC_DIR}/ir/signature.h ${CORE_INC_DIR}/ir/tensor.h ${CORE_INC_DIR}/ir/value.h - ) +) set(UTILS_HEADER ${CORE_INC_DIR}/utils/any.h ${CORE_INC_DIR}/utils/check_convert_utils.h @@ -67,4 +67,4 @@ set(UTILS_HEADER ${CORE_INC_DIR}/utils/shape_utils.h ${CORE_INC_DIR}/utils/signal.h ${CORE_INC_DIR}/utils/trace_info.h - ) +) diff --git a/mindspore-lite/cmake/himix100.toolchain.cmake b/mindspore-lite/cmake/himix100.toolchain.cmake index b642b4e1d9c5fb35bf53e5929c8daf6afe021fd0..43eeda3e82b038f76134cf3add4b474d79fbcc9d 100644 --- a/mindspore-lite/cmake/himix100.toolchain.cmake +++ b/mindspore-lite/cmake/himix100.toolchain.cmake @@ -6,11 +6,13 @@ set(HISI_TOOLCHAIN_PATH "/opt") if(DEFINED ENV{HISI_TOOLCHAIN_PATH}) set(HISI_TOOLCHAIN_PATH $ENV{HISI_TOOLCHAIN_PATH}) endif() + set(CMAKE_C_COMPILER ${HISI_TOOLCHAIN_PATH}/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-gcc) set(CMAKE_CXX_COMPILER ${HISI_TOOLCHAIN_PATH}/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-g++) find_path(GCC_PATH gcc) find_path(GXX_PATH g++) + if(NOT ${GCC_PATH} STREQUAL "GCC_PATH-NOTFOUND" AND NOT ${GXX_PATH} STREQUAL "GXX_PATH-NOTFOUND") set(FLATC_GCC_COMPILER ${GCC_PATH}/gcc) set(FLATC_GXX_COMPILER ${GXX_PATH}/g++) diff --git a/mindspore-lite/cmake/himix200.toolchain.cmake b/mindspore-lite/cmake/himix200.toolchain.cmake index 36f57ffff6a9bdf4df7a41f84387020edfa74f44..bd597083a94d041b79c9be22154e48b0d2d4e9bb 100644 --- a/mindspore-lite/cmake/himix200.toolchain.cmake +++ b/mindspore-lite/cmake/himix200.toolchain.cmake @@ -6,11 +6,13 @@ if(DEFINED ENV{HISI_TOOLCHAIN_PATH}) else() set(TOOLCHAIN_PATH "/opt/hisi-linux/x86-arm") endif() + set(CMAKE_C_COMPILER ${TOOLCHAIN_PATH}/arm-himix200-linux/bin/arm-himix200-linux-gcc) set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/arm-himix200-linux/bin/arm-himix200-linux-g++) find_path(GCC_PATH gcc) find_path(GXX_PATH g++) + if(NOT ${GCC_PATH} STREQUAL "GCC_PATH-NOTFOUND" AND NOT ${GXX_PATH} STREQUAL "GXX_PATH-NOTFOUND") set(FLATC_GCC_COMPILER ${GCC_PATH}/gcc) set(FLATC_GXX_COMPILER ${GXX_PATH}/g++) diff --git a/mindspore-lite/cmake/lite_compile_definitions.cmake b/mindspore-lite/cmake/lite_compile_definitions.cmake index b2b39b8ce913fe6a514f02aa1991a29587de9601..288b383594c642252809f026b73660b4674f5f0e 100644 --- a/mindspore-lite/cmake/lite_compile_definitions.cmake +++ b/mindspore-lite/cmake/lite_compile_definitions.cmake @@ -6,9 +6,11 @@ if(MACHINE_LINUX_ARM64) add_compile_definitions(MACHINE_LINUX_ARM64) add_compile_definitions(LINUX_RUNTIME) endif() + if(PLATFORM_X86_64) add_compile_definitions(LINUX_RUNTIME) endif() + if(TOOLCHAIN_NAME STREQUAL "himix200") add_compile_definitions(SUPPORT_NNIE) elseif(TOOLCHAIN_NAME STREQUAL "himix100") diff --git a/mindspore-lite/cmake/lite_dependences.cmake b/mindspore-lite/cmake/lite_dependences.cmake index 295a51cd781fd3234c2722e2f967b45e80cc3cb8..dbf5888898e79f064a1a4d69cf798c370257a275 100644 --- a/mindspore-lite/cmake/lite_dependences.cmake +++ b/mindspore-lite/cmake/lite_dependences.cmake @@ -43,9 +43,11 @@ if(MSLITE_DEPS_MKLDNN) if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(USE_MS_THREADPOOL_FOR_DNNL ON) endif() + if(USE_MS_THREADPOOL_FOR_DNNL) add_compile_definitions(USE_MS_THREADPOOL_FOR_DNNL) endif() + include(${TOP_DIR}/cmake/external_libs/mkl_dnn.cmake) endif() @@ -57,8 +59,10 @@ if(MSLITE_DEPS_PYBIND11) find_package(Python3 COMPONENTS Interpreter Development) set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) message("PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}") + if(Python3_FOUND) find_package(Python3 COMPONENTS NumPy Development) + if(Python3_NumPy_FOUND) include_directories(${Python3_INCLUDE_DIRS}) include_directories(${Python3_NumPy_INCLUDE_DIRS}) diff --git a/mindspore-lite/cmake/lite_options.cmake b/mindspore-lite/cmake/lite_options.cmake index 5db0c07fd184e6e427e9c71f96f8ea10394cb23c..0c6e3bd53eead0f7034df62fd3bd92021c66d006 100644 --- a/mindspore-lite/cmake/lite_options.cmake +++ b/mindspore-lite/cmake/lite_options.cmake @@ -3,7 +3,7 @@ set(BUILD_LITE "on") include(${CMAKE_CURRENT_SOURCE_DIR}/secure_option.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/compile_link_option.cmake) -#Options that can be configured through environment variables or manually +# Options that can be configured through environment variables or manually set(MSLITE_GPU_BACKEND "" CACHE STRING "enable gpu backend, \ opencl only support arm64 and x86_64 , tensorrt only support x86_64, opencl/cuda/tensorrt/off") set(MSLITE_REGISTRY_DEVICE "off" CACHE STRING "Compile Mindspore Lite that supports specific devices, \ @@ -52,7 +52,7 @@ option(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE "enable cloud and device fusion infe option(MSLITE_ENABLE_CLOUD_INFERENCE "alias to MSLITE_ENABLE_CLOUD_FUSION_INFERENCE" off) option(MSLITE_ENABLE_MODEL_OBF "enable model obfuscation" off) -#Option that can be configured through manually +# Option that can be configured through manually option(ENABLE_VERBOSE "" off) set(VERSION_STR "1.7.0" CACHE STRING "get from version") @@ -68,18 +68,23 @@ endif() if(DEFINED ENV{MSLITE_GPU_BACKEND}) set(MSLITE_GPU_BACKEND $ENV{MSLITE_GPU_BACKEND}) endif() + if(DEFINED ENV{MSLITE_REGISTRY_DEVICE}) set(MSLITE_REGISTRY_DEVICE $ENV{MSLITE_REGISTRY_DEVICE}) endif() + if(DEFINED ENV{MSLITE_MICRO_PLATFORM}) set(MSLITE_MICRO_PLATFORM $ENV{MSLITE_MICRO_PLATFORM}) endif() + if(DEFINED ENV{MSLITE_ENABLE_NPU}) set(MSLITE_ENABLE_NPU $ENV{MSLITE_ENABLE_NPU}) endif() + if(DEFINED ENV{MSLITE_ENABLE_COREML}) set(MSLITE_ENABLE_COREML $ENV{MSLITE_ENABLE_COREML}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TRAIN}) set(MSLITE_ENABLE_TRAIN $ENV{MSLITE_ENABLE_TRAIN}) endif() @@ -87,6 +92,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_SERVER_INFERENCE}) set(MSLITE_ENABLE_SERVER_INFERENCE $ENV{MSLITE_ENABLE_SERVER_INFERENCE}) endif() + if(MSLITE_ENABLE_SERVER_INFERENCE) set(MSLITE_ENABLE_DYNAMIC_THREAD_DISTRIBUTE on) set(MSLITE_ENABLE_BFC_MEMORY on) @@ -95,75 +101,98 @@ if(MSLITE_ENABLE_SERVER_INFERENCE) set(MSLITE_ENABLE_RUNTIME_GLOG on) set(MSLITE_ENABLE_AVX512 on) endif() + if(DEFINED ENV{MSLITE_ENABLE_SSE}) set(MSLITE_ENABLE_SSE $ENV{MSLITE_ENABLE_SSE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AVX}) set(MSLITE_ENABLE_AVX $ENV{MSLITE_ENABLE_AVX}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AVX512}) set(MSLITE_ENABLE_AVX512 $ENV{MSLITE_ENABLE_AVX512}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CONVERTER}) set(MSLITE_ENABLE_CONVERTER $ENV{MSLITE_ENABLE_CONVERTER}) endif() + if(DEFINED ENV{MSLITE_ENABLE_RUNTIME_CONVERT}) set(MSLITE_ENABLE_RUNTIME_CONVERT $ENV{MSLITE_ENABLE_RUNTIME_CONVERT}) endif() + if(DEFINED ENV{ENABLE_AKG} AND NOT MSLITE_ENABLE_RUNTIME_CONVERT) set(MSLITE_ENABLE_GRAPH_KERNEL $ENV{ENABLE_AKG}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TOOLS}) set(MSLITE_ENABLE_TOOLS $ENV{MSLITE_ENABLE_TOOLS}) endif() + if(DEFINED ENV{MSLITE_ENABLE_TESTCASES}) set(MSLITE_ENABLE_TESTCASES $ENV{MSLITE_ENABLE_TESTCASES}) endif() + if(DEFINED ENV{MSLITE_ENABLE_RUNTIME_PASS}) set(MSLITE_ENABLE_RUNTIME_PASS $ENV{MSLITE_ENABLE_RUNTIME_PASS}) endif() + if(DEFINED ENV{MSLITE_ENABLE_HIGH_PERFORMANCE}) set(MSLITE_ENABLE_HIGH_PERFORMANCE $ENV{MSLITE_ENABLE_HIGH_PERFORMANCE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_STRING_KERNEL}) set(MSLITE_ENABLE_STRING_KERNEL $ENV{MSLITE_ENABLE_STRING_KERNEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CONTROLFLOW}) set(MSLITE_ENABLE_CONTROLFLOW $ENV{MSLITE_ENABLE_CONTROLFLOW}) endif() + if(DEFINED ENV{MSLITE_ENABLE_AUTO_PARALLEL}) set(MSLITE_ENABLE_AUTO_PARALLEL $ENV{MSLITE_ENABLE_AUTO_PARALLEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_WEIGHT_DECODE}) set(MSLITE_ENABLE_WEIGHT_DECODE $ENV{MSLITE_ENABLE_WEIGHT_DECODE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_CUSTOM_KERNEL}) set(MSLITE_ENABLE_CUSTOM_KERNEL $ENV{MSLITE_ENABLE_CUSTOM_KERNEL}) endif() + if(DEFINED ENV{MSLITE_ENABLE_MINDRT}) set(MSLITE_ENABLE_MINDRT $ENV{MSLITE_ENABLE_MINDRT}) endif() + if(DEFINED ENV{MSLITE_ENABLE_DELEGATE}) set(MSLITE_ENABLE_DELEGATE $ENV{MSLITE_ENABLE_DELEGATE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_FP16}) set(MSLITE_ENABLE_FP16 $ENV{MSLITE_ENABLE_FP16}) endif() + if(DEFINED ENV{MSLITE_ENABLE_INT8}) set(MSLITE_ENABLE_INT8 $ENV{MSLITE_ENABLE_INT8}) endif() + if(DEFINED ENV{MSLITE_ENABLE_SPARSE_COMPUTE}) set(MSLITE_ENABLE_SPARSE_COMPUTE $ENV{MSLITE_ENABLE_SPARSE_COMPUTE}) endif() + if(DEFINED ENV{MSLITE_ENABLE_ACL}) set(MSLITE_ENABLE_ACL $ENV{MSLITE_ENABLE_ACL}) endif() + if(DEFINED ENV{MSLITE_MINDDATA_IMPLEMENT}) set(MSLITE_MINDDATA_IMPLEMENT $ENV{MSLITE_MINDDATA_IMPLEMENT}) endif() + if(DEFINED ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) if((${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND PLATFORM_X86_64) - OR((PLATFORM_ARM64 OR PLATFORM_ARM32) AND ANDROID_NDK_TOOLCHAIN_INCLUDED)) + OR((PLATFORM_ARM64 OR PLATFORM_ARM32) AND ANDROID_NDK_TOOLCHAIN_INCLUDED)) set(MSLITE_ENABLE_MODEL_ENCRYPTION $ENV{MSLITE_ENABLE_MODEL_ENCRYPTION}) else() set(MSLITE_ENABLE_MODEL_ENCRYPTION OFF) @@ -177,6 +206,7 @@ endif() if(DEFINED ENV{MSLITE_ENABLE_SERVING}) set(MSLITE_ENABLE_SERVING $ENV{MSLITE_ENABLE_SERVING}) endif() + if(DEFINED ENV{MSLITE_ENABLE_KERNEL_EXECUTOR}) set(MSLITE_ENABLE_KERNEL_EXECUTOR $ENV{MSLITE_ENABLE_KERNEL_EXECUTOR}) endif() @@ -219,7 +249,7 @@ elseif(TOOLCHAIN_NAME STREQUAL "ohos-lite") endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0 - AND NOT TARGET_HIMIX AND NOT TARGET_MIX210) + AND NOT TARGET_HIMIX AND NOT TARGET_MIX210) message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0") endif() @@ -231,27 +261,30 @@ if(PLATFORM_ARM64) if(MSLITE_GPU_BACKEND STREQUAL "") set(MSLITE_GPU_BACKEND "opencl") endif() - if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off")) + + if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for arm64, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() elseif(PLATFORM_ARM32) - if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off") AND - (NOT MSLITE_GPU_BACKEND STREQUAL "")) + if((NOT MSLITE_GPU_BACKEND STREQUAL "opencl") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off") AND + (NOT MSLITE_GPU_BACKEND STREQUAL "")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for arm32, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() elseif(WIN32) set(MSLITE_GPU_BACKEND "off") else() - if(${MSLITE_REGISTRY_DEVICE} STREQUAL "SD3403") + if(${MSLITE_REGISTRY_DEVICE} STREQUAL "SD3403") set(MSLITE_ENABLE_DPICO_ATC_ADAPTER on) endif() + if(MSLITE_GPU_BACKEND STREQUAL "") set(MSLITE_GPU_BACKEND "off") endif() - if((NOT MSLITE_GPU_BACKEND STREQUAL "tensorrt") AND (NOT MSLITE_GPU_BACKEND STREQUAL "off") AND - (NOT MSLITE_GPU_BACKEND STREQUAL "cuda") AND (NOT MSLITE_GPU_BACKEND STREQUAL "opencl")) + + if((NOT MSLITE_GPU_BACKEND STREQUAL "tensorrt") AND(NOT MSLITE_GPU_BACKEND STREQUAL "off") AND + (NOT MSLITE_GPU_BACKEND STREQUAL "cuda") AND(NOT MSLITE_GPU_BACKEND STREQUAL "opencl")) message("invalid MSLITE_GPU_BACKEND value ${MSLITE_GPU_BACKEND} for x86_64, MSLITE_GPU_BACKEND is set to off.") set(MSLITE_GPU_BACKEND "off") endif() @@ -262,12 +295,15 @@ if(PLATFORM_ARM64 OR PLATFORM_ARM32) set(MSLITE_ENABLE_SSE off) set(MSLITE_ENABLE_AVX off) set(MSLITE_ENABLE_AVX512 off) + if(NOT MACHINE_LINUX_ARM64) set(MSLITE_ENABLE_CONVERTER off) endif() + set(MSLITE_ENABLE_RUNTIME_GLOG off) set(MSLITE_ENABLE_RUNTIME_CONVERT off) -#set for cross - compiling toolchain + + # set for cross - compiling toolchain set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH) @@ -305,12 +341,12 @@ endif() if(MSLITE_ENABLE_TRAIN AND NOT MSLITE_ENABLE_WEIGHT_DECODE) message(FATAL_ERROR "If MSLITE_ENABLE_WEIGHT_DECODE use if configured as off, " - "MSLITE_ENABLE_TRAIN must also be configured as off") + "MSLITE_ENABLE_TRAIN must also be configured as off") endif() if(MSLITE_ENABLE_CONTROLFLOW AND NOT MSLITE_ENABLE_MINDRT) message(FATAL_ERROR "If MSLITE_ENABLE_MINDRT use if configured as off, " - "MSLITE_ENABLE_CONTROLFLOW must also be configured as off") + "MSLITE_ENABLE_CONTROLFLOW must also be configured as off") endif() if(MSLITE_ENABLE_RUNTIME_CONVERT) @@ -324,6 +360,7 @@ endif() if(MSLITE_ENABLE_TRAIN) set(SUPPORT_TRAIN on) + if(NOT MSLITE_MINDDATA_IMPLEMENT STREQUAL "off" OR NOT PLATFORM_ARM) set(MSLITE_MINDDATA_IMPLEMENT full) endif() @@ -331,9 +368,11 @@ endif() if(MSLITE_ENABLE_NPU) set(SUPPORT_NPU on) + if(NOT PLATFORM_ARM) message(FATAL_ERROR "NPU only support platform arm.") endif() + if(DEFINED ENV{HWHIAI_DDK}) message("HWHIAI_DDK=$ENV{HWHIAI_DDK}") else() @@ -342,11 +381,11 @@ if(MSLITE_ENABLE_NPU) endif() if(TARGET_HIMIX OR TARGET_OHOS_LITE) - set(MSLITE_ENABLE_MINDRT off) + set(MSLITE_ENABLE_MINDRT off) endif() if(MSVC) - set(MSLITE_ENABLE_CONVERTER off) + set(MSLITE_ENABLE_CONVERTER off) endif() if(MSLITE_GPU_BACKEND STREQUAL cuda) diff --git a/mindspore-lite/cmake/merge.cmake b/mindspore-lite/cmake/merge.cmake index cbb44c868b56b4fc22bcb38e7574af883b568d95..caebf3bcd5b82ff487011ed89f96bbb3bb9c0a69 100644 --- a/mindspore-lite/cmake/merge.cmake +++ b/mindspore-lite/cmake/merge.cmake @@ -5,23 +5,29 @@ function(merge_parser CL_SRC_DIR OUT_FILE_NAME) if(NOT EXISTS ${CL_SRC_DIR}) return() endif() + if(DEFINED MSLITE_COMPILE_TWICE AND NOT MSLITE_COMPILE_TWICE) return() endif() + file(GLOB_RECURSE CL_LIST ${CL_SRC_DIR}/*.cc) list(SORT CL_LIST) set(out_file ${OUT_FILE_NAME}) file(REMOVE ${out_file}) file(WRITE ${out_file} "") + foreach(file_path ${CL_LIST}) file(TIMESTAMP ${file_path} CUR_TIMESTAMP "%Y%m%d%H%M.%S") string(COMPARE GREATER ${CUR_TIMESTAMP} ${MAX_TIMESTAMP} IS_GREATER) + if(IS_GREATER) set(MAX_TIMESTAMP ${CUR_TIMESTAMP}) endif() + file(STRINGS ${file_path} READ_CC_CONTEXT NEWLINE_CONSUME NO_HEX_CONVERSION) file(APPEND ${out_file} ${READ_CC_CONTEXT}) endforeach() + execute_process(COMMAND touch -c -t ${MAX_TIMESTAMP} ${OUT_FILE_NAME}) endfunction() @@ -35,30 +41,37 @@ function(merge_files SRC_DIR OUT_FILE_FOLDER OUT_FILE_PREFIX EXCLUDE_FILES_PATTE set(OUT_FILES "") file(GLOB OUT_FILES ${OUT_FILE_FOLDER}/${OUT_FILE_PREFIX}*.cc) - if(NOT ("${OUT_FILES}" STREQUAL "")) + + if(NOT("${OUT_FILES}" STREQUAL "")) file(REMOVE ${OUT_FILES}) endif() set(FILE_CNT 0) set(GENERATE_FILE_NUM 0) set(OUT_FILE ${OUT_FILE_FOLDER}/${OUT_FILE_PREFIX}_${GENERATE_FILE_NUM}.cc) + foreach(file_path ${SRC_LIST}) if(EXISTS ${EXCLUDE_FILES_PATTERN}) string(REGEX REPLACE ${EXCLUDE_FILES_PATTERN} "" file_path ${file_path}) endif() + if(EXISTS ${file_path}) file(TIMESTAMP ${file_path} CUR_TIMESTAMP "%Y%m%d%H%M.%S") string(COMPARE GREATER ${CUR_TIMESTAMP} ${MAX_TIMESTAMP} IS_GREATER) + if(IS_GREATER) set(MAX_TIMESTAMP ${CUR_TIMESTAMP}) endif() + math(EXPR FILE_CNT "${FILE_CNT} + 1") math(EXPR FILE_MOD "${FILE_CNT} % ${MAX_MERGE_FILE_NUM}") + if(${FILE_MOD} EQUAL 0) execute_process(COMMAND touch -c -t ${MAX_TIMESTAMP} ${OUT_FILE}) math(EXPR GENERATE_FILE_NUM "${GENERATE_FILE_NUM} + 1") set(OUT_FILE ${OUT_FILE_FOLDER}/${OUT_FILE_PREFIX}_${GENERATE_FILE_NUM}.cc) endif() + file(STRINGS ${file_path} READ_CC_CONTEXT NEWLINE_CONSUME NO_HEX_CONVERSION) file(APPEND ${OUT_FILE} ${READ_CC_CONTEXT}) else() diff --git a/mindspore-lite/cmake/mix210.toolchain.cmake b/mindspore-lite/cmake/mix210.toolchain.cmake index 6b2e8f22c205151ab0dd59515bb2d66be81f0242..6a87027d788a52ac8fc84222f8c194dedd263ef4 100644 --- a/mindspore-lite/cmake/mix210.toolchain.cmake +++ b/mindspore-lite/cmake/mix210.toolchain.cmake @@ -14,6 +14,7 @@ set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/aarch64-mix210-linux/bin/aarch64-mix210 find_path(GCC_PATH gcc) find_path(GXX_PATH g++) + if(NOT ${GCC_PATH} STREQUAL "GCC_PATH-NOTFOUND" AND NOT ${GXX_PATH} STREQUAL "GXX_PATH-NOTFOUND") set(FLATC_GCC_COMPILER ${GCC_PATH}/gcc) set(FLATC_GXX_COMPILER ${GXX_PATH}/g++) @@ -24,8 +25,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -#set(CMAKE_CXX_FLAGS "-march= -mfloat-abi=softfp -mfpu=neon-vfpv4 ${CMAKE_CXX_FLAGS}") - +# set(CMAKE_CXX_FLAGS "-march= -mfloat-abi=softfp -mfpu=neon-vfpv4 ${CMAKE_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8.2-a+fp16") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8.2-a+fp16") diff --git a/mindspore-lite/include/lite_types.h b/mindspore-lite/include/lite_types.h index 017e98a86c87087f48ac2f9e1dbeafe2d9704c49..50a9074e945093260d4c43b9577c96c9e5322bd0 100644 --- a/mindspore-lite/include/lite_types.h +++ b/mindspore-lite/include/lite_types.h @@ -42,6 +42,7 @@ typedef enum { DT_NPU, /**< NPU device type */ DT_ASCEND, /**< ASCEND device type */ DT_CUSTOM, /**< EXTEND device type */ + DT_HIAI, /**< HIAI NNRT device type */ DT_END /**< NO device type */ } DeviceType; diff --git a/mindspore-lite/include/model.h b/mindspore-lite/include/model.h index a72b19c683108b6ae9830918137cf764ec83400d..6ce95a55b24ce23df4447fb8d771a99df9b6de44 100644 --- a/mindspore-lite/include/model.h +++ b/mindspore-lite/include/model.h @@ -42,6 +42,18 @@ struct MS_API LiteGraph { std::vector output_indices_; int quant_type_; int device_type_ = -1; + Node() = default; + + Node(const Node &new_node) + : name_(new_node.name_), + op_type_(new_node.op_type_), + node_type_(new_node.node_type_), + primitive_(new_node.primitive_), + base_operator_(new_node.base_operator_), + input_indices_(new_node.input_indices_), + output_indices_(new_node.output_indices_), + quant_type_(new_node.quant_type_), + device_type_(new_node.device_type_) {} }; struct SubGraph { std::string name_; @@ -49,6 +61,14 @@ struct MS_API LiteGraph { std::vector output_indices_; std::vector node_indices_; std::vector tensor_indices_; + SubGraph() = default; + + SubGraph(const SubGraph &new_subgraph) + : name_(new_subgraph.name_), + input_indices_(new_subgraph.input_indices_), + output_indices_(new_subgraph.output_indices_), + node_indices_(new_subgraph.node_indices_), + tensor_indices_(new_subgraph.tensor_indices_) {} }; std::string name_; std::string version_; diff --git a/mindspore-lite/src/CMakeLists.txt b/mindspore-lite/src/CMakeLists.txt index 84c54640be23f65f77a815284bc3ec6c4758b639..fdc38a20ed327c98899f8073c28eb8e4fe47d4be 100644 --- a/mindspore-lite/src/CMakeLists.txt +++ b/mindspore-lite/src/CMakeLists.txt @@ -390,7 +390,7 @@ if(MSLITE_ENABLE_ACL) endif() add_library(mindspore-lite SHARED $) -target_link_libraries(mindspore-lite lite_src_common_mid mindspore::securec) +target_link_libraries(mindspore-lite PUBLIC lite_src_common_mid mindspore::securec) set_target_properties(mindspore-lite PROPERTIES CLEAN_DIRECT_OUTPUT 1) if(APPLE) @@ -421,13 +421,13 @@ if(APPLE) ${MINDSPORE_LITE_PUB_HDRS_FBS_HDRS} ) add_subdirectory(litert/delegate/coreml) - target_link_libraries(mindspore-lite_static coreml_proto_mid coreml_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC coreml_proto_mid coreml_kernel_mid) endif() - target_link_libraries(mindspore-lite_static lite_src_common_mid) + target_link_libraries(mindspore-lite_static PUBLIC lite_src_common_mid) add_dependencies(mindspore-lite_static fbs_inner_src) else() add_library(mindspore-lite_static STATIC $) - target_link_libraries(mindspore-lite_static lite_src_common_mid) + target_link_libraries(mindspore-lite_static PUBLIC lite_src_common_mid) endif() set_target_properties(mindspore-lite_static PROPERTIES OUTPUT_NAME "mindspore-lite") set_target_properties(mindspore-lite_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) @@ -444,54 +444,58 @@ if(MSVC) endif() # if(MSLITE_ENABLE_CLOUD_FUSION_INFERENCE) -# target_link_libraries(mindspore-lite cpu_kernel_mid nnacl_mid cpu_ops_mid mindspore_core mindspore::protobuf) -# target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl_mid cpu_ops_mid mindspore_core mindspore::protobuf) +# target_link_libraries(mindspore-lite PUBLIC cpu_kernel_mid nnacl_mid cpu_ops_mid mindspore_core mindspore::protobuf) +# target_link_libraries(mindspore-lite_static PUBLIC cpu_kernel_mid nnacl_mid cpu_ops_mid +# mindspore_core mindspore::protobuf) # else() -target_link_libraries(mindspore-lite cpu_kernel_mid nnacl_mid cpu_ops_mid) -target_link_libraries(mindspore-lite_static cpu_kernel_mid nnacl_mid cpu_ops_mid) +target_link_libraries(mindspore-lite PUBLIC cpu_kernel_mid nnacl_mid cpu_ops_mid) +target_link_libraries(mindspore-lite_static PUBLIC cpu_kernel_mid nnacl_mid cpu_ops_mid) # endif() -# target_link_libraries(mindspore-lite mindspore-extendrt) -# target_link_libraries(mindspore-lite_static mindspore-extendrt) +# target_link_libraries(mindspore-lite PUBLIC mindspore-extendrt) +# target_link_libraries(mindspore-lite_static PUBLIC mindspore-extendrt) if(SUPPORT_TRAIN) - target_link_libraries(mindspore-lite train_cpu_kernel_mid) - target_link_libraries(mindspore-lite_static train_cpu_kernel_mid) + target_link_libraries(mindspore-lite PUBLIC train_cpu_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC train_cpu_kernel_mid) endif() if(MSLITE_ENABLE_MINDRT) - target_link_libraries(mindspore-lite mindrt_mid) - target_link_libraries(mindspore-lite_static mindrt_mid) + target_link_libraries(mindspore-lite PUBLIC mindrt_mid) + target_link_libraries(mindspore-lite_static PUBLIC mindrt_mid) endif() if(MSLITE_GPU_BACKEND STREQUAL opencl) add_subdirectory(litert/kernel/gpu/opencl) - target_link_libraries(mindspore-lite opencl_kernel_mid) - target_link_libraries(mindspore-lite_static opencl_kernel_mid) + target_link_libraries(mindspore-lite PUBLIC opencl_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC opencl_kernel_mid) endif() if(SUPPORT_NPU) add_subdirectory(litert/delegate/npu) - target_link_libraries(mindspore-lite npu_kernel_mid) - target_link_libraries(mindspore-lite_static npu_kernel_mid) + target_link_libraries(mindspore-lite PUBLIC npu_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC npu_kernel_mid) + add_subdirectory(litert/delegate/hiai) + target_link_libraries(mindspore-lite PRIVATE hiai_kernel_mid) + target_link_libraries(mindspore-lite_static PRIVATE hiai_kernel_mid) endif() if(PLATFORM_ARM32 OR PLATFORM_ARM64 AND NOT TARGET_HIMIX AND NOT TARGET_MIX210 AND NOT TARGET_OHOS_LITE AND NOT MACHINE_LINUX_ARM64 AND NOT TARGET_OHOS) if(NOT TARGET_AOS_ARM) - target_link_libraries(mindspore-lite log) - target_link_libraries(mindspore-lite_static log) + target_link_libraries(mindspore-lite PUBLIC log) + target_link_libraries(mindspore-lite_static PUBLIC log) endif() endif() if(TARGET_OHOS) - target_link_libraries(mindspore-lite hilog_ndk.z.so) - target_link_libraries(mindspore-lite_static hilog_ndk.z.so) + target_link_libraries(mindspore-lite PUBLIC hilog_ndk.z.so) + target_link_libraries(mindspore-lite_static PUBLIC hilog_ndk.z.so) endif() if(MSLITE_MINDDATA_IMPLEMENT STREQUAL "lite") - target_link_libraries(mindspore-lite minddata_eager_mid minddata-lite) - target_link_libraries(mindspore-lite_static minddata_eager_mid) + target_link_libraries(mindspore-lite PUBLIC minddata_eager_mid minddata-lite) + target_link_libraries(mindspore-lite_static PUBLIC minddata_eager_mid) endif() if(SUPPORT_TRAIN) @@ -527,16 +531,16 @@ endif() if(PLATFORM_ARM) if(PLATFORM_ARM64 AND NOT TARGET_HIMIX AND NOT TARGET_MIX210 AND NOT MACHINE_LINUX_ARM64) if(TARGET_AOS_ARM AND TOOLCHAIN_NAME STREQUAL "gcc") - target_link_libraries(mindspore-lite cpu_opt_kernel_mid) - target_link_libraries(mindspore-lite_static cpu_opt_kernel_mid) + target_link_libraries(mindspore-lite PUBLIC cpu_opt_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC cpu_opt_kernel_mid) else() - target_link_libraries(mindspore-lite cpu_opt_kernel_mid nnacl_optimize_mid) - target_link_libraries(mindspore-lite_static cpu_opt_kernel_mid nnacl_optimize_mid) + target_link_libraries(mindspore-lite PUBLIC cpu_opt_kernel_mid nnacl_optimize_mid) + target_link_libraries(mindspore-lite_static PUBLIC cpu_opt_kernel_mid nnacl_optimize_mid) endif() endif() if(MSLITE_ENABLE_FP16) - target_link_libraries(mindspore-lite cpu_fp16_kernel_mid nnacl_fp16_mid) - target_link_libraries(mindspore-lite_static cpu_fp16_kernel_mid nnacl_fp16_mid) + target_link_libraries(mindspore-lite PUBLIC cpu_fp16_kernel_mid nnacl_fp16_mid) + target_link_libraries(mindspore-lite_static PUBLIC cpu_fp16_kernel_mid nnacl_fp16_mid) endif() endif() @@ -546,14 +550,14 @@ if(MSLITE_ENABLE_RUNTIME_CONVERT) cpu_kernel_mid ccsrc_src_mid converter_src_mid lite_exporter_mid config_parser_mid mslite_converter_plugin mindspore_core mindspore_ops coder_mid mindir_serializer_mid mindspore::protobuf mindspore::securec) - target_link_libraries(mindspore-lite_static + target_link_libraries(mindspore-lite_static PUBLIC quantizer_mid fusion_mid proto_mid graph_pass_mid preprocess_mid cpu_kernel_mid ccsrc_src_mid converter_src_mid lite_exporter_mid config_parser_mid mslite_converter_plugin mindspore_core mindspore_ops coder_mid mindir_serializer_mid mindspore::protobuf mindspore::securec) target_link_libraries(mindspore-lite ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) - target_link_libraries(mindspore-lite_static + target_link_libraries(mindspore-lite_static PUBLIC ccsrc_debug_common_mid_ mindir_proto_mid _mindspore_transform_express_ir_obj) endif() @@ -567,17 +571,18 @@ if(SUPPORT_CUDA AND NOT (MSLITE_ENABLE_CLOUD_FUSION_INFERENCE OR MSLITE_ENABLE_C find_package(CUDA) add_subdirectory(extendrt/kernel/cuda) list(APPEND CUDA_NVCC_FLAGS -arch=sm_53 --expt-relaxed-constexpr) - target_link_libraries(mindspore-lite cuda_lite_kernel_mid cuda_ops mindspore_core mindspore_ops) + target_link_libraries(mindspore-lite PUBLIC cuda_lite_kernel_mid cuda_ops + mindspore_core mindspore_ops) endif() if(MSLITE_ENABLE_MULTI_LAYOUT) - target_link_libraries(mindspore-lite bolt_kernel_mid) - target_link_libraries(mindspore-lite_static bolt_kernel_mid) + target_link_libraries(mindspore-lite PUBLIC bolt_kernel_mid) + target_link_libraries(mindspore-lite_static PUBLIC bolt_kernel_mid) endif() if(MSLITE_ENABLE_RUNTIME_GLOG) - target_link_libraries(mindspore-lite mindspore::glog) - target_link_libraries(mindspore-lite_static mindspore::glog) + target_link_libraries(mindspore-lite PUBLIC mindspore::glog) + target_link_libraries(mindspore-lite_static PUBLIC mindspore::glog) endif() if(DEFINED ARCHS) @@ -607,17 +612,17 @@ if(DEFINED ARCHS) endif() if(NOT WIN32) - target_link_libraries(mindspore-lite dl) + target_link_libraries(mindspore-lite PUBLIC dl) endif() if(MSLITE_ENABLE_MODEL_OBF) - target_link_libraries(mindspore-lite ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so) - target_link_libraries(mindspore-lite_static ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so) + target_link_libraries(mindspore-lite PUBLIC ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so) + target_link_libraries(mindspore-lite_static PUBLIC ${OBF_LIB_DIR}/libmsdeobfuscator-lite.so) endif() if(MSLITE_ENABLE_KERNEL_EXECUTOR) - target_link_libraries(mindspore-lite mindspore_core mindspore_ops) - target_link_libraries(mindspore-lite_static mindspore_core mindspore_ops) + target_link_libraries(mindspore-lite PUBLIC mindspore_core mindspore_ops) + target_link_libraries(mindspore-lite_static PUBLIC mindspore_core mindspore_ops) endif() add_subdirectory(extendrt) diff --git a/mindspore-lite/src/common/context_util.cc b/mindspore-lite/src/common/context_util.cc index bc2e40e1326a94c9a179f6dceb77c9e0339ea264..d7eb703fc334326236686bdf7812152e6c4abffd 100644 --- a/mindspore-lite/src/common/context_util.cc +++ b/mindspore-lite/src/common/context_util.cc @@ -73,6 +73,17 @@ std::shared_ptr NPUDeviceInfoFromNPUDeviceContext return npu_info; } +std::shared_ptr HIAIDeviceInfoFromHIAIDeviceContext( + const lite::DeviceContext &hiai_context) { + if (hiai_context.device_type_ != DT_HIAI) { + MS_LOG(ERROR) << "Function input parameter is not HIAI context."; + return nullptr; + } + auto hiai_info = std::make_shared(); + MS_CHECK_TRUE_RET(hiai_info != nullptr, nullptr); + return hiai_info; +} + std::vector GetBatchSize(const std::string &batch_size) { std::vector res; std::vector batch_size_vec = StrSplit(batch_size, ","); @@ -140,11 +151,10 @@ mindspore::Context *MSContextFromContext(const std::shared_ptr &co } auto &device_infos = ms_context->MutableDeviceInfo(); std::map(const lite::DeviceContext &)>> - transfer_funcs = {{DT_CPU, CPUDeviceInfoFromCPUDeviceContext}, - {DT_GPU, GPUDeviceInfoFromGPUDeviceContext}, - {DT_NPU, NPUDeviceInfoFromNPUDeviceContext}, - {DT_ASCEND, AscendDeviceInfoFromAscendDeviceContext}, - {DT_CUSTOM, CustomDeviceInfoFromCustomDeviceContext}}; + transfer_funcs = { + {DT_CPU, CPUDeviceInfoFromCPUDeviceContext}, {DT_GPU, GPUDeviceInfoFromGPUDeviceContext}, + {DT_NPU, NPUDeviceInfoFromNPUDeviceContext}, {DT_ASCEND, AscendDeviceInfoFromAscendDeviceContext}, + {DT_CUSTOM, CustomDeviceInfoFromCustomDeviceContext}, {DT_HIAI, HIAIDeviceInfoFromHIAIDeviceContext}}; for (auto &device_context : context->device_list_) { auto device_type = device_context.device_type_; if (transfer_funcs.find(device_type) == transfer_funcs.end()) { diff --git a/mindspore-lite/src/common/ops/populate/custom_populate.cc b/mindspore-lite/src/common/ops/populate/custom_populate.cc index 0cde665bc788a80d15126b09d507b391016b0435..04ce96dba5ab71fe08967cc4e571f5a028b19a99 100644 --- a/mindspore-lite/src/common/ops/populate/custom_populate.cc +++ b/mindspore-lite/src/common/ops/populate/custom_populate.cc @@ -172,6 +172,19 @@ OpParameter *CreateGridSamplerParameter(const schema::Custom *value) { return reinterpret_cast(param); } +OpParameter *CreateThirdPartyModelParameter(const void *prim) { + auto *param = static_cast(malloc(sizeof(CustomParameter))); + if (param == nullptr) { + MS_LOG(ERROR) << "Malloc ThirdPartyModel Parameter failed."; + return nullptr; + } + memset(param, 0, sizeof(CustomParameter)); + param->op_parameter_.type_ = PrimType_Inner_ThirdPartyModel; + // Just use the attr_data pointer to save the prim directly, the inner value is parsed as necessary. + param->attr_data[0] = static_cast(const_cast(prim)); + return reinterpret_cast(param); +} + OpParameter *PopulateCustomParameter(const void *prim) { MS_CHECK_TRUE_RET(prim != nullptr, nullptr); auto primitive = static_cast(prim); @@ -221,6 +234,8 @@ OpParameter *PopulateCustomParameter(const void *prim) { return CreateCustomConv3DParameter(value); } else if (type == "GridSampler") { return CreateGridSamplerParameter(value); + } else if (type == "ThirdPartyModel") { + return CreateThirdPartyModelParameter(prim); } else { MS_LOG(WARNING) << "Unsupported custom type: " << type; } diff --git a/mindspore-lite/src/common/prim_util.cc b/mindspore-lite/src/common/prim_util.cc index 7da14e5b3f239e3b72028569bd97c2edfc04bbf7..29dbf6ebd4365c9085d82c1de31218b3810e8b6d 100644 --- a/mindspore-lite/src/common/prim_util.cc +++ b/mindspore-lite/src/common/prim_util.cc @@ -36,7 +36,8 @@ static const char *const kInnerOpNames[C20NUM] = {"Inner_ToFormat", "I "Inner_CustomGru", "Inner_CastGatherReduceFusion", "Inner_ReduceConcatFusion", "Inner_AclCustomOp", "Inner_CustomMaskedFill", "Inner_CustomTensorScatterMax", - "Inner_CustomIsInf"}; + "Inner_CustomIsInf", "Inner_Conv3D", + "Inner_GridSampler", "Inner_ThirdPartyModel"}; int GetPrimitiveType(const void *primitive, int schema_version) { if (primitive == nullptr) { return -1; @@ -56,6 +57,8 @@ const char *PrimitiveCurVersionTypeName(int type) { return schema::EnumNamePrimitiveType(static_cast(type)); } else if (type >= static_cast(schema::PrimitiveType_MAX)) { if (type >= PrimType_InnerOpMin && type < PrimType_InnerOpMax) { + MS_LOG(INFO) << "Current real type index:" << type << ", expected type index:" << (type - PrimType_InnerOpMin) + << "."; return kInnerOpNames[type - PrimType_InnerOpMin]; } } diff --git a/mindspore-lite/src/litert/c_api/context_c.cc b/mindspore-lite/src/litert/c_api/context_c.cc index c2390017f54eabae145e2042a4318761544cb3e1..6b0a0cd2cd79a3a82fa9b6a781e90f03ff1d47ce 100644 --- a/mindspore-lite/src/litert/c_api/context_c.cc +++ b/mindspore-lite/src/litert/c_api/context_c.cc @@ -143,6 +143,8 @@ MSDeviceInfoHandle MSDeviceInfoCreate(MSDeviceType device_type) { impl = new (std::nothrow) mindspore::GPUDeviceInfo(); } else if (kMSDeviceTypeKirinNPU == device_type) { impl = new (std::nothrow) mindspore::KirinNPUDeviceInfo(); + } else if (kMSDeviceTypeHIAI == device_type) { + impl = new (std::nothrow) mindspore::HIAIDeviceInfo(); } else { MS_LOG(ERROR) << "device_type is invalid."; impl = nullptr; @@ -279,6 +281,9 @@ void MSDeviceInfoSetFrequency(MSDeviceInfoHandle device_info, int frequency) { if (static_cast(impl_device->GetDeviceType()) == kMSDeviceTypeKirinNPU) { auto impl = static_cast(device_info); impl->SetFrequency(frequency); + } else if (static_cast(impl_device->GetDeviceType()) == kMSDeviceTypeHIAI) { + auto impl = static_cast(device_info); + impl->SetFrequency(frequency); } else { MS_LOG(ERROR) << "Unsupported Feature."; } diff --git a/mindspore-lite/src/litert/cxx_api/context.cc b/mindspore-lite/src/litert/cxx_api/context.cc index c59b91b8fba23caacdd5f24a3acc830093517c69..0a3d9a112c6fe63b84ea9ab0c01892b998f570f2 100644 --- a/mindspore-lite/src/litert/cxx_api/context.cc +++ b/mindspore-lite/src/litert/cxx_api/context.cc @@ -50,6 +50,10 @@ constexpr auto kModelOptionAscendDynamicBatchSize = "mindspore.option.ascend.dyn constexpr auto kModelOptionAscendDynamicImageSize = "mindspore.option.ascend.dynamic_image_size"; constexpr auto kModelOptionAscendBufferOptimize = "mindspore.option.ascend.buffer_optimize"; constexpr auto kModelOptionAscendRankID = "mindspore.option.ascend.rank_id"; +constexpr auto kModelOptionHIAIDeviceID = "mindspore.option.hiai.device_id"; +constexpr auto kModelOptionHIAIPerformanceMode = "mindspore.option.hiai.performance_mode"; +constexpr auto kModelOptionHIAIPriority = "mindspore.option.hiai.priority"; +constexpr auto kModelOptionHIAIEnableFP16 = "mindspore.option.hiai.enable_fp16"; #ifdef USE_GLOG extern "C" { extern void mindspore_log_init(); @@ -464,6 +468,86 @@ std::vector GPUDeviceInfo::GetPrecisionModeChar() const { return ret; } +void HIAIDeviceInfo::SetDeviceID(uint32_t device_id) { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return; + } + data_->params[kModelOptionHIAIDeviceID] = device_id; +} + +uint32_t HIAIDeviceInfo::GetDeviceID() const { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return 0; + } + return GetValue(data_, kModelOptionHIAIDeviceID); +} + +void HIAIDeviceInfo::SetPerformanceMode(int performance_mode) { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return; + } + data_->params[kModelOptionHIAIPerformanceMode] = performance_mode; +} + +int HIAIDeviceInfo::GetPerformanceMode() const { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return 0; + } + return GetValue(data_, kModelOptionHIAIPerformanceMode); +} + +void HIAIDeviceInfo::SetPriority(int priority) { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return; + } + data_->params[kModelOptionHIAIPriority] = priority; +} + +int HIAIDeviceInfo::GetPriority() const { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return 0; + } + return GetValue(data_, kModelOptionHIAIPriority); +} + +void HIAIDeviceInfo::SetEnableFP16(bool is_fp16) { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return; + } + data_->params[kModelOptionHIAIEnableFP16] = is_fp16; +} + +bool HIAIDeviceInfo::GetEnableFP16() const { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return false; + } + return GetValue(data_, kModelOptionHIAIEnableFP16); +} + +void HIAIDeviceInfo::SetFrequency(int frequency) { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return; + } + data_->params[kModelOptionKirinNpuFrequency] = frequency; +} + +int HIAIDeviceInfo::GetFrequency() const { + if (data_ == nullptr) { + MS_LOG(ERROR) << "Invalid context."; + return 0; + } + return GetValue(data_, kModelOptionKirinNpuFrequency); +} + void AscendDeviceInfo::SetDeviceID(uint32_t device_id) { if (data_ == nullptr) { MS_LOG(ERROR) << "Invalid context."; diff --git a/mindspore-lite/src/litert/cxx_api/converters.cc b/mindspore-lite/src/litert/cxx_api/converters.cc index 8daf0242090d51e82e693269de7a7c41bf26add3..d3c2cdcb6c7b25e40489980b91d399b9d8985c19 100644 --- a/mindspore-lite/src/litert/cxx_api/converters.cc +++ b/mindspore-lite/src/litert/cxx_api/converters.cc @@ -86,6 +86,17 @@ Status ContextUtils::AddCustomDevice(lite::InnerContext *inner_context, return kSuccess; } +Status ContextUtils::AddHIAIDevice(lite::InnerContext *inner_context, size_t device_id, int performance_mode, + int priority, bool enable_fp16) { + lite::DeviceInfo device_info = {0}; + device_info.hiai_device_info_.device_id_ = device_id; + device_info.hiai_device_info_.performance_mode_ = performance_mode; + device_info.hiai_device_info_.priority_ = priority; + device_info.hiai_device_info_.enable_fp16_ = enable_fp16; + inner_context->device_list_.push_back({lite::DT_HIAI, device_info}); + return kSuccess; +} + void ContextUtils::ResetContextDefaultParam(Context *context) { if (context->GetInterOpParallelNum() == 0) { context->SetInterOpParallelNum(kDefaultInterOpParallelNum); @@ -163,6 +174,10 @@ std::shared_ptr ContextUtils::Convert(Context *context) { ret = AddAscendDevice(inner_context.get(), device.get()); } else if (device->GetDeviceType() == kCustomDevice) { ret = AddCustomDevice(inner_context.get(), device); + } else if (device->GetDeviceType() == kHIAI) { + auto hiai_device_info = device->Cast(); + ret = AddHIAIDevice(inner_context.get(), hiai_device_info->GetDeviceID(), hiai_device_info->GetPerformanceMode(), + hiai_device_info->GetPriority(), hiai_device_info->GetEnableFP16()); } if (ret != kSuccess) { MS_LOG(ERROR) << "Add device failed!"; diff --git a/mindspore-lite/src/litert/cxx_api/converters.h b/mindspore-lite/src/litert/cxx_api/converters.h index d510300274006963d7a6330fd39bfb364cf23fae..c26eca45a91a8700f7c4e58b0bcb28b46bcdfd65 100644 --- a/mindspore-lite/src/litert/cxx_api/converters.h +++ b/mindspore-lite/src/litert/cxx_api/converters.h @@ -46,6 +46,8 @@ class MS_API ContextUtils { static Status AddNpuDevice(bool enable_fp16, int frequency, lite::InnerContext *inner_context); static Status AddAscendDevice(lite::InnerContext *inner_context, DeviceInfoContext *device); static Status AddCustomDevice(lite::InnerContext *inner_context, const std::shared_ptr &device); + static Status AddHIAIDevice(lite::InnerContext *inner_context, size_t device_id, int performance_mode, int priority, + bool enable_fp16); static bool IsAffinityModeValid(int affinity_mode) { return affinity_mode >= lite::NO_BIND && affinity_mode <= lite::MID_CPU; } diff --git a/mindspore-lite/src/litert/cxx_api/kernel_executor/CMakeLists.txt b/mindspore-lite/src/litert/cxx_api/kernel_executor/CMakeLists.txt index 60e6437b96523def0b04ef404815d568b6956f12..03158511d27e5411219d4d7b1a4fd878993decf9 100644 --- a/mindspore-lite/src/litert/cxx_api/kernel_executor/CMakeLists.txt +++ b/mindspore-lite/src/litert/cxx_api/kernel_executor/CMakeLists.txt @@ -38,6 +38,10 @@ if(${MSLITE_ENABLE_NPU}) ${CMAKE_CURRENT_SOURCE_DIR}/custom_om_infer.cc ) list(APPEND KERNEL_EXECUTOR_SRC ${CUSTOM_OM_CXX}) + set(HIAI_CUSTOM_OM_CXX + ${CMAKE_CURRENT_SOURCE_DIR}/../../delegate/hiai/hiai_model_kernel.cc + ) + list(APPEND KERNEL_EXECUTOR_SRC ${HIAI_CUSTOM_OM_CXX}) endif() add_library(kernel_executor SHARED ${KERNEL_EXECUTOR_SRC}) diff --git a/mindspore-lite/src/litert/delegate/hiai/CMakeLists.txt b/mindspore-lite/src/litert/delegate/hiai/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b989d82e737317513305e8e5328ffb644078d83a --- /dev/null +++ b/mindspore-lite/src/litert/delegate/hiai/CMakeLists.txt @@ -0,0 +1,35 @@ +include_directories(${DDK_PATH}) +file(GLOB_RECURSE HIAI_NPU_RUNTIME_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) + +set(LIBCXX_LIB_DIR "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a") +link_directories(${LIBCXX_LIB_DIR}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANDROID_STL=c++_shared") +add_library(c++_shared SHARED IMPORTED) + +set_target_properties(c++_shared PROPERTIES IMPORTED_LOCATION ${LIBCXX_LIB_DIR}/libc++_shared.so) +add_library(hiai SHARED IMPORTED) +set_target_properties(hiai PROPERTIES IMPORTED_LOCATION ${DDK_LIB_PATH}/libhiai.so) +add_library(hiai_ir SHARED IMPORTED) +set_target_properties(hiai_ir PROPERTIES IMPORTED_LOCATION ${DDK_LIB_PATH}/libhiai_ir.so) +add_library(hiai_ir_build SHARED IMPORTED) +set_target_properties(hiai_ir_build PROPERTIES IMPORTED_LOCATION ${DDK_LIB_PATH}/libhiai_ir_build.so) +if(EXISTS "${DDK_LIB_PATH}/libhiai_model_compatible.so") + add_library(hiai_model_compatible SHARED IMPORTED) + set_target_properties(hiai_model_compatible PROPERTIES IMPORTED_LOCATION + ${DDK_LIB_PATH}/libhiai_model_compatible.so) +else() + message(WARNING "hiai_model_compatible not found: ${DDK_LIB_PATH}/libhiai_model_compatible.so") +endif() +add_library(hiai_kernel_mid OBJECT ${HIAI_NPU_RUNTIME_SRC}) +add_dependencies(hiai_kernel_mid fbs_src) +target_link_libraries( + hiai_kernel_mid + hiai + hiai_ir + hiai_ir_build + c++_shared +) +if(TARGET hiai_model_compatible) + target_link_libraries(hiai_kernel_mid hiai_model_compatible) +endif() diff --git a/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.cc b/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.cc new file mode 100644 index 0000000000000000000000000000000000000000..d5ea62ab66e5f2e25d4fef7cc191a39efb6fb836 --- /dev/null +++ b/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.cc @@ -0,0 +1,308 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include "include/model.h" +#include "src/common/log_adapter.h" +#include "src/common/file_utils.h" +#include "schema/model_generated.h" +#include "schema/ops_generated.h" +#include "flatbuffers/flatbuffers.h" +#include "litert/tensor_category.h" +#include "src/litert/delegate/hiai/hiai_delegate.h" +#include "src/litert/delegate/hiai/hiai_model_kernel.h" + +namespace { +constexpr int32_t kNum2 = 2; +static constexpr int kBitNum1 = 1; +static constexpr int kBitNum8 = 8; +static constexpr int kBitNum16 = 16; +} // namespace + +namespace mindspore { +namespace lite { +Status HIAIDelegate::Init() { + is_support_npu_ = IsSupportNPU(); + if (is_support_npu_) { + MS_LOG(WARNING) + << "Current platform support NPU, set frequency to 3, device type to NPU. Original frequency value is " + << frequency_type_ << " device type is CPU by default."; + device_type_ = 0; + frequency_type_ = 3; + } + return kSuccess; +} + +bool HIAIDelegate::NeedBitUpackCheck(const schema::Tensor &src_tensor) { + if (src_tensor.enableHuffmanCode()) { + return true; + } + bool need_bit_unpack = src_tensor.quantParams() != nullptr && src_tensor.quantParams()->size() > 0 && + src_tensor.quantParams()->Get(0) != nullptr; + if (need_bit_unpack) { + auto num_bits = src_tensor.quantParams()->Get(0)->numBits(); + need_bit_unpack = ((num_bits >= kBitNum1 && num_bits < kBitNum8) || (num_bits > kBitNum8 && num_bits < kBitNum16)); + } + + return need_bit_unpack; +} + +int HIAIDelegate::DecompressTensor(const schema::Tensor &src_tensor) { + if (src_tensor.weightQuantCompressType() == schema::WeightQuantCompressType_FSE || + src_tensor.weightQuantCompressType() == schema::WeightQuantCompressType_INDEXING || + src_tensor.weightQuantCompressType() == schema::WeightQuantCompressType_SPARSE) { + return RET_NOT_SUPPORT; + } + if (!NeedBitUpackCheck(src_tensor)) { + return RET_NO_CHANGE; + } + MS_LOG(ERROR) << "DecompressTensor Error."; + return RET_ERROR; +} + +Status HIAIDelegate::CheckTensorSupported(const schema::Tensor *primitive) { + if (primitive == nullptr) { + MS_LOG(ERROR) << "primitive is nullptr, which type is Tensor."; + return mindspore::kLiteSuccessExit; + } + + int32_t data_type = primitive->dataType(); + if (data_type <= kTypeUnknown || data_type >= kMonadTypeEnd) { + MS_LOG(ERROR) << "invalid data type. " << data_type; + return mindspore::kLiteSuccessExit; + } + + if (primitive->dims() == nullptr) { + MS_LOG(DEBUG) << "Dims of tensor is nullptr"; + return mindspore::kLiteSuccessExit; + } + + if (data_type == kObjectTypeTensorType) { + MS_LOG(ERROR) << "Not support TensorList."; + return mindspore::kLiteNotSupport; + } + + if (primitive->data() == nullptr || primitive->data()->size() <= 0) { + MS_LOG(DEBUG) << "No valid data converted."; + return mindspore::kSuccess; + } else { + auto ret = DecompressTensor(*primitive); + if (ret == RET_NO_CHANGE) { + } else { + MS_LOG(ERROR) << "Not support Decompress Tensor."; + return mindspore::kLiteNotSupport; + } + } + return mindspore::kSuccess; +} + +int HIAIDelegate::CompareVersion(const std::string &version1, const std::string &version2) { + std::istringstream iss1(version1); + std::istringstream iss2(version2); + std::string string1; + std::string string2; + while (!iss1.eof() || !iss2.eof()) { + getline(iss1, string1, '.'); + getline(iss2, string2, '.'); + if (stoi(string1) > stoi(string2)) return 1; + if (stoi(string1) < stoi(string2)) return -1; + string1 = string2 = "0"; + } + return lite::RET_OK; +} + +bool HIAIDelegate::CheckDDKVerGreatEqual(const std::string &spec_version) { + auto client = std::make_shared(); + if (client->GetVersion() != nullptr) { + std::string version = client->GetVersion(); + int ret = CompareVersion(version, spec_version); + if (ret < lite::RET_OK) { + MS_LOG(WARNING) << "DDK Version " << version << " less than " << spec_version; + return false; + } + } else { + MS_LOG(WARNING) << "Get DDK Version failed!"; + return false; + } + return true; +} + +bool HIAIDelegate::IsSupportNPU() { + // Avoid multiple checks + if (CheckDDKVerGreatEqual("100.320.011.019")) { + is_support_npu_ = true; + MS_LOG(INFO) << "Current device supports NPU."; + } else { + is_support_npu_ = false; + MS_LOG(WARNING) << "Current device does not support NPU."; + } + return is_support_npu_; +} + +void HIAIDelegate::ShallowCopyLiteGraph(const lite::LiteGraph &lite_graph) { + std::vector node_list; + node_list.reserve(lite_graph.all_nodes_.size()); + MS_LOG(INFO) << "HIAIDelegate ShallowCopyLiteGraph start."; + // copy node + for (auto node : lite_graph.all_nodes_) { + auto new_node = new (std::nothrow) LiteGraph::Node(*node); + if (new_node == nullptr) { + MS_LOG(ERROR) << "New LiteGraph node failed. Origin node:" << node->name_; + for (auto cur_node : node_list) { + delete cur_node; + } + return; + } + node_list.emplace_back(new_node); + } + // copy subgraph + std::vector subgraph_list; + for (auto subgraph : lite_graph.sub_graphs_) { + auto new_subgraph = new (std::nothrow) LiteGraph::SubGraph(*subgraph); + if (new_subgraph == nullptr) { + MS_LOG(ERROR) << "New LiteGraph::Subgraph failed. Origin graph:" << subgraph->name_; + for (auto cur_subgraph : subgraph_list) { + delete cur_subgraph; + } + return; + } + subgraph_list.emplace_back(new_subgraph); + } + for (auto tensor : lite_graph.all_tensors_) { + Status ret = CheckTensorSupported(static_cast(tensor)); + if (ret == kLiteError) { + MS_LOG(ERROR) << "Tensor supported check failed."; + return; + } + } + + lite_graph_ = new (std::nothrow) lite::LiteGraph(); + if (lite_graph_ == nullptr) { + MS_LOG(ERROR) << "New LiteGraph failed."; + delete lite_graph_; + return; + } + + lite_graph_->name_ = lite_graph.name_; + lite_graph_->version_ = lite_graph.version_; + lite_graph_->input_indices_ = lite_graph.input_indices_; + lite_graph_->output_indices_ = lite_graph.output_indices_; + lite_graph_->all_tensors_ = lite_graph.all_tensors_; + lite_graph_->all_nodes_ = node_list; + lite_graph_->sub_graphs_ = subgraph_list; + MS_LOG(INFO) << "HIAIDelegate ShallowCopyLiteGraph success. all_tensors_ size " << lite_graph_->all_tensors_.size() + << " all_nodes_ size " << lite_graph_->all_nodes_.size() << " sub_graphs_ size " + << lite_graph_->sub_graphs_.size() << " sub_graphs_[0] input_indices_ size " + << lite_graph_->sub_graphs_[0]->input_indices_.size() << " sub_graphs_[0] output_indices_ size " + << lite_graph_->sub_graphs_[0]->output_indices_.size(); +} + +bool HIAIDelegate::IsCustomModel() const { + // check if there is only one Cutsom kernel in LiteModel. + if (lite_graph_ == nullptr) { + MS_LOG(ERROR) << "Current lite graph is null."; + return false; + } + if (lite_graph_->all_nodes_.size() != 1) { + MS_LOG(ERROR) << "Current node num in lite graph is:" << lite_graph_->all_nodes_.size() << "."; + return false; + } + auto node = lite_graph_->all_nodes_[0]; + if (node == nullptr) { + MS_LOG(ERROR) << "Current node is null in lite graph."; + return false; + } + if (node->node_type_ != mindspore::schema::PrimitiveType_Custom) { + MS_LOG(ERROR) << "Current node type is:" << node->node_type_ << ", expected type is PrimitiveType_Custom."; + return false; + } + return true; +} + +Status HIAIDelegate::Build(DelegateModel *model) { + MS_LOG(INFO) << "Choose to build offline inference model"; + if (!IsCustomModel()) { + MS_LOG(ERROR) << "not third party model"; + return kLiteError; + } + // Get Node Tensor + auto node = lite_graph_->all_nodes_[0]; + MS_CHECK_TRUE_RET(node != nullptr, kLiteError); + auto input_num = node->input_indices_.size(); // node 的输入 + // at least one input and one OM model buffer(as the last constant input) + MS_CHECK_TRUE_RET(input_num >= kNum2, kLiteError); + MS_CHECK_TRUE_RET(lite_graph_->all_tensors_.size() >= kNum2, kLiteError); + auto input_tensor = lite_graph_->all_tensors_[node->input_indices_[0]]; + MS_CHECK_TRUE_RET(input_tensor != nullptr, kLiteError); + auto model_tensor = lite_graph_->all_tensors_[node->input_indices_[input_num - 1]]; + MS_CHECK_TRUE_RET(model_tensor != nullptr, kLiteError); + MS_CHECK_TRUE_RET(model_tensor->data() != nullptr, kLiteError); + model_buffer_ = const_cast(model_tensor->data()->data()); + model_size_ = model_tensor->data()->size(); + MS_LOG(DEBUG) << "Model input size:" << model->inputs().size() << ", output size:" << model->outputs().size() << "."; + auto hiai_model_kernel = new (std::nothrow) + HIAIModelKernel(model->inputs(), model->outputs(), model_buffer_, model_size_, frequency_type_, device_type_); + if (hiai_model_kernel == nullptr) { + MS_LOG(ERROR) << "new HIAIModelKernel failed."; + return kLiteError; + } + (void)model->Replace(model->BeginKernelIterator(), model->EndKernelIterator(), hiai_model_kernel); + MS_LOG(INFO) << "Replace kernel in HIAIDelegate success."; + return kSuccess; +} + +void HIAIDelegate::FreeLiteGraph(lite::LiteGraph **liteGraph) { + if (liteGraph != nullptr && *liteGraph != nullptr) { + MS_LOG(INFO) << "start to free LiteGraph."; + auto graph = *liteGraph; + graph->name_.clear(); + graph->input_indices_.clear(); + graph->output_indices_.clear(); + MS_LOG(INFO) << "Destroying nodes."; + + for (size_t idx = 0; idx < graph->all_nodes_.size(); idx++) { + if (graph->all_nodes_[idx] != nullptr) { + delete graph->all_nodes_[idx]; + graph->all_nodes_[idx] = nullptr; + } + } + MS_LOG(INFO) << "Destroying subgraphs."; + + for (size_t idx = 0; idx < graph->sub_graphs_.size(); idx++) { + if (graph->sub_graphs_[idx] != nullptr) { + delete graph->sub_graphs_[idx]; + graph->sub_graphs_[idx] = nullptr; + } + } + delete graph; + *liteGraph = nullptr; + } else { + MS_LOG(WARNING) << "nnrt_lite_graph is nullptr, no need to free."; + } +} + +HIAIDelegate::~HIAIDelegate() { + delete lite_graph_; + lite_graph_ = nullptr; + if (lite_graph_ != nullptr) { + MS_LOG(ERROR) << "Delete HIAIDelegate."; + } +} +} // namespace lite +} // namespace mindspore diff --git a/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.h b/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.h new file mode 100644 index 0000000000000000000000000000000000000000..e4dd687013cf176f18849feedabdfc0f44286129 --- /dev/null +++ b/mindspore-lite/src/litert/delegate/hiai/hiai_delegate.h @@ -0,0 +1,63 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef MINDSPORE_HIAI_NNR_DELEGATE_H +#define MINDSPORE_HIAI_NNR_DELEGATE_H + +#include +#include +#include +#include "include/api/delegate.h" +#include "include/model.h" +#include "src/litert/inner_context.h" +#include "schema/model_generated.h" +#include "include/HiAiModelManagerService.h" +#include "src/litert/delegate/hiai/hiai_model_kernel.h" + +namespace mindspore { +namespace lite { +class HIAIDelegate : public Delegate { + public: + HIAIDelegate() = default; + explicit HIAIDelegate(const HIAIDeviceInfo &hiai_device_info) : hiai_device_info_(hiai_device_info) {} + ~HIAIDelegate() override; + Status Init() override; + Status Build(DelegateModel *model) override; + void ShallowCopyLiteGraph(const lite::LiteGraph &liteGraph); + void FreeLiteGraph(lite::LiteGraph **liteGraph); + + private: + bool IsSupportNPU(); + bool CheckDDKVerGreatEqual(const std::string &spec_version); + int CompareVersion(const std::string &version1, const std::string &version2); + bool IsCustomModel() const; + Status CheckTensorSupported(const schema::Tensor *primitive); + bool NeedBitUpackCheck(const schema::Tensor &src_tensor); + int DecompressTensor(const schema::Tensor &src_tensor); + int32_t frequency_type_ = 1; // hiai::AiModelDescription_Frequency_LOW + int32_t device_type_ = 3; // CPU + uint8_t *model_buffer_ = nullptr; + size_t model_size_ = -1; + HIAIDeviceInfo hiai_device_info_; + LiteGraph *lite_graph_ = nullptr; + std::string cache_dir_{}; + bool is_support_npu_ = false; + std::vector in_tensors_; + std::vector out_tensors_; +}; +} // namespace lite +} // namespace mindspore + +#endif // MINDSPORE_HIAI_NNR_DELEGATE_H diff --git a/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.cc b/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.cc new file mode 100644 index 0000000000000000000000000000000000000000..374a97780c6015e307b1815efcf8f3cfb42f85ee --- /dev/null +++ b/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.cc @@ -0,0 +1,285 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include "src/litert/delegate/hiai/hiai_model_kernel.h" +#include "litert/cxx_api/tensor/tensor_impl.h" +#include "include/api/data_type.h" + +namespace mindspore { +int HIAIModelKernel::Prepare() { + model_manager_client_ = std::make_shared(); + model_builder = std::make_shared(model_manager_client_); + auto client_ret = model_manager_client_->Init(nullptr); // sync mode + if (client_ret != lite::RET_OK) { + MS_LOG(ERROR) << "Init modelBuilder failed."; + return lite::RET_ERROR; + } + // Build Model + int build_ret = Build(hiai_model_buffer_, hiai_model_size_); + if (build_ret != lite::RET_OK) { + MS_LOG(ERROR) << "Build OMModelBuffer failed."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "HIAIModel Kernel build OM model buffer success."; + return lite::RET_OK; +} + +int HIAIModelKernel::Build(uint8_t *model_data, size_t model_data_length) { + MS_LOG(INFO) << "HIAIModelKernel Build Function start."; + MS_CHECK_TRUE_RET(model_data_length != 0, kLiteError); + if (model_data == nullptr) { + MS_LOG(ERROR) << "Current model_data is invalid, please check model file."; + return lite::RET_ERROR; + } + void *hiai_modelData = model_data; + if (frequency_type_ == -1 || device_type_ == -1) { + MS_LOG(ERROR) << "Create model description failed. Current frequency_type_ is :" << frequency_type_ + << ", device_type_:" << device_type_ << "."; + return lite::RET_ERROR; + } + std::vector> model_descs; + std::unordered_map, hiai::MemBuffer *> builder_buffer_map; + MS_LOG(INFO) << "Create model description: version [" << model_manager_client_->GetVersion() + << "], frequency_type_ is " << frequency_type_ << ", device_type_ is " << device_type_ << "."; + std::shared_ptr model_desc = + std::make_shared(model_name_, frequency_type_, 0, 1, device_type_); + model_descs.push_back(model_desc); + auto model_buffer = model_builder->InputMemBufferCreate(hiai_modelData, model_data_length); + if (model_buffer == nullptr) { + MS_LOG(ERROR) << "Hiai Model Builder input memory buffer create failed, model data size:" << model_data_length; + return lite::RET_ERROR; + } + builder_buffer_map.insert({model_builder, model_buffer}); + model_desc->SetModelBuffer(model_buffer->GetMemBufferData(), model_buffer->GetMemBufferSize()); + MS_LOG(INFO) << "Hiai Model Builder set model buffer success."; + + if (!model_descs.empty()) { + auto load_ret = model_manager_client_->Load(model_descs); + if (load_ret != hiai::AI_SUCCESS) { + for (auto it : builder_buffer_map) { + it.first->MemBufferDestroy(it.second); + } + builder_buffer_map.clear(); + MS_LOG(ERROR) << "Hiai Client load model failed and clear Hiai model buffer."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "Hiai Client load model success."; + model_descs.clear(); + } + // Init Hiai IO tensor + if (InitHiaiIOTensors() != lite::RET_OK) { + MS_LOG(ERROR) << "Hiai kernel InitHiaiIOTensors failed."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "Hiai NNRT kernel init Hiai IO tensor and load model success."; + return lite::RET_OK; +} + +int HIAIModelKernel::InitHiaiIOTensors() { + std::vector input_dimension; + std::vector output_dimension; + if (model_manager_client_ == nullptr) { + MS_LOG(ERROR) << "Hiai Client is nullptr."; + return lite::RET_ERROR; + } + auto get_io_dim_ret = model_manager_client_->GetModelIOTensorDim(model_name_, input_dimension, output_dimension); + if (get_io_dim_ret != hiai::AI_SUCCESS) { + MS_LOG(ERROR) << "Get hiai input and output tensor dims failed." << get_io_dim_ret; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "Input NCHW :" << input_dimension[0].GetNumber() << " " << input_dimension[0].GetChannel() << " " + << input_dimension[0].GetHeight() << " " << input_dimension[0].GetWidth(); + MS_LOG(DEBUG) << "Output NCHW :" << output_dimension[0].GetNumber() << " " << output_dimension[0].GetChannel() << " " + << output_dimension[0].GetHeight() << " " << output_dimension[0].GetWidth(); + auto in_tensor_ret = UpdateInputTensorVec(input_dimension); + if (in_tensor_ret != lite::RET_OK) { + MS_LOG(ERROR) << "Update input tensor vector failed. " << in_tensor_ret; + return lite::RET_ERROR; + } + auto out_tensor_ret = UpdateOutputTensorVec(output_dimension); + if (out_tensor_ret != lite::RET_OK) { + MS_LOG(ERROR) << "Update output tensor vector failed. " << out_tensor_ret; + return lite::RET_ERROR; + } + return lite::RET_OK; +} + +int HIAIModelKernel::UpdateInputTensorVec(const std::vector &input_dimension) { + if (input_dimension.empty()) { + MS_LOG(ERROR) << "Hiai input tensor dimension is empty."; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "Hiai input_dimension size:" << input_dimension.size(); + for (const auto &inDim : input_dimension) { + std::shared_ptr input = std::make_shared(); + if (input->Init(&inDim) != hiai::AI_SUCCESS) { + MS_LOG(ERROR) << "Input AiTensor init failed."; + return lite::RET_ERROR; + } + hiai_inputs_tensors_.push_back(input); + } + if (hiai_inputs_tensors_.empty()) { + MS_LOG(ERROR) << "Hiai input tensor is empty."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "After UpdateInputTensorVec hiai_inputs_tensors_ size:" << hiai_inputs_tensors_.size(); + return lite::RET_OK; +} + +int HIAIModelKernel::UpdateOutputTensorVec(const std::vector &output_dimension) { + if (output_dimension.empty()) { + MS_LOG(ERROR) << "Hiai output tensor dimension is empty."; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "Hiai output_dimension size:" << output_dimension.size(); + for (const auto &outDim : output_dimension) { + std::shared_ptr output = std::make_shared(); + int ret = output->Init(&outDim); + if (ret != hiai::AI_SUCCESS) { + return lite::RET_ERROR; + } + hiai_outputs_tensors_.push_back(output); + } + if (hiai_outputs_tensors_.empty()) { + MS_LOG(ERROR) << "Hiai output tensor is empty."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "After UpdateOutputTensorVec hiai_outputs_tensors_ size:" << hiai_outputs_tensors_.size(); + return lite::RET_OK; +} + +int HIAIModelKernel::Execute() { + // Get MS INPUT Tensors + MS_LOG(INFO) << "Before HIAI Kernel execute, MSTensor need to be converted to HiaiTensor. Inputs_ size: " + << inputs_.size() << ", outputs_ size: " << outputs_.size(); + for (auto &tensor : inputs_) { + MS_LOG(DEBUG) << "Input Tensor:" << tensor.Name() << " shape:" << tensor.Shape() << " size:" << tensor.DataSize(); + } + for (auto &tensor : outputs_) { + MS_LOG(DEBUG) << "Output Tensor:" << tensor.Name() << " shape:" << tensor.Shape() << " size:" << tensor.DataSize(); + } + auto ms_hiai_ret = ConvertMSTensorToHiaiTensor(); + if (ms_hiai_ret != lite::RET_OK) { + MS_LOG(ERROR) << "ConvertMSTensorToHiaiTensor failed."; + return lite::RET_ERROR; + } + auto predict_ret = Predict(); + if (predict_ret != hiai::AI_SUCCESS) { + MS_LOG(ERROR) << "HIAIModelKernel Predict failed."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "HIAIModelKernel predict model success."; + auto hiai_ms_ret = ConvertHiaiTensorToMSTensor(); + if (hiai_ms_ret != lite::RET_OK) { + MS_LOG(ERROR) << "ConvertHiaiTensorToMSTensor failed."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "HIAI Kernel predict done, and convert HiaiTensor to MSTensor success."; + return lite::RET_OK; +} + +int HIAIModelKernel::Predict() { + hiai::AiContext context; + std::string key = "model_name"; + std::string value = model_name_; + context.AddPara(key, value); + int32_t iStamp; + if (model_manager_client_ == nullptr) { + MS_LOG(ERROR) << "Hiai client is nullptr."; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "hiai input tensor size:" << hiai_inputs_tensors_.size() + << " output tensor num:" << hiai_outputs_tensors_.size() + << " output tensor buffer:" << hiai_outputs_tensors_[0]->GetBuffer() + << " datasize:" << hiai_outputs_tensors_[0]->GetSize(); + int ret = model_manager_client_->Process(context, hiai_inputs_tensors_, hiai_outputs_tensors_, 3000, iStamp); + if (ret != lite::RET_OK) { + MS_LOG(ERROR) << "HIAIModelKernel Predict failed by Hiai client using Process function."; + return lite::RET_ERROR; + } + MS_LOG(INFO) << "HIAIModelKernel Predict model success, ret:" << ret << " stamp:" << iStamp; + return lite::RET_OK; +} + +int HIAIModelKernel::ConvertMSTensorToHiaiTensor() { + MS_LOG(INFO) << "ConvertMSTensorToHiaiTensor ms_input tensor num:" << inputs_.size() + << " hiai_input tensor num:" << hiai_inputs_tensors_.size(); + if (hiai_inputs_tensors_.size() != inputs_.size()) { + MS_LOG(ERROR) << "ms_input and hiai_input have different size. ms_input tensor num:" << inputs_.size() + << " hiai_input tensor num:" << hiai_outputs_tensors_.size(); + return lite::RET_ERROR; + } + for (size_t i = 0; i < hiai_inputs_tensors_.size(); i++) { + if (hiai_inputs_tensors_.at(i)->GetSize() != inputs_.at(i).DataSize()) { + MS_LOG(ERROR) << "ms_input and hiai_input have different dataSize. ms_input tensor dataSize " + << inputs_.at(i).DataSize() << " hiai_input tensor num:" << hiai_inputs_tensors_.at(i)->GetSize(); + return lite::RET_ERROR; + } + auto src_buffer = inputs_.at(i).MutableData(); + if (src_buffer == nullptr) { + MS_LOG(ERROR) << "For " << model_name_ << ", the ms_input at [" << i << "], tensor name:" << inputs_.at(i).Name() + << " buffer is null."; + return lite::RET_ERROR; + } + auto dest_buffer = hiai_inputs_tensors_.at(i)->GetBuffer(); + if (dest_buffer == nullptr) { + MS_LOG(ERROR) << "For " << model_name_ << ", the hiai_input at [" << i << "], buffer is null."; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "at [" << i << "] hiai_input data size:" << hiai_inputs_tensors_.at(i)->GetSize() + << ", buffer:" << dest_buffer << "\n ms_input data size:" << inputs_.at(i).DataSize() + << ", buffer:" << src_buffer; + std::memcpy(dest_buffer, src_buffer, inputs_.at(i).DataSize()); + } + MS_LOG(INFO) << "ConvertMSTensorToHiaiTensor success."; + return lite::RET_OK; +} + +int HIAIModelKernel::ConvertHiaiTensorToMSTensor() { + MS_LOG(INFO) << "ConvertHiaiTensorToMSTensor ms_output tensor num:" << outputs_.size() + << " hiai_output tensor num:" << hiai_outputs_tensors_.size(); + if (hiai_outputs_tensors_.size() != outputs_.size()) { + MS_LOG(ERROR) << "ms_output and hiai_output have different size. ms_output tensor num:" << outputs_.size() + << " hiai_output tensor num:" << hiai_outputs_tensors_.size(); + return lite::RET_ERROR; + } + for (size_t i = 0; i < hiai_outputs_tensors_.size(); i++) { + if (hiai_outputs_tensors_.at(i)->GetSize() != outputs_.at(i).DataSize()) { + MS_LOG(ERROR) << "ms_output and hiai_output have different dataSize. ms_output tensor dataSize " + << outputs_.at(i).DataSize() + << " hiai_output tensor num:" << hiai_outputs_tensors_.at(i)->GetSize(); + return lite::RET_ERROR; + } + auto src_buffer = hiai_outputs_tensors_.at(i)->GetBuffer(); + if (src_buffer == nullptr) { + MS_LOG(ERROR) << "For " << model_name_ << ", the hiai_output at [" << i << "], buffer is null."; + return lite::RET_ERROR; + } + auto dest_buffer = outputs_.at(i).MutableData(); + if (dest_buffer == nullptr) { + MS_LOG(ERROR) << "For " << model_name_ << ", the ms_output at [" << i + << "], tensor name:" << outputs_.at(i).Name() << " buffer is null."; + return lite::RET_ERROR; + } + MS_LOG(DEBUG) << "at [" << i << "] hiai_output data size:" << hiai_outputs_tensors_.at(i)->GetSize() + << ", buffer:" << src_buffer << " ms_output data size:" << outputs_.at(i).DataSize() + << ", buffer:" << dest_buffer; + std::memcpy(dest_buffer, src_buffer, hiai_outputs_tensors_.at(i)->GetSize()); + } + MS_LOG(INFO) << "ConvertHiaiTensorToMSTensor success."; + return lite::RET_OK; +} +} // namespace mindspore diff --git a/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.h b/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.h new file mode 100644 index 0000000000000000000000000000000000000000..0f9bc0ecaf49f897791e3b56805119e3315a4787 --- /dev/null +++ b/mindspore-lite/src/litert/delegate/hiai/hiai_model_kernel.h @@ -0,0 +1,77 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef LITE_HIAI_MODEL_KERNEL_H +#define LITE_HIAI_MODEL_KERNEL_H +#include +#include +#include +#include +#include "include/api/kernel.h" +#include "src/common/log_adapter.h" +#include "src/litert/inner_context.h" +#include "include/errorcode.h" +#include "include/HiAiModelManagerService.h" + +namespace mindspore { +class HIAIModelKernel : public kernel::Kernel { + /** + * We decide to make the whole model into one kernel. + * */ + public: + HIAIModelKernel(const std::vector &inputs, const std::vector &outputs, uint8_t *hiai_model_buffer, + size_t hiai_model_size, int32_t frequency_type, int32_t device_type) + : kernel::Kernel(inputs, outputs, nullptr, nullptr), + hiai_model_buffer_(hiai_model_buffer), + hiai_model_size_(hiai_model_size), + frequency_type_(frequency_type), + device_type_(device_type) {} + int Prepare() override; + int ReSize() override { return kSuccess; } + int Execute() override; + ~HIAIModelKernel() { + model_manager_client_ = nullptr; + model_builder = nullptr; + for (auto t : hiai_inputs_tensors_) { + t.reset(); + } + hiai_inputs_tensors_.clear(); + for (auto t : hiai_inputs_tensors_) { + t.reset(); + } + hiai_inputs_tensors_.clear(); + } + + private: + int Build(uint8_t *modelData, size_t modelDataLength); + int InitHiaiIOTensors(); + int UpdateInputTensorVec(const std::vector &input_dimension); + int UpdateOutputTensorVec(const std::vector &output_dimension); + int Predict(); + int ConvertMSTensorToHiaiTensor(); + int ConvertHiaiTensorToMSTensor(); + std::shared_ptr model_manager_client_ = nullptr; + std::shared_ptr model_builder = nullptr; + std::string model_name_ = "Third_Party_Model"; + uint8_t *hiai_model_buffer_; + size_t hiai_model_size_; + int32_t frequency_type_ = -1; + int32_t device_type_ = -1; + std::vector> hiai_inputs_tensors_; + std::vector> hiai_outputs_tensors_; +}; +} // namespace mindspore + +#endif // LITE_HIAI_MODEL_KERNEL_H diff --git a/mindspore-lite/src/litert/infer_manager.cc b/mindspore-lite/src/litert/infer_manager.cc index d8a240b4171ba779c11ca7581ba64e0fd7d21998..8aaa983fe273befc7dc44e8cb088c114bbd646f4 100644 --- a/mindspore-lite/src/litert/infer_manager.cc +++ b/mindspore-lite/src/litert/infer_manager.cc @@ -189,6 +189,10 @@ int KernelInferShape(const std::vector &inputs, const std::vecto MS_LOG(ERROR) << "No input!"; return RET_ERROR; } + if (parameter->type_ == static_cast(PrimType_Inner_ThirdPartyModel)) { + MS_LOG(INFO) << "No need infer shape for PrimType_Inner_ThirdPartyModel."; + return RET_OK; + } std::vector in_tensors; std::vector out_tensors; int ret = GenerateInTensorC(inputs, &in_tensors, allocator); diff --git a/mindspore-lite/src/litert/inner_context.cc b/mindspore-lite/src/litert/inner_context.cc index 91fbbd18e84f0570189d94ae132194a57dc255f9..542f06a9bdb361f067e987825aaab48d716163c5 100644 --- a/mindspore-lite/src/litert/inner_context.cc +++ b/mindspore-lite/src/litert/inner_context.cc @@ -123,7 +123,9 @@ int InnerContext::Init() { } #endif } - + if (IsDeviceTypeEnabled(DT_HIAI)) { + MS_LOG(INFO) << "HIAI enabled."; + } if (CreateThreadPool(false)) { MS_LOG(ERROR) << "CreateThreadPool failed."; return RET_ERROR; diff --git a/mindspore-lite/src/litert/inner_context.h b/mindspore-lite/src/litert/inner_context.h index 88281eb1f29158569ff253375cc6fba1fcdaa194..0ced2138158ec823bf14d540703c2563b7af6a48 100644 --- a/mindspore-lite/src/litert/inner_context.h +++ b/mindspore-lite/src/litert/inner_context.h @@ -71,12 +71,21 @@ typedef struct CustomDeviceInfo { std::shared_ptr user_defined_device_info_; } CustomDeviceInfo; +typedef struct HIAIDeviceInfo { + size_t device_id_ = 0; + int priority_ = 0; + int performance_mode_ = 0; + bool enable_fp16_ = false; + int frequency_ = 3; /**< npu frequency inference, low 1, medium 2, high 3, extreme 4, other values will be set to 3 */ +} HIAIDeviceInfo; + struct DeviceInfo { CpuDeviceInfo cpu_device_info_; GpuDeviceInfo gpu_device_info_; NpuDeviceInfo npu_device_info_; AscendDeviceInfo ascend_device_info_; CustomDeviceInfo custom_device_info_; + HIAIDeviceInfo hiai_device_info_; }; struct DeviceContext { diff --git a/mindspore-lite/src/litert/kernel/cpu/base/custom_base.cc b/mindspore-lite/src/litert/kernel/cpu/base/custom_base.cc new file mode 100644 index 0000000000000000000000000000000000000000..28287bda900a79ae28e5973fc4c60db3d23f0d82 --- /dev/null +++ b/mindspore-lite/src/litert/kernel/cpu/base/custom_base.cc @@ -0,0 +1,42 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "src/litert/kernel/cpu/base/custom_base.h" +#include +#include +#include +#include "src/litert/kernel_registry.h" +#include "nnacl/op_base.h" + +using mindspore::kernel::KERNEL_ARCH; +using mindspore::lite::KernelRegistrar; +using mindspore::lite::RET_ERROR; +using mindspore::lite::RET_OK; +using mindspore::schema::PrimitiveType_Custom; + +namespace mindspore::kernel { +int CustomBaseCPUKernel::Prepare() { return RET_OK; } + +int CustomBaseCPUKernel::ReSize() { return RET_OK; } + +int CustomBaseCPUKernel::Run() { return RET_OK; } + +REG_KERNEL(kCPU, kNumberTypeInt32, PrimType_Inner_ThirdPartyModel, LiteKernelCreator) +REG_KERNEL(kCPU, kNumberTypeFloat32, PrimType_Inner_ThirdPartyModel, LiteKernelCreator) +REG_KERNEL(kCPU, kNumberTypeInt8, PrimType_Inner_ThirdPartyModel, LiteKernelCreator) +REG_KERNEL(kCPU, kNumberTypeUInt8, PrimType_Inner_ThirdPartyModel, LiteKernelCreator) +REG_KERNEL(kCPU, kNumberTypeBool, PrimType_Inner_ThirdPartyModel, LiteKernelCreator) +} // namespace mindspore::kernel diff --git a/mindspore-lite/src/litert/kernel/cpu/base/custom_base.h b/mindspore-lite/src/litert/kernel/cpu/base/custom_base.h new file mode 100644 index 0000000000000000000000000000000000000000..53eb3f7e7f17c7f28c6359dea85b3c0e99c6416b --- /dev/null +++ b/mindspore-lite/src/litert/kernel/cpu/base/custom_base.h @@ -0,0 +1,43 @@ +/** + * Copyright 2025 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MINDSPORE_LITE_SRC_LITERT_KERNEL_CPU_BASE_CUSTOM_BASE_H_ +#define MINDSPORE_LITE_SRC_LITERT_KERNEL_CPU_BASE_CUSTOM_BASE_H_ + +#include +#include "src/litert/lite_kernel.h" +#include "nnacl/custom_parameter.h" + +namespace mindspore::kernel { +class CustomBaseCPUKernel : public LiteKernel { + public: + CustomBaseCPUKernel(OpParameter *parameter, const std::vector &inputs, + const std::vector &outputs, const lite::InnerContext *ctx) + : LiteKernel(parameter, inputs, outputs, ctx) { + custom_param_ = reinterpret_cast(op_parameter_); + } + ~CustomBaseCPUKernel() override = default; + + int Prepare() override; + int ReSize() override; + int Run() override; + + private: + CustomParameter *custom_param_ = nullptr; +}; +} // namespace mindspore::kernel + +#endif // MINDSPORE_LITE_SRC_LITERT_KERNEL_CPU_BASE_CUSTOM_BASE_H_ diff --git a/mindspore-lite/src/litert/kernel_registry.cc b/mindspore-lite/src/litert/kernel_registry.cc index f69086e6fb8b7fb180d6e23ce0b8405d3318d799..d0e414c426699b0d157b88c1f8086245a1fd4b86 100644 --- a/mindspore-lite/src/litert/kernel_registry.cc +++ b/mindspore-lite/src/litert/kernel_registry.cc @@ -178,6 +178,7 @@ int KernelRegistry::GetCustomKernel(const std::vector &in_tensors, con registry::KernelDesc desc{static_cast(key.data_type), key.type, key.kernel_arch, key.provider}; auto creator = registry::RegisterKernel::GetCreator(static_cast(primitive), &desc); if (creator == nullptr) { + MS_LOG(INFO) << "Not support to get Creator."; return RET_NOT_SUPPORT; } @@ -202,6 +203,7 @@ int KernelRegistry::GetCustomKernel(const std::vector &in_tensors, con } } #endif + MS_LOG(ERROR) << "Common base kernel registry failed."; return RET_ERROR; } @@ -254,6 +256,7 @@ int KernelRegistry::GetKernelExec(const std::vector &in_tensors, const if (ret == RET_OK) { (*kernel)->set_context(ctx); } + MS_LOG(INFO) << "Get kernel " << (ret == RET_OK ? "succeed." : "failed."); return ret; } #endif @@ -268,10 +271,12 @@ int KernelRegistry::GetKernelExec(const std::vector &in_tensors, const kernel_exec->set_desc(modify_key); kernel_exec->set_context(ctx); *kernel = kernel_exec; + MS_LOG(INFO) << "Get Lite Kernel succeed for type:" << PrimitiveCurVersionTypeName(key.type) + << " by type index:" << key.type << "."; return RET_OK; } } - MS_LOG(WARNING) << "common cpu kernel registry failed"; + MS_LOG(ERROR) << "common cpu kernel registry for lite_kernel failed."; return RET_ERROR; } } // namespace mindspore::lite diff --git a/mindspore-lite/src/litert/lite_session.cc b/mindspore-lite/src/litert/lite_session.cc index f736d67193b6c1a900c41810a3aee65e2a2b5c4b..5d406a1713224c67bc603a0c74f80649ee72316b 100644 --- a/mindspore-lite/src/litert/lite_session.cc +++ b/mindspore-lite/src/litert/lite_session.cc @@ -11,7 +11,8 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License.us + * du */ #include "src/litert/lite_session.h" @@ -46,6 +47,7 @@ #endif #ifdef SUPPORT_NPU #include "src/litert/delegate/npu/npu_delegate.h" +#include "src/litert/delegate/hiai/hiai_delegate.h" #endif #ifdef GPU_OPENCL #include "src/litert/kernel/opencl/opencl_subgraph.h" @@ -648,6 +650,7 @@ int LiteSession::CompileGraph(Model *model) { this->context_->set_infer_checker(InferCheckerAll); } is_running_.store(false); + MS_LOG(INFO) << "CompileGraph for current model success."; return RET_OK; } @@ -785,6 +788,7 @@ int LiteSession::PrepareKernels(const Model *model) { MS_LOG(ERROR) << "Prepare kernel " << kernel->name() << " failed: " << ret; return ret; } + MS_LOG(INFO) << "Set Allocator For Delegate Kernels success."; } if (!is_train_session_ && kernel->desc().arch != kernel::kDelegate && kernel->desc().arch != kernel::kGPU) { @@ -1063,6 +1067,25 @@ int LiteSession::CreateNPUDelegate() { return RET_OK; } +int LiteSession::CreateHIAIDelegate() { +#ifdef SUPPORT_NPU + auto iter = std::find_if(context_->device_list_.begin(), context_->device_list_.end(), + [](const DeviceContext &device) { return device.device_type_ == lite::DT_HIAI; }); + if (iter == context_->device_list_.end()) { + MS_LOG(ERROR) << "Found non device info"; + return RET_ERROR; + } + delegate_ = std::make_shared(iter->device_info_.hiai_device_info_); + if (delegate_ == nullptr) { + MS_LOG(ERROR) << "New HIAI delegate failed"; + return RET_ERROR; + } + delegate_device_type_ = DT_HIAI; + this->context_->delegate = delegate_; +#endif + return RET_OK; +} + int LiteSession::CreateNNAPIDelegate() { #ifdef SUPPORT_NNAPI bool enable_fp16 = @@ -1114,10 +1137,13 @@ int LiteSession::InitDelegate() { ret = CreateNPUDelegate(); } else if (context_->IsDeviceTypeEnabled(DT_GPU)) { ret = CreateTensorRTDelegate(); + } else if (context_->IsDeviceTypeEnabled(DT_HIAI)) { + ret = CreateHIAIDelegate(); } } if (ret != RET_OK) { + MS_LOG(INFO) << "Create Delegate failed. ret info: " << ret; return ret; } if (delegate_ != nullptr) { diff --git a/mindspore-lite/src/litert/lite_session.h b/mindspore-lite/src/litert/lite_session.h index 6b2aeea1ba2da09076965963ff10281c80e29dda..b7b8571004513ac5813ec206303aa462bad51c28 100644 --- a/mindspore-lite/src/litert/lite_session.h +++ b/mindspore-lite/src/litert/lite_session.h @@ -179,6 +179,7 @@ class MS_API LiteSession { int CreateNNAPIDelegate(); int CreateCoreMLDelegate(); int InitDelegate(); + int CreateHIAIDelegate(); int InitGPURuntime(); int InitSharedThreadPool(); int ReshapeWeightTensor(lite::Tensor *orig_tensor, lite::Tensor *new_tensor); diff --git a/mindspore-lite/src/litert/scheduler.cc b/mindspore-lite/src/litert/scheduler.cc index 440ec0d24eaa17f58291d5ef70bc866481db7c57..3757b55b2500c28bc20f1ebe973d00e84bdb2e49 100644 --- a/mindspore-lite/src/litert/scheduler.cc +++ b/mindspore-lite/src/litert/scheduler.cc @@ -58,7 +58,9 @@ #if defined(PARALLEL_INFERENCE) && defined(ENABLE_MINDRT) #include "thread/parallel_thread_pool_manager.h" #endif - +#ifdef SUPPORT_NPU +#include "src/litert/delegate/hiai/hiai_delegate.h" +#endif using AbstractBaseModel = mindspore::infer::AbstractBaseModel; namespace mindspore::lite { @@ -255,6 +257,13 @@ int Scheduler::CheckCpuValid(const std::vector *dst_kernel if (context_->IsDeviceTypeEnabled(DT_CPU)) { return RET_OK; } + // Custom model + if (dst_kernels->size() == 1 && (*dst_kernels)[0]->name() == "Custom" && + (*dst_kernels)[0]->desc().arch == kernel::KERNEL_ARCH::kDelegate) { + MS_LOG(INFO) << "kernel type is " << (*dst_kernels)[0]->name() << " and device type is " + << (*dst_kernels)[0]->desc().arch << "."; + return RET_OK; + } for (auto kernel : *dst_kernels) { if (kernel->desc().arch == kernel::KERNEL_ARCH::kCPU) { MS_LOG(ERROR) << "kernel: " << kernel->name() << " only support in CPU."; @@ -406,6 +415,13 @@ int Scheduler::Schedule(std::vector *dst_kernels) { return ret; } + for (auto kernel : *dst_kernels) { + MS_LOG(DEBUG) << "kernel: [" << kernel->name() << "] " + << "TypeId(" << kernel->desc().data_type << "); " + << "OpType(" << PrimitiveCurVersionTypeName(kernel->desc().type) << "); " + << "format(" << kernel->desc().format << "); " + << "arch(" << kernel->desc().arch << ")"; + } ret = CheckCpuValid(dst_kernels); if (ret != RET_OK) { MS_LOG(ERROR) << "kernels invalid in set devices."; @@ -501,6 +517,13 @@ int Scheduler::ReplaceDelegateKernels(std::vector *dst_ker MS_LOG(ERROR) << "New delegate model failed."; return RET_NULL_PTR; } + +#ifdef SUPPORT_NPU + if (context_->IsDeviceTypeEnabled(DT_HIAI)) { + auto delegate = static_cast(delegate_.get()); + delegate->ShallowCopyLiteGraph(this->src_model_->graph_); + } +#endif auto ret = delegate_->Build(model); if (ret != mindspore::kSuccess) { delete model; @@ -1001,8 +1024,8 @@ int Scheduler::FindCpuKernel(const std::vector &in_tensors, const std: MS_CHECK_TRUE_MSG(op_parameter != nullptr, RET_ERROR, "op parameter is nullptr."); auto op_type = op_parameter->type_; if (!KernelRegistry::GetInstance()->SupportKernel(desc)) { - MS_LOG(INFO) << "unsupported op_type: " << PrimitiveCurVersionTypeName(op_type) - << ", data_type: " << desc.data_type; + MS_LOG(INFO) << "Unsupported op_type index: " << op_type << ", op_type: " << PrimitiveCurVersionTypeName(op_type) + << ", data_type: " << desc.data_type << "."; return RET_NOT_SUPPORT; } kernel::KernelKey cpu_desc = desc; @@ -1041,8 +1064,8 @@ int Scheduler::FindCpuKernel(const std::vector &in_tensors, const std: ret = KernelRegistry::GetInstance()->GetKernelExec(in_tensors, out_tensors, context_, ms_context_, cpu_desc, op_parameter, kernel); if (ret == RET_OK) { - MS_LOG(DEBUG) << "Get TypeId(expect = " << kernel_data_type << ", real = " << cpu_desc.data_type - << ") op success: " << PrimitiveCurVersionTypeName(op_type); + MS_LOG(INFO) << "Get TypeId(expect = " << kernel_data_type << ", real = " << cpu_desc.data_type + << ") op success: " << PrimitiveCurVersionTypeName(op_type); if (is_train_session_) { ret = (*kernel)->Prepare(); RestoreTensorData(&restored_origin_tensors); @@ -1219,8 +1242,9 @@ kernel::KernelExec *Scheduler::FindBackendKernel(const std::vector &in if (status == RET_OK) { return kernel; } else { - MS_LOG(DEBUG) << "Get fp16 op failed, scheduler to cpu: " << PrimitiveCurVersionTypeName(desc.type) << " " - << node->name_; + MS_LOG(INFO) << "Get op failed, scheduler to CPU by node: " << node->name_ << ", prefer_data_type is " + << (prefer_data_type == kNumberTypeFloat16 ? "fp16" : "unknown") << ", desc.type index:" << desc.type + << ", desc.type:" << PrimitiveCurVersionTypeName(desc.type) << "."; if (status == RET_ERROR) { op_parameters_.erase(node->output_indices_.at(0)); auto ret = InferNodeShape(node); diff --git a/mindspore-lite/tools/benchmark/benchmark_base.cc b/mindspore-lite/tools/benchmark/benchmark_base.cc index b615736f2f30575f2699c838fb0f1ea8d0dad94a..156e814b38fdf5b3ce228f7ce88c4d500ef410ef 100644 --- a/mindspore-lite/tools/benchmark/benchmark_base.cc +++ b/mindspore-lite/tools/benchmark/benchmark_base.cc @@ -394,7 +394,8 @@ int BenchmarkBase::CheckThreadNumValid() { } int BenchmarkBase::CheckDeviceTypeValid() { - if (flags_->device_ != "CPU" && flags_->device_ != "GPU" && flags_->device_ != "NPU" && flags_->device_ != "Ascend") { + if (flags_->device_ != "CPU" && flags_->device_ != "GPU" && flags_->device_ != "NPU" && flags_->device_ != "Ascend" && + flags_->device_ != "HIAI") { MS_LOG(ERROR) << "Device type:" << flags_->device_ << " is not supported."; std::cerr << "Device type:" << flags_->device_ << " is not supported." << std::endl; return RET_ERROR; diff --git a/mindspore-lite/tools/benchmark/benchmark_c_api.cc b/mindspore-lite/tools/benchmark/benchmark_c_api.cc index d66c65f6feab84e983c5658565d123abf71969b9..dfdb7ab52cf42b7a8244d3d0a741a9d12d786f87 100644 --- a/mindspore-lite/tools/benchmark/benchmark_c_api.cc +++ b/mindspore-lite/tools/benchmark/benchmark_c_api.cc @@ -125,6 +125,15 @@ int BenchmarkCApi::InitContext() { MSDeviceInfoSetFrequency(npu_device_info, kFrequencyDefault); MSContextAddDeviceInfo(context_, npu_device_info); } + if (flags_->device_ == "HIAI") { + MSDeviceInfoHandle hiai_device_info = MSDeviceInfoCreate(kMSDeviceTypeHIAI); + if (hiai_device_info == nullptr) { + BENCHMARK_LOG_ERROR("MSDeviceInfoCreate for hiai_device_info failed."); + return RET_ERROR; + } + MSDeviceInfoSetFrequency(hiai_device_info, kFrequencyDefault); + MSContextAddDeviceInfo(context_, hiai_device_info); + } MSDeviceInfoHandle cpu_device_info = MSDeviceInfoCreate(kMSDeviceTypeCPU); MSDeviceInfoSetEnableFP16(cpu_device_info, flags_->enable_fp16_); MSContextAddDeviceInfo(context_, cpu_device_info); diff --git a/mindspore-lite/tools/benchmark/benchmark_unified_api.cc b/mindspore-lite/tools/benchmark/benchmark_unified_api.cc index 0d902d2df10ae18cbc683344ca8046a6974e0a9e..4b1fbc142141c4e914ff072a8f8d65cc4affb152 100644 --- a/mindspore-lite/tools/benchmark/benchmark_unified_api.cc +++ b/mindspore-lite/tools/benchmark/benchmark_unified_api.cc @@ -524,6 +524,17 @@ int BenchmarkUnifiedApi::InitMSContext(const std::shared_ptr InitMSContextForAscend(context, &device_list); } + if (flags_->device_ == "HIAI" || flags_->device_ == "Auto") { + std::shared_ptr hiai_device_info = std::make_shared(); + if (hiai_device_info == nullptr) { + MS_LOG(ERROR) << "Create hiai_device_info failed."; + return RET_ERROR; + } + hiai_device_info->SetEnableFP16(flags_->enable_fp16_); + hiai_device_info->SetFrequency(kFrequencyDefault); + device_list.push_back(hiai_device_info); + } + // CPU priority is behind GPU and NPU std::shared_ptr device_info = std::make_shared(); device_info->SetEnableFP16(flags_->enable_fp16_); @@ -1311,8 +1322,8 @@ int BenchmarkUnifiedApi::CompileGraph(mindspore::ModelType model_type, const std } memset(dec_key.key, 0, kEncMaxLen); if (ret != kSuccess) { - MS_LOG(ERROR) << "ms_model_.Build failed while running ", model_name.c_str(); - std::cout << "ms_model_.Build failed while running ", model_name.c_str(); + MS_LOG(ERROR) << "ms_model_.Build failed while running, model path:" << model_name.c_str(); + std::cout << "ms_model_.Build failed while running model path:" << model_name.c_str(); return RET_ERROR; } return RET_OK; diff --git a/mindspore-lite/tools/converter/adapter/acl/cxx_api_lite/cxx_api/context.cc b/mindspore-lite/tools/converter/adapter/acl/cxx_api_lite/cxx_api/context.cc index 7bdb4a39e3eb2d71b3c88573d21cc1dc0cd71046..2665a69b83b3ece9def589cc0c8a4f70622cbc1f 100644 --- a/mindspore-lite/tools/converter/adapter/acl/cxx_api_lite/cxx_api/context.cc +++ b/mindspore-lite/tools/converter/adapter/acl/cxx_api_lite/cxx_api/context.cc @@ -161,6 +161,15 @@ int KirinNPUDeviceInfo::GetFrequency() const { return GetAnyValueI32(data_->params, kModelOptionKirinNpuFrequency); } +void HIAIDeviceInfo::SetFrequency(int frequency) { + MS_EXCEPTION_IF_NULL(data_); + SetAnyValue(&data_->params[kModelOptionKirinNpuFrequency], frequency); +} +int HIAIDeviceInfo::GetFrequency() const { + MS_EXCEPTION_IF_NULL(data_); + return GetAnyValueI32(data_->params, kModelOptionKirinNpuFrequency); +} + void GPUDeviceInfo::SetDeviceID(uint32_t device_id) { MS_EXCEPTION_IF_NULL(data_); SetAnyValue(&data_->params[kModelOptionGPUDeviceID], device_id);