Compare commits

..

287 Commits
master ... r0.7

Author SHA1 Message Date
mindspore-ci-bot 2139c7ddc6 !8172 【轻量级 PR】:update RELEASE.md.
Merge pull request !8172 from shenwei41/N/A
2020-11-05 09:08:01 +08:00
mindspore-ci-bot c4e3fd70ee !8181 fix securec download links due to mistakes made by openeuler community
Merge pull request !8181 from yanghaoran/r0.7
2020-11-04 09:24:01 +08:00
yanghaoran 28372fbb96 update graphengine, fix securec download links 2020-11-03 19:41:48 +08:00
shenwei41 81c2068635 update RELEASE.md. 2020-11-03 17:41:17 +08:00
mindspore-ci-bot 4a8f92e4be !6799 mobilenetv2 update and debug
Merge pull request !6799 from yepei6/r0.7_align
2020-09-25 16:11:50 +08:00
Payne c53cd6bb22 align to docs and r1.0 2020-09-21 14:32:01 +08:00
mindspore-ci-bot 297e65e162 !6579 modify README_CN.md
Merge pull request !6579 from HW_KK/r0.7
2020-09-20 15:38:47 +08:00
wuweikang 1729a27bdb modify README_CN.md 2020-09-19 18:15:03 +08:00
mindspore-ci-bot 38da39b0be !6544 modify Dockerfile for devel
Merge pull request !6544 from HW_KK/r0.7
2020-09-19 14:39:00 +08:00
mindspore-ci-bot 56e22a5c82 !6535 【MD】r0.7 Branch: MD5 value update in the file - icu4c.cmake of branch r0.7
Merge pull request !6535 from magemomou/MD5_r0.7
2020-09-19 12:36:50 +08:00
wuweikang b551623c86 modify Dockerfile for devel 2020-09-19 11:41:26 +08:00
mayang 5529d41769 MD5 value update in the file icu4c.cmake of branch r0.7 2020-09-19 10:43:02 +08:00
mindspore-ci-bot ab997f9e37 !6299 mobilenetv2 debug for load ckpt
Merge pull request !6299 from yepei6/r0.7_mobilenet_debug
2020-09-18 11:28:16 +08:00
mindspore-ci-bot 5027130939 !6360 modify Dockerfile for GPU version
Merge pull request !6360 from HW_KK/r0.7
2020-09-16 17:52:28 +08:00
wuweikang 30450e2177 modify Dockerfile for GPU version 2020-09-16 17:26:59 +08:00
Payne 93c4d2929c load_ckpt debug 2020-09-16 16:16:18 +08:00
mindspore-ci-bot e39775edfd !6218 [MS][LITE]delete thread header for fix 0.7r java api bugs
Merge pull request !6218 from yeyunpeng2020/r0.7
2020-09-15 15:00:14 +08:00
mindspore-ci-bot e0953c47c3 !6213 [MS][LITE]fix the compilation failure
Merge pull request !6213 from gongdaguo/fix_compilation
2020-09-15 14:44:08 +08:00
mindspore-ci-bot 8e59d7449e !6187 make ref node's update edge using same address
Merge pull request !6187 from lianliguang/r0.7
2020-09-15 14:18:12 +08:00
yeyunpeng 41fd02baf3 delete thread header for fix 0.7r java api bugs 2020-09-15 10:50:55 +08:00
gongdaguo 02ba93492d fix the compilation failure and change the model download address
update mindspore/lite/test/models_mindspore.cfg.

update mindspore/lite/test/models_tflite_awaretraining.cfg.
2020-09-15 09:37:28 +08:00
WilliamLian 683e4aba74 make ref edage using same address 2020-09-14 16:28:46 +08:00
mindspore-ci-bot d373efcf99 !6129 mobilenetv2 add incremental_learn func
Merge pull request !6129 from yepei6/r0.7_mobilenetv2_add_incremental_func
2020-09-14 11:28:13 +08:00
Payne 4e2ccefe29 mobilenetv2 add incremental learning func 2020-09-13 22:25:39 +08:00
mindspore-ci-bot 6b4c5227ee !5942 adjust Dockerfile for nvcc support
Merge pull request !5942 from HW_KK/r0.7
2020-09-12 10:45:33 +08:00
mindspore-ci-bot 738ade501d !6014 update info with new platform
Merge pull request !6014 from guozhijian/update_info_with_platform_r0.7
2020-09-11 10:51:29 +08:00
mindspore-ci-bot 527d36597c !6010 fix bug of aicpu device ptr release failed
Merge pull request !6010 from caifubi/r0.7
2020-09-11 09:16:43 +08:00
jonyguo 7132be9ed2 update info with platform 2020-09-10 22:44:18 +08:00
caifubi 1c97d65f40 fix bug of aicpu device ptr release failed 2020-09-10 21:57:54 +08:00
mindspore-ci-bot 0ce4e3418c !5934 update supported platform info
Merge pull request !5934 from guozhijian/update_platform_info
2020-09-09 15:06:07 +08:00
wuweikang b83aa68071 adjust Dockerfile for nvcc support 2020-09-09 14:20:42 +08:00
jonyguo 86f5189323 update supported platform info 2020-09-09 09:58:09 +08:00
mindspore-ci-bot fc4bf19294 !5820 fix ub fusion
Merge pull request !5820 from jjfeing/r0.7_ub_fusion
2020-09-07 22:20:20 +08:00
jjfeing bd1261e5e6 adapt tensorengin modify, fix ub fusion 2020-09-07 20:45:57 +08:00
mindspore-ci-bot 5de9578abb !5794 rewrite fp16 to fp32
Merge pull request !5794 from cjh9368/static_check_r0.7
2020-09-05 13:56:50 +08:00
cjh9368 16f41b1619 rewrite fp16 to fp32 and fp32 to fp16 2020-09-05 10:44:54 +08:00
mindspore-ci-bot 7abe5a231f !5764 fix release note word err
Merge pull request !5764 from guozhijian/fix_release_note_word_err
2020-09-04 16:33:42 +08:00
jonyguo 27807a21ea fix: RELEASE.md spelling word error 2020-09-04 15:18:46 +08:00
mindspore-ci-bot 40bf2493fa !5490 modify the format info of tensorAdd
Merge pull request !5490 from limingqi107/r0.7
2020-09-03 11:07:12 +08:00
mindspore-ci-bot a585177825 !5575 update run for br: r0.7
Merge pull request !5575 from guozhijian/udpate_run_from_c75b100_to_c75b150
2020-09-02 20:54:47 +08:00
wuxuejian 06a6af7628 update aicpu proto and update module: graphengine
Support Dynamic Shape Aicpu Run Package
2020-09-02 19:27:21 +08:00
mindspore-ci-bot 9833a00e93 !5450 Fixbugfix for server shard range computation
Merge pull request !5450 from ZPaC/r0.7-fix-local-shard-error
2020-09-02 09:45:21 +08:00
mindspore-ci-bot 13fcfcdb78 !5592 [MS][Googlenet][README]googlenet readme have somewhere need to correct
Merge pull request !5592 from caojian05/ms_r0.7_googlenet_readme_update
2020-09-01 21:41:02 +08:00
CaoJian 96fad3b0a4 googlenet README update 2020-09-01 21:08:43 +08:00
mindspore-ci-bot a96646fc5a !5569 change readme file in yolov3_darknet53
Merge pull request !5569 from yangyongjie/r0.7
2020-09-01 14:53:16 +08:00
mindspore-ci-bot 26aba3b74c !5499 Support manual convert to quantative network of resnet
Merge pull request !5499 from chenfei_mindspore/r0.7
2020-09-01 14:31:50 +08:00
mindspore-ci-bot 5120720bac !5562 bert scripts enhancement
Merge pull request !5562 from yoonlee666/r0.7
2020-08-31 21:05:49 +08:00
mindspore-ci-bot 4382ce202c !5555 Modify read me of inceptionv3
Merge pull request !5555 from zhouyaqiang0/r0.7
2020-08-31 20:38:27 +08:00
mindspore-ci-bot 29fabd1324 !5561 Fix C++ coding standard problem
Merge pull request !5561 from yeyunpeng2020/r0.7
2020-08-31 17:18:27 +08:00
mindspore-ci-bot a43bd07c39 !5560 clean static check
Merge pull request !5560 from lyvette/r07
2020-08-31 16:51:36 +08:00
mindspore-ci-bot d332e4d2b7 !5581 clean static check
Merge pull request !5581 from cjh9368/static_check_r0.7
2020-08-31 16:51:12 +08:00
mindspore-ci-bot 403cb700b2 !5565 update RELEASE
Merge pull request !5565 from mengchunyang/r0.7
2020-08-31 16:42:53 +08:00
cristoval b2ffdf82c6 bugfix for server shard range computation 2020-08-31 16:40:40 +08:00
mindspore-ci-bot f5cba099d0 !5567 Delete some useless comments
Merge pull request !5567 from zhanyuan/r0.7
2020-08-31 16:36:09 +08:00
mindspore-ci-bot 9d10d934c7 !5557 [MS][LITE][Develop] fix bug of arm cpu int8 op: pooling memory leak
Merge pull request !5557 from yangruoqi713/r0.7
2020-08-31 16:31:11 +08:00
lyvette 62e7746e77 clean
modify log
2020-08-31 16:15:45 +08:00
chenfei 298393b66b add manual quantative network of resnet50 2020-08-31 16:02:33 +08:00
meng_chunyang 26bf044dde update RELEASE 2020-08-31 15:41:26 +08:00
cjh9368 fb973778e5 fix bug 2020-08-31 15:26:34 +08:00
yoonlee666 d472ee3921 bert script enhancement 2020-08-31 15:25:20 +08:00
yangyongjie e0a128142b fix performance of yolov3_darknet53 in readme file. 2020-08-31 15:09:21 +08:00
yeyunpeng 794aeb8e2c fix static check problem 2020-08-31 15:04:24 +08:00
zhanyuan 6051e3cfec Delete some useless comments 2020-08-31 14:58:56 +08:00
mindspore-ci-bot 03ff5f334a !5487 add schema file for BERT and TinyBERT
Merge pull request !5487 from wanghua/r0.7
2020-08-31 11:55:56 +08:00
yangruoqi713 dbe5cd9091 [MS][LITE][Develop] fix bug of arm cpu int8 op: pooling 2020-08-31 11:38:54 +08:00
zhouyaqiang 02fe2f9f1d modify read me of inception v3 2020-08-31 11:18:31 +08:00
mindspore-ci-bot 82dba19adf !5546 update README
Merge pull request !5546 from mengchunyang/r0.7
2020-08-31 11:01:20 +08:00
meng_chunyang e256877be9 update README 2020-08-31 10:09:03 +08:00
mindspore-ci-bot 433eaab225 !5544 remove unused benchmark option
Merge pull request !5544 from hangq/r0.7
2020-08-30 21:16:57 +08:00
hangq 18d3c686dc remove unused benchmark option 2020-08-30 20:42:26 +08:00
mindspore-ci-bot 7ebecd8d09 !5541 update model zoon image_classification reame ,delete some error links
Merge pull request !5541 from zhangbiao31/r0.7
2020-08-30 20:36:54 +08:00
mindspore-ci-bot 6b062f2454 !5510 Modify read me of deeplabv3 and inceptionv3
Merge pull request !5510 from zhouyaqiang0/r0.7
2020-08-30 20:18:52 +08:00
mindspore-ci-bot 6dd79e2b78 !5543 warpctc and maskrcnn readme recitification
Merge pull request !5543 from gengdongjie/r0.7
2020-08-30 20:16:40 +08:00
mindspore-ci-bot 9ac3e85045 !5515 vgg16 readme update
Merge pull request !5515 from caojian05/ms_r0.7_vgg_readme_update
2020-08-30 18:56:36 +08:00
gengdongjie f366faa275 warpctc and maskrcnn readme recitification 2020-08-30 16:24:33 +08:00
Jolin Zhang46 4b7c6208a3 update model zoon image_classification readme 2020-08-30 16:16:51 +08:00
mindspore-ci-bot e70d664119 !5493 Modify name of the package generated on x86.
Merge pull request !5493 from wangshaocong/r0.7_lite_pkg
2020-08-30 13:47:03 +08:00
mindspore-ci-bot 60f9577103 !5535 add image_classification in model zoo
Merge pull request !5535 from zhangbiao31/r0.7
2020-08-30 09:53:00 +08:00
mindspore-ci-bot 92a1c55941 !5537 Fix some tiny bugs for converter in windows enviroment and conv ops
Merge pull request !5537 from liuwenhao/r0.7
2020-08-30 07:19:54 +08:00
liuwenhao4 22e37013b9 Fix some tiny bugs for converter in windows enviroment and conv ops 2020-08-30 01:17:02 +08:00
mindspore-ci-bot fa97e24938 !5519 [MS][LITE][Develop]fix lite debug compile
Merge pull request !5519 from sunsuodong/fix_debug_compile_0.7
2020-08-30 00:12:15 +08:00
mindspore-ci-bot 7714669469 !5498 modify yolov3-resnet18 README
Merge pull request !5498 from chengxb7532/r0.7
2020-08-29 20:56:39 +08:00
mindspore-ci-bot 3f305b8afa !5511 modify README.md
Merge pull request !5511 from wukesong/wks_read0.7
2020-08-29 20:52:21 +08:00
mindspore-ci-bot 9fcf1e37b6 !5506 Add the REAMD.md in Wide&Deep model
Merge pull request !5506 from huangxinjing/wide-deep-multi-readme
2020-08-29 20:04:56 +08:00
zhangbiao31 7a30cd8784 !4 add image_classification
Merge pull request !4 from wangzhe/r0.7
2020-08-29 19:34:09 +08:00
wangzhe c223bb3949 add image_classification 2020-08-29 19:29:30 +08:00
mindspore-ci-bot 1621e02b68 !5523 update release info for br: r0.7
Merge pull request !5523 from guozhijian/update_release_notes_r0.7
2020-08-29 17:43:37 +08:00
wukesong 2fb88e8c46 modify readme 2020-08-29 17:27:10 +08:00
jonyguo 958ca51437 udpate release notes for r0.7 2020-08-29 17:22:10 +08:00
zhouyaqiang 61e8f10209 modify readme 2020-08-29 17:19:17 +08:00
sunsuodong 23e68ce790 fix_debug_compile 2020-08-29 17:03:41 +08:00
CaoJian 422a836cde vgg16 readme update 2020-08-29 16:50:45 +08:00
huangxinjing 330f18de5f Add README for multi-table of Wide&Deep 2020-08-29 16:16:16 +08:00
mindspore-ci-bot 0662256f23 !5470 bugfix on argparser for bool
Merge pull request !5470 from gengdongjie/r0.7
2020-08-29 16:10:55 +08:00
mindspore-ci-bot 3a6749ab78 !5464 update resnet50 readme
Merge pull request !5464 from VectorSL/r0.7
2020-08-29 15:54:46 +08:00
wsc b7a22e1398 Modify name of the package generated on x86. 2020-08-29 15:50:49 +08:00
chengxianbin 6c055b96d1 modiy yolov3-resnet18 net README.md 2020-08-29 15:34:27 +08:00
mindspore-ci-bot a9943a382c !5466 remove bool parameter parser in wide_and_deep
Merge pull request !5466 from yao_yf/remove_bool_paraser_in_wide_and_deep_r0.7
2020-08-29 14:42:51 +08:00
limingqi107 0775db0940 modify the format info of tensorAdd 2020-08-29 14:41:12 +08:00
wanghua 6674a88de4 add schema file for BERT and TinyBERT 2020-08-29 14:23:36 +08:00
mindspore-ci-bot 13dd07c34e !5459 modify transformer & fasterrcnn fix bool arguement parse bug
Merge pull request !5459 from yuchaojie/r0.7
2020-08-29 11:55:17 +08:00
mindspore-ci-bot 0178ecf785 !5440 lstm readme update
Merge pull request !5440 from caojian05/ms_r0.7_lstm_readme_update
2020-08-29 10:42:00 +08:00
gengdongjie b15a48a53b bugfix on argpasr for bool 2020-08-29 10:35:29 +08:00
wilfChen 50324d3dda lstm readme update 2020-08-29 10:19:02 +08:00
yao_yf 0c175b2cc0 no bool parameter parser in wide_and_deep 2020-08-29 09:51:41 +08:00
mindspore-ci-bot 947c396f09 !5392 Modify read me of deeplabv3 and inceptionv3
Merge pull request !5392 from zhouyaqiang0/r0.7
2020-08-29 09:44:22 +08:00
VectorSL 48d669636a update resnet readme 2020-08-29 09:42:13 +08:00
mindspore-ci-bot 7d38a1fb7e !5456 sync lite to r0.7
Merge pull request !5456 from 徐安越/r0.7
2020-08-29 09:12:59 +08:00
mindspore-ci-bot 565b542886 !5437 Modify for resnet readme
Merge pull request !5437 from qujianwei/r0.7
2020-08-29 09:11:23 +08:00
yuchaojie 32787a3453 modify transformer & fasterrcnn fix bool arguement parse bug 2020-08-29 09:02:55 +08:00
xuanyue 0ce8708dee sync lite to r0.7 2020-08-29 00:25:16 +08:00
mindspore-ci-bot b5393e6628 !5429 fix yolov3-resnet18&ssd bool argument parse bug and modify README
Merge pull request !5429 from chengxb7532/r0.7
2020-08-28 21:11:15 +08:00
chengxianbin 3da41e1091 modify yolov3-darknet53-quant README and fix bool arguement parse bug 2020-08-28 18:20:37 +08:00
qujianwei e0ac982589 modify for resnet readme 2020-08-28 17:28:48 +08:00
mindspore-ci-bot 52ed1ea725 !5404 update submodule akg to r0.7 branch
Merge pull request !5404 from looop5/akg_r0.7
2020-08-28 16:59:59 +08:00
mindspore-ci-bot 2ff8de674c !5421 Fix sparse slicer leak
Merge pull request !5421 from ZPaC/r0.7-fix-sparseslicer-leak
2020-08-28 16:09:32 +08:00
mindspore-ci-bot 13978a2c98 !5422 update release note for br:r0.7
Merge pull request !5422 from guozhijian/update_release_notes_r0.7
2020-08-28 16:02:19 +08:00
jonyguo b0f847072c update release notes for r0.7.0 2020-08-28 15:37:38 +08:00
ZPaC 1ac075919a Fix sparse-slicer leak. 2020-08-28 15:15:04 +08:00
mindspore-ci-bot 6c68e70cfe !5400 yolov3_darknet53 script suit for gpu
Merge pull request !5400 from hanhuifeng/yolov3_gpu_r0.7
2020-08-28 14:52:14 +08:00
mindspore-ci-bot 915d9a0d8f !5409 Fix bugs in c-api: rename, concat, take, sampler, duplicate column & Change docstring of OneHot
Merge pull request !5409 from luoyang/son_r0.7
2020-08-28 14:39:51 +08:00
mindspore-ci-bot 03b9cf3c12 !5380 fix formula grammar error in comment of SmoothL1Loss
Merge pull request !5380 from xiaotianci/fix_formula
2020-08-28 14:39:35 +08:00
mindspore-ci-bot 321e8d3e8f !5410 ReadMe file normalize
Merge pull request !5410 from chenfei_mindspore/r0.7
2020-08-28 14:34:22 +08:00
luoyang 4f98ecb433 Fix bugs in c-api: rename, concat, take, sampler, duplicate column &
Change docstring of OneHot
2020-08-28 14:22:56 +08:00
mindspore-ci-bot d24af4b181 !5396 fix googlenet performance
Merge pull request !5396 from panfengfeng/fix_googlenet_performance
2020-08-28 11:48:05 +08:00
chenfei 1eab0cd71b fix README 2020-08-28 11:26:59 +08:00
zhouyaqiang c317c4643b fix readme of inceptionv3 and deeplabv3 2020-08-28 11:26:09 +08:00
mindspore-ci-bot 0c7c3c3e8d !5393 change enable_data_sink value to true for transformer
Merge pull request !5393 from yuchaojie/r0.7
2020-08-28 11:13:09 +08:00
looop5 b0ce67fdd6 update submodule akg to r0.7 branch 2020-08-28 10:55:30 +08:00
mindspore-ci-bot 23fc178a5a !5363 Modify for resnet readme and fix bool type optional
Merge pull request !5363 from qujianwei/r0.7
2020-08-28 10:32:50 +08:00
hanhuifeng2020 1f0a760cdb yolov3_darknet53 suit for gpu 2020-08-28 10:31:21 +08:00
panfengfeng 3b8562aa3d fix googlenet performance 2020-08-28 09:50:12 +08:00
yuchaojie ed1340f1e5 set enable_data_sink value to true for transformer 2020-08-28 09:44:49 +08:00
mindspore-ci-bot 98528bbc16 !5370 fix laod input data error in pynative mode on gpu
Merge pull request !5370 from chujinjin/fix_load_input_data_error_in_pynative
2020-08-28 09:41:30 +08:00
mindspore-ci-bot 86cfa89c97 !5379 CutMixBatch and MixUpBatch fix for 2D one-hot labels for r0.7
Merge pull request !5379 from guozhijian/fix_cutmix_mixup_for_r0.7
2020-08-28 09:23:31 +08:00
mindspore-ci-bot beae07a9d1 !5364 gpu GoogleNet performance optimize
Merge pull request !5364 from VectorSL/slice-0.7
2020-08-28 09:14:06 +08:00
mindspore-ci-bot 4f9c6e77b7 !5273 Delete extra file.
Merge pull request !5273 from ZPaC/r0.7-delete-extra-file
2020-08-28 09:10:33 +08:00
ZPaC ac27f82607 Delete extra file 2020-08-27 22:41:58 +08:00
Xiao Tianci ed53f7f821 fix formula grammar error in comment of SmoothL1Loss 2020-08-27 22:06:54 +08:00
mahdi a5228c75c7 Fixed 2D one-hot label problems in CutMix and MixUp 2020-08-27 22:03:39 +08:00
mindspore-ci-bot 8533744d7c !5342 GPU FusedBatchNormEx add signature
Merge pull request !5342 from VectorSL/r0.7
2020-08-27 21:45:16 +08:00
mindspore-ci-bot f3444977f3 !5339 add type for get obj id & fix resource clear bug
Merge pull request !5339 from Simson/fix-r07
2020-08-27 21:39:14 +08:00
mindspore-ci-bot 581788f040 !5344 Delete __del__func in Profiler.
Merge pull request !5344 from yuximiao/r0.7
2020-08-27 21:11:35 +08:00
mindspore-ci-bot 3d511f80d5 !5357 gpu GoogleNet performance optimize
Merge pull request !5357 from limingqi107/r0.7
2020-08-27 21:05:28 +08:00
mindspore-ci-bot cb88a43a24 !5288 yolov3-resnet18 and ssd net README file normalize
Merge pull request !5288 from chengxb7532/r0.7
2020-08-27 20:55:07 +08:00
chujinjin 8948e55ae5 fix load input data error when input is a tuple 2020-08-27 20:43:34 +08:00
qujianwei 3adc06024c modify for resnet readme and fix bool type option 2020-08-27 20:39:52 +08:00
chengxianbin f3d87dd13e modiy ssd&yolov3-resnet18 net README.md 2020-08-27 20:13:19 +08:00
VectorSL c381430e71 slice support nhwc 2020-08-27 19:37:42 +08:00
mindspore-ci-bot e5780288e9 !5341 transfer tensor to tuple
Merge pull request !5341 from lijiaqi/new
2020-08-27 19:22:50 +08:00
mindspore-ci-bot d670bcb003 !5346 Fix bug of DepthwiseConv2d deleting arg 'group'
Merge pull request !5346 from chenfei_mindspore/r0.7
2020-08-27 19:21:47 +08:00
simson b00cdb2fe6 add type for get obj id & fix resource clear bug 2020-08-27 19:06:49 +08:00
limingqi107 3516447749 gpu GoogleNet performance optimize 2020-08-27 18:40:15 +08:00
李嘉琪 0e9815f63c modify 0.7 2020-08-27 17:54:34 +08:00
mindspore-ci-bot 2f189543b9 !5328 [bug]fix bugs when parameters updata r0.7
Merge pull request !5328 from vlne-v1/I1SP3I-return-value-not-the-exact-value-r0.7
2020-08-27 17:38:27 +08:00
mindspore-ci-bot c0a184ae8f !5291 serving RESTful: opt performance, short timeout
Merge pull request !5291 from 徐永飞/r0.7
2020-08-27 17:33:27 +08:00
mindspore-ci-bot ebfca60cdf !5176 fix data dump log
Merge pull request !5176 from jjfeing/r0.7_data_dump
2020-08-27 17:01:48 +08:00
mindspore-ci-bot f01613508f !5257 Fix no attribute'_graph_data' error in graphdata.py
Merge pull request !5257 from heleiwang/r0.7_fix_graphdata
2020-08-27 16:44:21 +08:00
chenfei c545422384 can't delete arg 'group' of DepthwiseConv2d 2020-08-27 16:26:47 +08:00
VectorSL db3f387f14 FusedBatchNormEx add signature 2020-08-27 16:12:22 +08:00
yuximiao 6005091a09 fix __del__ in Profiler 2020-08-27 16:05:59 +08:00
Wei Luning 051b019c96 fix bug in parameter init 2020-08-27 15:50:36 +08:00
mindspore-ci-bot ee6ab2980d !5318 Fix wrong error
Merge pull request !5318 from fanglei/r0.7
2020-08-27 15:00:04 +08:00
mindspore-ci-bot f9609e4ca7 !5252 add tinybert gpu readme
Merge pull request !5252 from hanhuifeng/tinybert_readme_r0.7
2020-08-27 14:43:35 +08:00
mindspore-ci-bot 3fdf9b72df !5306 [MS][LITE][Develop]fix arm32 compile
Merge pull request !5306 from sunsuodong/fix_arm32_0.7
2020-08-27 14:07:46 +08:00
mindspore-ci-bot d142a8d944 !5232 modify readme for deepfm in r0.7
Merge pull request !5232 from yangyongjie/r0.7
2020-08-27 12:59:58 +08:00
xuyongfei 78f88cde1b serving RESTful: opt for performance 2020-08-27 11:54:19 +08:00
sunsuodong 6385eafacf fix_arm32 2020-08-27 11:46:02 +08:00
leilei_snow 08c1d4bf44 fix index error 2020-08-27 03:25:05 +00:00
mindspore-ci-bot 5f3581aa69 !5303 Enlarge the threshold of resnet50 in pynative
Merge pull request !5303 from JoyLvliang/r0.7-enlarge-the-threshold-of-resnet50-in-pynative
2020-08-27 10:44:20 +08:00
mindspore-ci-bot e40fd0b4ed !5242 Fix remove internal output for unique device target
Merge pull request !5242 from YuJianfeng/r0.7
2020-08-27 10:43:33 +08:00
mindspore-ci-bot 620f5856ef !5293 Add test cases for uniform ops on GPU
Merge pull request !5293 from peixu_ren/r0.7temp
2020-08-27 10:42:56 +08:00
mindspore-ci-bot e3b0ae75ae !5286 [MD] minddata gpu add circular_memory to device_queue
Merge pull request !5286 from xiefangqi/xfq_add_circular_gpu_r0.7
2020-08-27 10:12:23 +08:00
mindspore-ci-bot a47ce883e9 !5245 fix assign memory error in pynative mode
Merge pull request !5245 from chujinjin/fix_runopassignoutputmemory_error
2020-08-27 09:48:40 +08:00
mindspore-ci-bot 3d2f761505 !5299 Add dtype check in uniform and normal distribution and fix docs
Merge pull request !5299 from XunDeng/branch_r0.7
2020-08-27 09:20:17 +08:00
mindspore-ci-bot 647053ed4d !5296 Fix some doc errors in pp distributions and bijectors
Merge pull request !5296 from peixu_ren/r0.7
2020-08-27 09:19:48 +08:00
mindspore-ci-bot 1c093f7db7 !5241 code refine for BN docs
Merge pull request !5241 from zyli2020/r0.7
2020-08-27 09:10:01 +08:00
mindspore-ci-bot ddf1b25f9b !5259 Fix some comments of api
Merge pull request !5259 from zhangxinfeng3/r0.7
2020-08-27 09:03:52 +08:00
lvliang 6f84bc57f4 enlarge-the-threshold-of-resnet50-in-pynative 2020-08-27 09:01:06 +08:00
Xun Deng 8ab9903125 add parameter type check in normal and uniform distribution 2020-08-26 17:46:10 -04:00
peixu_ren f8dde0c3c2 Fix some doc errors in pp distributions and bijectors 2020-08-26 15:03:46 -04:00
peixu_ren 85e67f193c Add test cases for uniform ops on GPU 2020-08-26 14:01:30 -04:00
mindspore-ci-bot be2a98e7c8 !5284 Fixes a bug in RandomSharpness cpp op for br:r0.7
Merge pull request !5284 from guozhijian/fix_sharpness_error
2020-08-27 01:46:03 +08:00
mindspore-ci-bot d506630185 !5261 update api for optional - br:r0.7
Merge pull request !5261 from guozhijian/fix_api_comment_0826_r0.7
2020-08-26 22:40:53 +08:00
xiefangqi 6d0ae1794f add circular_memory function to gpu 2020-08-26 21:49:21 +08:00
avakh 6300058cb6 fixing a bug in random sharpness 2020-08-26 21:36:52 +08:00
mindspore-ci-bot 71dd8a4a71 !5233 GPU add log in LoadInputData
Merge pull request !5233 from VectorSL/r0.7
2020-08-26 21:35:17 +08:00
mindspore-ci-bot 57e131a136 !5276 Fix the problem of resource clear v2 in r0.7
Merge pull request !5276 from Simson/fix-r07
2020-08-26 21:34:01 +08:00
mindspore-ci-bot 81d67f6828 !5266 Revert "Avoid copy when create Tensor from numpy array"
Merge pull request !5266 from hewei/r0.7_revert_no_copy_tensor
2020-08-26 21:16:16 +08:00
simson 7c406fb3a0 fix risk of memory leak 2020-08-26 19:55:25 +08:00
mindspore-ci-bot c904bc2f00 !5251 Combine sparse embedding gradient
Merge pull request !5251 from chengang/combine_grad_r0.7
2020-08-26 19:29:10 +08:00
mindspore-ci-bot adeeda2fe1 !5236 transfer tensor to tuple
Merge pull request !5236 from lijiaqi/transfer_tensor_to_tuple
2020-08-26 19:27:27 +08:00
yangyongjie fcc5f77a77 modify readme for deepfm 2020-08-26 19:25:29 +08:00
mindspore-ci-bot bed0f5d3c3 !5249 Put elimminate AllReduce const pass back
Merge pull request !5249 from BowenK/r0.7
2020-08-26 19:22:47 +08:00
He Wei eca64ab8e9 Revert "Avoid copy when create Tensor from numpy array"
This reverts commit a6690168a8.
2020-08-26 19:09:54 +08:00
mindspore-ci-bot 84989b0cbf !5218 SoftDvppDecodeRandomCropResizeJpeg do not support resize iimage to odd resolution
Merge pull request !5218 from qianlong21st/r0.7_softdvpp_crop
2020-08-26 18:08:27 +08:00
jonyguo f45e2c921f fix: update api comment for optional 2020-08-26 17:55:51 +08:00
zhangxinfeng3 758269d049 modify some comments of api 2020-08-26 17:37:25 +08:00
heleiwang 814fc1d03e fix graphdata error 2020-08-26 17:29:49 +08:00
mindspore-ci-bot b9dff22d6c !5104 fix multiple epoch data issue for gpu profiler
Merge pull request !5104 from 治愈系潇洒哥/r0.7
2020-08-26 17:24:02 +08:00
mindspore-ci-bot 54e615e904 !5207 fix bug for yolov3-resnet18 scripts
Merge pull request !5207 from chengxb7532/r0.7
2020-08-26 17:00:24 +08:00
yujianfeng 499d81e573 Fix remove internal output for unique device target 2020-08-26 16:55:06 +08:00
cristoval 817bfed1ec combine sparse embedding gradient 2020-08-26 16:43:07 +08:00
hanhuifeng2020 a533147f52 add tinybert gpu readme 2020-08-26 16:41:28 +08:00
BowenK fcc0e263f3 Revert "Revert "Eliminate AllReduce when the input is a constant""
This reverts commit 7a7e499475.
2020-08-26 16:38:02 +08:00
mindspore-ci-bot 46de719a12 !5209 Modify the name of parameters in uniform
Merge pull request !5209 from peixu_ren/r0.7temp
2020-08-26 16:29:07 +08:00
chujinjin 7b6dd0b84d fix runopassignoutputmemory error 2020-08-26 16:08:17 +08:00
lizhenyu 8438221259 code refine for BN docs 2020-08-26 16:04:04 +08:00
李嘉琪 2f5a454ef4 transfer_tensor_to_tuple 2020-08-26 15:57:17 +08:00
qianlong 6b6409d910 DecodeAndCropAndResizeJepg do not support odd size 2020-08-26 15:32:18 +08:00
VectorSL ed9c63469b GPU add log in loadinputdata when tensor input != graph input 2020-08-26 15:27:34 +08:00
mindspore-ci-bot 049acf6d58 !5173 GPU fix getinputformat error
Merge pull request !5173 from VectorSL/r0.7
2020-08-26 15:19:31 +08:00
mindspore-ci-bot 55d997ec11 !5052 update readme for docker gpu environment deployment
Merge pull request !5052 from HW_KK/r0.7
2020-08-26 14:45:30 +08:00
mindspore-ci-bot ee7d9bf4ac !5213 Quick fix scalar add flaws in MindSpore
Merge pull request !5213 from peixu_ren/r0.7
2020-08-26 14:10:40 +08:00
mindspore-ci-bot 6b706529c5 !5200 fix SE-Resnet50 infer to use 24 epoch and add SE-Resnet50 readme description
Merge pull request !5200 from qujianwei/r0.7
2020-08-26 12:33:38 +08:00
VectorSL 7884176df7 fix getinputformat error when input is not a realnode 2020-08-26 11:51:09 +08:00
mindspore-ci-bot bedfa8578b !5154 serving RESTful, disable http port reuse, update error msg output to user
Merge pull request !5154 from 徐永飞/r0.7
2020-08-26 11:44:02 +08:00
peixu_ren d522d7ba46 Quick fix scalar add flaws in MindSpore 2020-08-25 23:20:45 -04:00
peixu_ren e701fbfa2e Modify the name of parameters in uniform 2020-08-25 23:00:17 -04:00
mindspore-ci-bot 7090e16df8 !5134 stream parallel support ctrl stream
Merge pull request !5134 from gukecai/stream-r0.7
2020-08-26 10:59:42 +08:00
mindspore-ci-bot 382f9a8ebb !5195 Fix CheckTensor in pynative mode
Merge pull request !5195 from peixu_ren/r0.7
2020-08-26 10:49:48 +08:00
mindspore-ci-bot fd8ad73689 !5194 fix: padded dataset when no div and with repeat op for br:r0.7
Merge pull request !5194 from guozhijian/fix_padded_with_no_div_repeat_r0.7
2020-08-26 10:47:37 +08:00
mindspore-ci-bot 7bdb90a40b !5158 fix softdvpp coredump
Merge pull request !5158 from qianlong21st/r0.7_fix_softdvpp_core
2020-08-26 10:41:39 +08:00
mindspore-ci-bot 185b25c6de !5179 add create_dict_iterator parameter num_epochs api
Merge pull request !5179 from anzhengqi/add-num_epochs-api-r0.7
2020-08-26 10:24:08 +08:00
chengxianbin 115a85114f clear the warning of execute run_distribute_train.sh 2020-08-26 10:19:26 +08:00
mindspore-ci-bot 0bf7f1f39c !5152 change group conv dtype in gpu resnext50
Merge pull request !5152 from zhaoting/r0.7
2020-08-26 10:08:22 +08:00
qujianwei d2588f1935 fix SE-ResNet50 infer to 24-epoch and add ReadMe description 2020-08-26 09:30:31 +08:00
mindspore-ci-bot 6017521219 !5133 modify readme.md for yolov3_darknet53 in r0.7
Merge pull request !5133 from yangyongjie/r0.7
2020-08-26 09:27:25 +08:00
xuyongfei c0389eaea4 serving RESTful, disable http port reuse, update error msg output to user 2020-08-26 09:16:14 +08:00
Xun Deng 6bb61615fd fix checktensor in pynative mode 2020-08-25 21:10:50 -04:00
qianlong bc8aec007f fix softdvpp coredump 2020-08-26 09:07:35 +08:00
jonyguo d262c63214 fix: padded dataset with non div & repeat 2020-08-26 08:58:24 +08:00
mindspore-ci-bot 9e20e17590 !5191 Add note of limitation for prarmeters of uniform
Merge pull request !5191 from peixu_ren/r0.7temp
2020-08-26 08:51:56 +08:00
mindspore-ci-bot 07103b98a9 !5101 Add erf and erfc as generic functions for all the backend
Merge pull request !5101 from peixu_ren/r0.7
2020-08-26 08:36:24 +08:00
peixu_ren 13584ebc22 Add note of limitation for prarmeters of uniform 2020-08-25 16:01:32 -04:00
peixu_ren 5ce4bcf416 Add erf and erfc as generic functions for all the backend and fix notation in power_transform. 2020-08-25 10:12:29 -04:00
mindspore-ci-bot 92787df680 !5159 add cuda path checker
Merge pull request !5159 from zyli2020/r0.7
2020-08-25 21:46:13 +08:00
mindspore-ci-bot 8afbba7936 !5177 Revert "!5121 Fix the problem of resource clear in r0.7"
Merge pull request !5177 from Simson/fix-r07
2020-08-25 21:43:16 +08:00
anzhengqi 3c4feaa4f4 add num_epochs api 2020-08-25 21:15:35 +08:00
simson 556f79d185 Revert "!5121 Fix the problem of resource clear in r0.7"
This reverts commit a0a6463210, reversing
changes made to 0bcd75bd2b.
2020-08-25 21:03:27 +08:00
mindspore-ci-bot 1a42811748 !5144 Rectification of API comments of r0.7
Merge pull request !5144 from byweng/r0.7
2020-08-25 20:41:22 +08:00
mindspore-ci-bot cee889e426 !5126 Fix problem in RandomPosterize & CutMixBatch
Merge pull request !5126 from luoyang/son_r0.7
2020-08-25 20:33:05 +08:00
jjfeing 3af2059342 fix data dump log info 2020-08-25 20:32:44 +08:00
mindspore-ci-bot a0a6463210 !5121 Fix the problem of resource clear in r0.7
Merge pull request !5121 from Simson/push-to-r07
2020-08-25 18:48:27 +08:00
lizhenyu 1d8e5a27b7 add cuda path checker 2020-08-25 18:39:35 +08:00
mindspore-ci-bot 0bcd75bd2b !5119 Avoid copy when create Tensor from numpy array
Merge pull request !5119 from hewei/r0.7_avoid_copy_tensor_numpy
2020-08-25 17:51:18 +08:00
zhaoting 576c35d408 change group conv dtype in gpu resnext50 2020-08-25 17:38:10 +08:00
mindspore-ci-bot e05a5c8002 !5115 modify bert and tinybert scripts and README
Merge pull request !5115 from wanghua/r0.7
2020-08-25 17:18:07 +08:00
bingyaweng 5b941df087 rectification of API comments 2020-08-25 16:54:14 +08:00
mindspore-ci-bot b77c7d2729 !5099 modify wrong characters in r07
Merge pull request !5099 from caozhou/modify_r07
2020-08-25 16:22:23 +08:00
mindspore-ci-bot ac0b72e67f !5089 Fix MASS and FasterRcnn CI Problem.
Merge pull request !5089 from linqingke/r0.7
2020-08-25 16:14:58 +08:00
gukecai 4ace444f54 parallel ctrl 2020-08-25 16:12:34 +08:00
yangyongjie 32e7eb9148 modify readme for yolov3_darknet53 2020-08-25 16:04:50 +08:00
mindspore-ci-bot c481d45996 !5072 model_zoo README.md format change for googlenet
Merge pull request !5072 from caojian05/ms_r0.7_googlenet_readme_update
2020-08-25 16:00:20 +08:00
wanghua cb893dfca9 modify BERT and TinyBERT README 2020-08-25 15:58:37 +08:00
mindspore-ci-bot 6b55dc802d !5116 Modify readme of deeplabv3 and inceptionv3
Merge pull request !5116 from zhouyaqiang0/r0.7
2020-08-25 15:57:19 +08:00
zhouyaqiang 41de14bacd modify readme of deeplabv3 and inceptionv3 2020-08-25 15:49:36 +08:00
mindspore-ci-bot ee37dc52fa !5054 fix shape and data size
Merge pull request !5054 from hexia/shape_wrong_r0.7
2020-08-25 15:14:27 +08:00
luoyang a75ac9c445 Add type check for RandomPosterize & Add Float tensor support for CutMixBatch 2020-08-25 15:10:24 +08:00
askmiao 1804ea246d fix multiple epoch data issue 2020-08-25 15:08:42 +08:00
mindspore-ci-bot 56350e71f0 !5080 modify sgd and momentum and withgradcell comments
Merge pull request !5080 from lijiaqi/sgd
2020-08-25 14:59:31 +08:00
mindspore-ci-bot 761cd8393e !5107 raise RuntimeError when set different mode after Initializer created
Merge pull request !5107 from yihuaijie/r0.7
2020-08-25 14:51:59 +08:00
simson 90c004078e fix risk of memory leak 2020-08-25 14:48:31 +08:00
mindspore-ci-bot e9f2aae73d !5083 [bugfix]LSTM SyncDeviceToHost failed
Merge pull request !5083 from zyli2020/r0.7
2020-08-25 14:47:44 +08:00
He Wei a6690168a8 Avoid copy when create Tensor from numpy array 2020-08-25 14:38:34 +08:00
hexia 4eb1706307 shape_wrong_r0.7 2020-08-25 10:45:13 +08:00
Yi Huaijie 524cf0ed9a raise RuntimeError when set different mode after Initializer created 2020-08-25 10:14:52 +08:00
mindspore-ci-bot d8d7cebc8a !5090 Update fix custom exp/log ops cast logic to r0.7
Merge pull request !5090 from zichun_ye/r0.7_fix_custom_ops
2020-08-25 09:41:54 +08:00
linqingke 9f5a7939d4 fix fasterrcnn and mass bug. 2020-08-25 09:32:30 +08:00
caozhou 83557cd28d modify wrong characters in r07 2020-08-25 09:10:10 +08:00
Zichun Ye d29bd6862a modify custom_ops to pass pynative mode
update dtype for device

delete used funcs
2020-08-24 11:17:38 -04:00
mindspore-ci-bot 1b71d50953 !5068 resolve fronted layout
Merge pull request !5068 from caozhou/resolve_fronted_display_r07
2020-08-24 21:23:41 +08:00
lizhenyu 68b37ee1b3 [bugfix]LSTM SyncDeviceToHost failed 2020-08-24 21:22:53 +08:00
李嘉琪 0238ba4d14 modify comments7 2020-08-24 20:51:51 +08:00
mindspore-ci-bot 891228bcbe !5062 GPU opt insert transpose pass
Merge pull request !5062 from VectorSL/r0.7
2020-08-24 20:26:09 +08:00
CaoJian 1f9c3bb044 model_zoo README.md format change for googlenet 2020-08-24 19:24:49 +08:00
caozhou 8287445f95 resolve frontend layput 2020-08-24 18:53:47 +08:00
mindspore-ci-bot 10c6fb5612 !5023 Update lastest fix of bernoulii probs to r0.7
Merge pull request !5023 from zichun_ye/r0.7_bernoulli_fix
2020-08-24 17:37:09 +08:00
mindspore-ci-bot fae225460c !5034 Add readme and fix some comments of api
Merge pull request !5034 from zhangxinfeng3/r0.7
2020-08-24 17:36:40 +08:00
VectorSL 54bb6ba58c gpu optimize transpose 2020-08-24 17:34:04 +08:00
wuweikang cec6206bc4 update readme for docker gpu environment deployment 2020-08-24 16:56:27 +08:00
mindspore-ci-bot e69a91b6b5 !5018 maskrcnn adopt smoothl1loss change
Merge pull request !5018 from gengdongjie/master
2020-08-24 15:21:12 +08:00
zhangxinfeng3 2869e5ace4 update some comments of api 2020-08-24 14:32:53 +08:00
mindspore-ci-bot 09cf1c1a54 !5014 add libevent copyright r0.7
Merge pull request !5014 from hexia/from_r0.7
2020-08-24 14:12:20 +08:00
Zichun Ye 04b5b8c737 fix bernoulli prob formula; fix some other minor bugs
update threshold of softplus computation

support fp for bernoulli and geometric distribution
2020-08-23 23:30:32 -04:00
mindspore-ci-bot 8d0b52fb13 !5008 fix bug of EraseAssign
Merge pull request !5008 from wenchunjiang/adapte_to_resnet_second_optimize
2020-08-24 11:11:53 +08:00
hexia 2027f73eaf add libevent copyright 2020-08-24 10:54:20 +08:00
19581 changed files with 530128 additions and 1964594 deletions

View File

@ -124,6 +124,7 @@ RawStringFormats:
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true

View File

@ -1,8 +1,6 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1) If this is your first time, please read our contributor guidelines: https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md
2) If you want to contribute your code but don't know who will review and merge, please add label `mindspore-assistant` to the pull request, we will find and do it as soon as possible.
If this is your first time, please read our contributor guidelines: https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md
-->
**What type of PR is this?**

View File

@ -1,8 +1,6 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1) If this is your first time, please read our contributor guidelines: https://github.com/mindspore-ai/mindspore/blob/master/CONTRIBUTING.md
2) If you want to contribute your code but don't know who will review and merge, please add label `mindspore-assistant` to the pull request, we will find and do it as soon as possible.
If this is your first time, please read our contributor guidelines: https://github.com/mindspore-ai/mindspore/blob/master/CONTRIBUTING.md
-->
**What type of PR is this?**

12
.gitignore vendored
View File

@ -3,10 +3,6 @@ build/
mindspore/lib
output
*.ir
st_tests
kernel_meta/
somas_meta/
trace_code_graph_*
# mindspore lite java
mindspore/lite/java/java/.gradle
@ -96,11 +92,9 @@ test_temp_summary_event_file/
*.pkl
*.pb
.clangd
mindspore/python/mindspore/version.py
mindspore/python/mindspore/default_config.py
mindspore/python/mindspore/device_target.py
mindspore/python/mindspore/package_name.py
mindspore/python/mindspore/.commit_id
mindspore/version.py
mindspore/default_config.py
mindspore/.commit_id
# lite test file
mindspore/lite/test/do_test/

30
.gitmodules vendored
View File

@ -1,9 +1,33 @@
[submodule "third_party/flatbuffers"]
path = third_party/flatbuffers
url = https://github.com/google/flatbuffers.git
ignore = all
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/protobuf"]
path = third_party/protobuf
url = https://github.com/protocolbuffers/protobuf.git
ignore = all
[submodule "akg"]
path = akg
url = https://gitee.com/mindspore/akg.git
[submodule "graphengine"]
path = graphengine
url = https://gitee.com/mindspore/graphengine.git
[submodule "tests/models"]
path = tests/models
url = https://gitee.com/mindspore/models.git
[submodule "third_party/OpenCL-CLHPP"]
path = third_party/OpenCL-CLHPP
url = https://github.com/KhronosGroup/OpenCL-CLHPP.git
[submodule "third_party/OpenCL-Headers"]
path = third_party/OpenCL-Headers
url = https://github.com/KhronosGroup/OpenCL-Headers.git
[submodule "third_party/opencv"]
path = third_party/opencv
url = https://github.com/opencv/opencv.git
[submodule "third_party/eigen"]
path = third_party/eigen
url = https://gitlab.com/libeigen/eigen.git
[submodule "third_party/libjpeg-turbo"]
path = third_party/libjpeg-turbo
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
ignore = dirty

View File

@ -1,55 +0,0 @@
approvers:
- anyrenwei
- baochong
- c_34
- chujinjin
- ckey_dou
- cristoval
- ddwsky
- gaoxiong1
- ginfung
- guoqi1024
- hangangqiang
- heleiwang
- HilbertDavid
- hwhewei
- jjfeing
- john_tzanakakis
- jonyguo
- jpc_chenjianping
- kingxian
- liangchenghui
- lilongfei15
- limingqi107
- linqingke
- liucunwei
- mickf
- nsyca
- ouwenchang
- pandoublefeng
- robingrosman
- stsuteng
- tiancixiao
- tom__chen
- wangyue01
- wenkai_dist
- wilfchen
- wuxuejian
- xu-yfei
- yelihua
- yuchaojie
- zh_qh
- zhaizhiqiang
- zhang_xue_tong
- zhanghaibo5
- zhanyuan1
- zhoufeng54
- zlq2020
- zqstar
- z0020952
- chenshushu2020
reviewers:
- nicholas_yhr
- liubuyu
- chengxb7532
- lx0095

View File

@ -1,53 +0,0 @@
# MindSpore
"mindspore/mindspore/ccsrc/debug/anf_ir_utils.cc" "stlFindInsert"
"mindspore/mindspore/ccsrc/backend/graph_compiler/transform.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/backend/graph_compiler/transform.cc" "constVariable"
"mindspore/mindspore/ccsrc/utils/tensorprint_utils.cc" "invalidPointerCast"
"mindspore/mindspore/ccsrc/plugin/device/gpu/hal/device/mpi/mpi_initializer.cc" "syntaxError"
"mindspore/mindspore/core/abstract/prim_nn.cc" "zerodivcond"
"mindspore/mindspore/ccsrc/frontend/operator/ops_front_infer_function.cc" "zerodivcond"
"mindspore/mindspore/ccsrc/pipeline/jit/pipeline_split.cc" "zerodivcond"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/device/ascend_stream_assign.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/frontend/operator/ops_front_infer_function.cc" "uninitvar"
"mindspore/mindspore/ccsrc/pipeline/jit/action.cc" "constVariable"
"mindspore/mindspore/ccsrc/pipeline/jit/validator.cc" "constVariable"
"mindspore/mindspore/ccsrc/utils/tensorprint_utils.cc" "invalidPointerCast"
"mindspore/mindspore/ccsrc/plugin/device/ascend/optimizer/ir_fission/ir_fission/bn_grad_split.cc" "knownConditionTrueFalse"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_ftrl_cpu_kernel.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_adam_cpu_kernel.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_lazy_adam_cpu_kernel.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_apply_proximal_adagrad_cpu_kernel.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_generate_strategy.cc" "containerOutOfBounds"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/embedding_look_up_cpu_kernel.cc" "containerOutOfBounds"
"mindspore/mindspore/core/ops/strided_slice.cc" "zerodivcond"
"mindspore/mindspore/core/ops/avg_pool_3d.cc" "zerodivcond"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/hccl_adapter/hccl_adapter.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/cast_gpu_kernel.cc" "unknownMacro"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/device/ascend_memory_manager.cc" "nullPointerArithmeticRedundantCheck"
"mindspore/mindspore/ccsrc/pipeline/jit/static_analysis/auto_monad.cc" "containerOutOfBounds"
"mindspore/mindspore/core/load_mindir/anf_model_parser.cc" "stlIfStrFind"
"mindspore/mindspore/ccsrc/frontend/optimizer/ad/kpynative.cc" "containerOutOfBounds"
# MindData
"mindspore/mindspore/ccsrc/minddata/dataset/engine/dataset_iterator.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/minddata/dataset/core/tensor_shape.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/minddata/dataset/util/arena.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/minddata/dataset/api/python/pybind_register.cc" "syntaxError"
"mindspore/mindspore/ccsrc/minddata/dataset/engine/datasetops/rename_op.cc" "accessMoved"
"mindspore/mindspore/ccsrc/minddata/mindrecord/meta/shard_header.cc" "useStlAlgorithm"
"mindspore/mindspore/ccsrc/minddata/mindrecord/common/shard_pybind.cc" "syntaxError"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/resize_cubic_op.cc" "constParameter"
# Lite
"mindspore/mindspore/core/mindrt/src/thread/" "useStlAlgorithm"
"mindspore/mindspore/lite/test/" "syntaxError"
"mindspore/mindspore/lite/test/ut/tools/converter/registry/pass_registry_test.cc" "unknownMacro"
"mindspore/mindspore/lite/src/ops/unsqueeze.cc" "useStlAlgorithm"
"mindspore/mindspore/lite/tools/common/flag_parser.cc" "useStlAlgorithm"
"mindspore/mindspore/lite/tools/common/tensor_util.cc" "useStlAlgorithm"
"mindspore/mindspore/lite/tools/converter/parser/onnx/onnx_relu_parser.cc" "useStlAlgorithm"
"mindspore/mindspore/lite/tools/converter/quantizer/quantize_util.cc" "useStlAlgorithm"
"mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/" "unreadVariable"
"mindspore/mindspore/lite/src/runtime/kernel/opencl/cl/" "unreadVariable"
"mindspore/mindspore/lite/examples/quick_start_micro/" "syntaxError"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental" "unreadVariable"

View File

@ -1,72 +0,0 @@
# MindSpore
"mindspore/" "build/header_guard"
"mindspore/" "build/c++11"
"mindspore/include/inference.h" "runtime/references"
"mindspore/include/infer_tensor.h" "runtime/references"
"mindspore/include/inference.h" "runtime/explicit"
"mindspore/mindspore/core/abstract/utils.cc" "build/include_what_you_use"
"mindspore/mindspore/ccsrc/plugin/device/ascend/optimizer/buffer_fusion/ub_pattern_fusion.cc" "build/include_what_you_use"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/device/profiling/profiling_callback_register.cc" "runtime/references"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/device/profiling/profiling_manager.h" "runtime/references"
"mindspore/mindspore/ccsrc/plugin/device/ascend/hal/device/profiling/profiling_reporter.h" "runtime/references"
"mindspore/mindspore/core/mindrt/src/actor/actormgr.h" "runtime/references"
"mindspore/mindspore/core/mindrt/src/actor/actorpolicyinterface.h" "runtime/references"
"mindspore/mindspore/core/mindrt/src/actor/actorthread.h" "runtime/references"
"mindspore/mindspore/core/mindrt/src/actor/actorpolicy.h" "runtime/references"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/" "readability/casting"
"mindspore/mindspore/ccsrc/plugin/device/gpu/hal/device/gpu_kernel_runtime.cc" "build/include_what_you_use"
"mindspore/mindspore/ccsrc/utils/convert_utils_py.cc" "whitespace/indent"
# Modelzoo
"mindspore/model_zoo/official/cv/yolov4_tiny/infer/mxbase/src/Yolov4TinyDetection.h" "runtime/references"
"mindspore/model_zoo/official/cv/yolov4_tiny/infer/mxbase/src/PostProcess/Yolov4TinyMindsporePost.h" "runtime/references"
"mindspore/model_zoo/official/cv/resnet/infer/ResNet18/mxbase/Resnet18ClassifyOpencv.h" "runtime/references"
# MindData
"mindspore/mindspore/ccsrc/minddata/mindrecord/include/shard_page.h" "runtime/string"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/engine/tdt/tdt_plugin.h" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/util/bit.h" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc" "runtime/int"
"mindspore/mindspore/ccsrc/minddata/dataset/util" "build/include"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.h" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/image_process.cc" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/lite_cv/lite_mat.h" "runtime/explicit"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/resize_cubic_op.h" "runtime/references"
"mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/resize_cubic_op.cc" "runtime/references"
# Lite
"mindspore/mindspore/lite/include/lite_utils.h" "build/include_what_you_use"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/" "readability/casting"
"mindspore/mindspore/lite/tools/converter/micro/coder/wrapper/" "readability/casting"
"mindspore/mindspore/lite/tools/converter/parser/tflite/tflite_node_parser.h" "runtime/references"
"mindspore/mindspore/lite/tools/converter/model_parser.h" "build/namespaces"
"mindspore/mindspore/lite/tools/converter/parser/caffe/caffe_node_parser.cc" "readability/casting"
"mindspore/mindspore/lite/tools/converter/optimizer.h" "build/namespaces"
"mindspore/mindspore/lite/tools/converter/quantizer/quantize_util.h" "runtime/references"
"mindspore/mindspore/lite/tools/converter/legacy_optimizer/fusion/fusion_pass.h" "runtime/references"
"mindspore/mindspore/lite/tools/benchmark/benchmark.cc" "runtime/threadsafe_fn"
"mindspore/mindspore/lite/tools/benchmark/benchmark_base.cc" "runtime/threadsafe_fn"
"mindspore/mindspore/lite/tools/benchmark/benchmark_unified_api.cc" "runtime/threadsafe_fn"
"mindspore/mindspore/lite/tools/benchmark/run_benchmark.cc" "runtime/threadsafe_fn"
"mindspore/mindspore/lite/src/executor.h" "runtime/references"
"mindspore/mindspore/lite/src/lite_kernel.h" "runtime/references"
"mindspore/mindspore/lite/src/runtime/opencl/opencl_runtime.h" "runtime/references"
"mindspore/mindspore/lite/src/runtime/opencl/opencl_executor.h" "runtime/references"
"mindspore/mindspore/lite/src/runtime/opencl/opencl_wrapper.h" "readability/casting"
"mindspore/mindspore/lite/src/runtime/kernel/opencl/cl/" "legal/copyright"
"mindspore/mindspore/lite/src/runtime/kernel/opencl/cl/" "readability/casting"
"mindspore/mindspore/lite/src/runtime/kernel/opencl/cl/" "readability/fn_size"
"mindspore/mindspore/lite/src/runtime/thread_pool.c" "readability/casting"
"mindspore/mindspore/lite/src/runtime/thread_pool.c" "runtime/arrays"
"mindspore/mindspore/lite/src/runtime/thread_pool.c" "runtime/int"
"mindspore/mindspore/lite/src/ops/ops_def.cc" "runtime/int"
"mindspore/mindspore/lite/examples/runtime_gpu_extend/src/cl" "legal/copyright"
"mindspore/mindspore/lite/examples/runtime_gpu_extend/src/cl" "readability/casting"
"mindspore/mindspore/lite/examples/runtime_gpu_extend/src/cl" "readability/fn_size"
"mindspore/mindspore/lite/examples/quick_start_c/main.c" "readability/casting"
"mindspore/mindspore/lite/examples/quick_start_c/main.c" "runtime/threadsafe_fn"
"mindspore/mindspore/lite/examples/quick_start_micro" "readability/casting"
"mindspore/mindspore/core/mindrt/include/async/try.h" "runtime/explicit"
"mindspore/mindspore/core/mindrt/include/async/failure.h" "runtime/explicit"
"mindspore/mindspore/core/mindrt/include/async/defer.h" "runtime/explicit"

View File

@ -1,48 +0,0 @@
# akg-third-party
# file directory: mindspore/akg/third_party/incubator-tvm/
https://docs.tvm.ai/vta/tutorials/index.html
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/blogpost/vta_stack.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/passupdomain_problem.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/stage_graph.png:align
https://docs.tvm.ai/tutorials/get_started.html#sphx-glr-tutorials-get-started-py
http://docs.tvm.ai/tutorials/deployment/cross_compilation_and_rpc.html#sphx-glr-tutorials-deployment-cross-compilation-and-rpc-py
https://docs.tvm.ai/api/python/module.html#tvm.module.Module.time_evaluatornum
https://arxiv.org/abs/1509.09308https://github.com/andravin/wincnn
https://homes.cs.washington.edu/~cyulin/media/gnn_model/gcn_%s.torch
https://docs.tvm.ai/api/python/schedule.html#tvm.schedule.Stage.storage_align
https://homes.cs.washington.edu/~haichen/
https://docs.tvm.ai/dev/relay_pass_infra.html
https://en.cppreference.com/w/cpp/numeric/math/roundhttps://en.cppreference.com/w/cpp/numeric/math/nearbyint
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.htmlandhttps://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.bsr_matrix.htmlfor
https://arxiv.org/abs/1706.02515alpha
https://tinyurl.com/y5k6fz5w.We
https://tinyurl.com/y4d7hrzf.We
https://raw.githubusercontent.com/uwsampl/tvm-distro/master/tophub
https://arxiv.org/abs/1409.3215-
https://arxiv.org/abs/1706.02515alpha
https://discuss.tvm.ai/t/pool2d-gives-bad-output-for-integer-inputs/3377low
http://www.apache.org/licenses/LICENSE-2.0////
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/gatherbound.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/inferbound_traversal.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/relay/let_scope.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/blogpost/vta_overview.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/developer/dataflow.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/inferbound_phases.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/passupdomain_div.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/passupdomain_min.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/relay/dataflow.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/relay/dataflow_vs_func.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/gatherbound_problem.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/relations.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/developer/vta_instructions.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/developer/gemm_core.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/union.png:align
https://raw.githubusercontent.com/tvmai/tvmai.github.io/master/images/docs/inferbound/passupdomain_nodiv.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/developer/alu_core.png:align
http://raw.githubusercontent.com/uwsaml/web-data/master/vta/developer/2d_dma.png:align
https://raw.githubusercontent.com/dmlc/web-data/master/tensorflow/models/object_detection/ssd_mobilenet_v1_coco_2018_01_28_nopp.tgz
https://github.com/google/googletestcd
https://github.com/dmlc/dgl/blob/master/examples/pytorch/gcn/train.pyfrom
https://github.com/FrozenGene/tflite/releases/download/v1.13.1/tflite-1.13.1-py3-none-any.whlpip3
https://github.com/siju-samuel/darknet/blob/master/

View File

@ -1,138 +0,0 @@
# Overall
"mindspore/" "invalid-name"
"mindspore/" "arguments-differ"
"mindspore/" "unused-argument"
"mindspore/model_zoo/" "no-value-for-parameter"
"mindspore/model_zoo/" "import-self"
"mindspore/tests/" "missing-docstring"
"mindspore/tests/" "import-self"
# Mindspore
"mindspore/mindspore/python/mindspore/_check_deps_version.py" "broad-except"
"mindspore/mindspore/python/mindspore/_check_version.py" "unused-import"
"mindspore/mindspore/python/mindspore/_check_version.py" "broad-except"
"mindspore/mindspore/python/mindspore/common/api.py" "protected-access"
"mindspore/mindspore/python/mindspore/common/parameter.py" "protected-access"
"mindspore/mindspore/python/mindspore/common/hook_handle.py" "protected-access"
"mindspore/mindspore/python/mindspore/common/dtype.py" "undefined-all-variable"
"mindspore/mindspore/python/mindspore/context.py" "protected-access"
"mindspore/mindspore/python/mindspore/ops/operations" "super-init-not-called"
"mindspore/mindspore/python/mindspore/ops/operations/_quant_ops.py" "unused-import"
"mindspore/mindspore/python/mindspore/ops/operations/nn_ops.py" "redefined-builtin"
"mindspore/mindspore/python/mindspore/ops/operations/_thor_ops.py" "dangerous-default-value"
"mindspore/mindspore/python/mindspore/ops/operations/_thor_ops.py" "redefined-outer-name"
"mindspore/mindspore/python/mindspore/ops/operations/_thor_ops.py" "unused-import"
"mindspore/mindspore/python/mindspore/ops/_op_impl/_custom_op" "dangerous-default-value
"mindspore/mindspore/python/mindspore/ops/_op_impl/_custom_op" "simplifiable-if-expression"
"mindspore/mindspore/python/mindspore/ops/_op_impl/_custom_op" "unused-variable"
"mindspore/mindspore/python/mindspore/ops/composite/base.py" "protected-acces"
"mindspore/mindspore/python/mindspore/ops/primitive.py" "assignment-from-none"
"mindspore/mindspore/python/mindspore/nn/cell.py" "assignment-from-none"
"mindspore/mindspore/python/mindspore/_extends/parse/resources.py" "bad-whitespace"
"mindspore/mindspore/python/mindspore/_extends/parse/parser.py" "broad-except"
"mindspore/mindspore/python/mindspore/_extends/parse/parser.py" "protected-access"
"mindspore/mindspore/python/mindspore/_extends/parse/parser.py" "eval-used"
"mindspore/mindspore/python/mindspore/nn/cell.py" "protected-access"
"mindspore/mindspore/python/mindspore/nn/optim/ftrl.py" "unused-import"
"mindspore/mindspore/python/mindspore/train/amp.py" "protected-access"
"mindspore/mindspore/python/mindspore/train/serialization.py" "protected-access"
"mindspore/mindspore/python/mindspore/train/model.py" "protected-access"
"mindspore/mindspore/python/mindspore/log.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/api/node.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/node.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/symbol_tree.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/parser_register.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/api/pattern_engine.py" "protected-access"
"mindspore/mindspore/python/mindspore/rewrite/symbol_tree.py" "inconsistent-return-statements"
"mindspore/model_zoo/official/cv" "missing-docstring"
"mindspore/model_zoo/official/cv" "c-extension-no-member"
"mindspore/model_zoo/official/nlp/bert_thor/src/bert_model.py" "redefined-outer-name"
"mindspore/mindspore/python/mindspore/_extends/parallel_compile/akg_compiler/akg_process.py" "Catching too general exception BaseException"
"mindspore/mindspore/python/mindspore/_extends/graph_kernel/model/model.py" "super-on-old-class"
"mindspore/mindspore/python/mindspore/ops/_grad/grad_math_ops.py" "invalid-unary-operand-type"
# MindData
"mindspore/mindspore/python/mindspore/dataset/__init__.py" "redefined-builtin"
"mindspore/mindspore/python/mindspore/dataset/engine/__init__.py" "redefined-builtin"
"mindspore/mindspore/python/mindspore/dataset/engine/datasets.py" "redefined-builtin"
"mindspore/mindspore/python/mindspore/dataset/engine/datasets.py" "broad-except"
"mindspore/mindspore/python/mindspore/dataset/transforms/py_transforms_util.py" "broad-except"
# Tests
"mindspore/tests/vm_impl/array_ops_vm_impl.py" "unused-variable"
"mindspore/tests/ut/cpp/python_input/gtest_input/pipeline/parse/parse_compile.py" "unused-import"
"mindspore/tests/ut/cpp/python_input/gtest_input/pipeline/infer/primitive_test.py" "super-init-not-called"
"mindspore/tests/ut/cpp/python_input/gtest_input/pipeline/parse/parse_primitive.py" "super-init-not-called"
"mindspore/tests/ut/cpp/python_input/gtest_input/pre_activate" "unused-variable"
"mindspore/tests/ut/cpp/python_input/gtest_input/tbe" "unused-variable"
"mindspore/tests/ut/python/train/summary/test_summary_abnormal_input.py" "bare-except"
"mindspore/tests/ut/python/train/summary/test_graph_summary.py" "protected-access"
"mindspore/tests/ut/python/parameter_feature/test_parameter.py" "unused-variable"
"mindspore/tests/ut/python/parameter_feature/test_parameter.py" "singleton-comparison"
"mindspore/tests/ut/python/optimizer/test_debug_location.py" "no-value-for-parameter"
"mindspore/tests/ut/python/ops/test_control_ops.py" "superfluous-parens"
"mindspore/tests/ut/python/ops/test_control_ops.py" "unused-variable"
"mindspore/tests/ut/python/keep_order/test_keep_order.py" "redefined-outer-name"
"mindspore/tests/ut/python/ir/test_tensor.py" "protected-access"
"mindspore/tests/ut/python/dataset/test_sampler.py" "unused-variable"
"mindspore/tests/ut/python/dataset/test_minddataset_padded.py" "redefined-outer-name"
"mindspore/tests/ut/python/dataset/test_minddataset_padded.py" "unused-variable"
"mindspore/tests/ut/python/dataset/test_minddataset_padded.py" "expression-not-assigned"
"mindspore/tests/ut/python/dataset/test_batch.py" "broad-except"
"mindspore/tests/ut/python/dataset/test_config.py" "broad-except"
"mindspore/tests/ut/python/dataset/test_minddataset.py" "redefined-outer-name"
"mindspore/tests/ut/python/dataset/test_minddataset_sampler.py" "redefined-outer-name"
"mindspore/tests/ut/python/dataset/test_serdes_dataset.py" "redefined-outer-name"
"mindspore/tests/ut/python/dataset/test_serdes_dataset.py" "unused-import"
"mindspore/tests/ut/python/dataset/test_shuffle.py" "broad-except"
"mindspore/tests/ut/python/dataset/test_to_type.py" "broad-except"
"mindspore/tests/ut/python/dataset/test_uniform_augment.py" "broad-except"
"mindspore/tests/ut/python/dataset/test_zip.py" "broad-except"
"mindspore/tests/ut/python/mindrecord/test_cifar10_to_mindrecord.py" "redefined-outer-name"
"mindspore/tests/ut/python/mindrecord/test_cifar100_to_mindrecord.py" "redefined-outer-name"
"mindspore/tests/ut/python/mindrecord/test_imagenet_to_mindrecord.py" "redefined-outer-name"
"mindspore/tests/ut/python/mindrecord/test_mindrecord_exception.py" "redefined-outer-name"
"mindspore/tests/ut/python/mindrecord/test_mnist_to_mr.py" "redefined-outer-name"
"mindspore/tests/ut/python/nn/test_batchnorm.py" "no-value-for-parameter"
"mindspore/tests/ut/python/onnx/test_onnx.py" "unused-variable"
"mindspore/tests/ut/python/ops" "super-init-not-called"
"mindspore/tests/ut/python/ops/test_tensor_slice.py" "redefined-outer-name"
"mindspore/tests/ut/python/optimizer/test_debug_location.py" "super-init-not-called"
"mindspore/tests/ut/python/parallel/" "protected-access"
"mindspore/tests/ut/python/parameter_feature/test_var_grad.py" "bad-super-call"
"mindspore/tests/ut/python/parameter_feature/test_var_grad.py" "redefined-outer-name"
"mindspore/tests/ut/python/pipeline/parse/test_cont_break.py" "unused-variable"
"mindspore/tests/ut/python/pynative_mode" "no-else-return"
"mindspore/tests/ut/python/pynative_mode" "superfluous-parens"
"mindspore/tests/ut/python/pynative_mode" "unused-variable"
"mindspore/tests/ut/python/pynative_mode/test_stop_gradient.py" "redefined-outer-name"
"mindspore/tests/ut/python/pynative_mode/test_stop_gradient.py" "super-init-not-called"
"mindspore/tests/ut/python/rewrite/test_flatten_recursive_stmt.py" "consider-using-ternary"
"mindspore/tests/ut/python/rewrite/test_node.py" "syntax-error"
"mindspore/tests/ut/python/rewrite/test_node.py" "protected-access"
"mindspore/tests/ut/python/rewrite/test_symbol_tree.py" "len-as-condition"
"mindspore/tests/ut/python/test_log.py" "possibly-unused-variable"
"mindspore/tests/ut/python/test_log.py" "protected-access"
"mindspore/tests/ut/python/train/summary/test_summary_collector.py" "protected-access"
"mindspore/tests/ut/python/pipeline/parse/test_super.py" "bad-super-call"
"mindspore/tests/ut/python/pipeline/parse/test_super.py" "assignment-from-none"
"mindspore/tests/ut/python/pipeline/parse/test_dictionary.py" "consider-iterating-dictionary"
"mindspore/tests/ut/python/pipeline/parse/test_use_undefined_name_or_unsupported_builtin_function.py" "pointless-statement"
"mindspore/tests/st/networks/test_gpu_resnet.py" "superfluous-parens"
"mindspore/tests/st/networks/test_gpu_resnet.py" "unused-variable"
"mindspore/tests/st/networks/test_gpu_lstm.py" "unused-variable"
"mindspore/tests/st/networks/test_gpu_lstm.py" "redefined-outer-name"
"mindspore/tests/st/networks/test_gpu_lstm.py" "superfluous-parens"
"mindspore/tests/st/networks/test_gpu_alexnet.py" "unused-variable"
"mindspore/tests/st/networks/test_gpu_lenet.py" "unused-variable"
"mindspore/tests/st/ops/custom_ops_tbe/cus_add3.py" "unused-import"
"mindspore/tests/st/ops/ascend/test_aicpu_ops/test_strided_slice.py" "redefined-outer-name"
"mindspore/tests/st/ops/ascend/test_aicpu_ops/test_strided_slice.py" "redefined-builtin"
"mindspore/tests/st/ops/ascend/test_aicpu_ops/test_strided_slice_grad.py" "redefined-outer-name"
"mindspore/tests/st/pynative/parser/test_parser_construct.py" "bad-super-call"
"mindspore/tests/ut/python/optimizer/test_auto_grad.py" "broad-except"
#MindSpore Lite
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/generator.py" "redefined-builtin"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/generator.py" "exec-used"
"mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/generator.py" "global-variable-undefined"

View File

@ -1,201 +0,0 @@
# Scene1:
# function_name1, function_name2
# Scene2:
# file_path:function_name1, function_name2
#
mindspore/mindspore/core/mindrt/src/thread/actor_threadpool.cc:mindspore::ActorWorker::RunWithSpin
mindspore/mindspore/lite/src/ops/primitive_c.cc:mindspore::lite::PrimitiveC::Create
mindspore/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/csv_op.cc:mindspore::dataset::CsvOp::CsvParser::InitCsvParser
mindspore/mindspore/lite/tools/converter/graphdef_transform.cc:mindspore::lite::GraphDefTransform::Transform
mindspore/mindspore/lite/providers/nnie_proposal/src/proposal.cc:mindspore::proposal::Rpn
mindspore/mindspore/core/abstract/primitive_infer_map.cc:mindspore::abstract::GetPrimitiveToEvalImplMap
mindspore/mindspore/ccsrc/frontend/optimizer/irpass.cc:mindspore::opt::irpass::OptimizeIRPassLib::OptimizeIRPassLib
mindspore/mindspore/ccsrc/frontend/parallel/ops_info/gather_v2_p_info.cc:mindspore::parallel::GatherV2PInfo::CheckStrategy
mindspore/mindspore/ccsrc/plugin/device/gpu/hal/device/gpu_kernel_runtime.cc:mindspore::device::gpu::GPUKernelRuntime::LaunchKernelDynamic
mindspore/mindspore/ccsrc/pipeline/jit/init.cc:PYBIND11_MODULE
mindspore/mindspore/ccsrc/plugin/device/gpu/kernel/math/unary_op_gpu_kernel.h:mindspore::kernel::UnaryOpGpuKernel::Launch
mindspore/mindspore/ccsrc/plugin/device/ascend/optimizer/ir_fission/dynamic_rnn_grad_fission_v2.cc:mindspore::opt::AddLSTMInputGradNode
mindspore/model_zoo/official/recommend/wide_and_deep/src/wide_and_deep.py:__init__
mindspore/model_zoo/official/recommend/wide_and_deep_multitable/src/wide_and_deep.py:__init__
mindspore/mindspore/ccsrc/pipeline/jit/resource.cc:mindspore::pipeline::GetMethodMap
mindspore/mindspore/python/mindspore/ops/operations/array_ops.py:_compute_slicing_shape
mindspore/mindspore/python/mindspore/context.py:set_auto_parallel_context
mindspore/mindspore/python/mindspore/common/tensor.py:__init__
mindspore/mindspore/python/mindspore/common/parameter.py:set_data
mindspore/mindspore/ccsrc/pybind_api/ir/tensor_py.cc:mindspore::tensor::GetDataType
mindspore/mindspore/lite/nnacl/fp32/avg_pooling_fp32.c:AvgPooling
mindspore/mindspore/lite/src/runtime/thread_pool.c:GetArch
mindspore/mindspore/lite/src/runtime/kernel/opencl/kernel/conv2d.cc:mindspore::kernel::UseWinograd4x4To6x6
mindspore/mindspore/lite/src/scheduler.cc:mindspore::lite::Scheduler::FindBackendKernel
mindspore/mindspore/lite/nnacl/infer/strided_slice_infer.c:StridedSliceInferShape
mindspore/mindspore/lite/nnacl/fp16/pack_fp16.c:PackNHWCToNCHWFp16
mindspore/mindspore/lite/src/ios_reg_ops.cc:mindspore::lite::IosRegisterOps
mindspore/mindspore/lite/src/ios_reg_kernels.h:mindspore::kernel::IosRegisterKernels
mindspore/mindspore/lite/nnacl/infer/infer_register.c:RegisterInfer
mindspore/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc:mindspore::kernel::QuantDTypeCastCPUKernel::QuantDTypeCast
mindspore/mindspore/lite/src/runtime/kernel/arm/base/quant_dtype_cast.cc:mindspore::kernel::QuantDTypeCastCPUKernel::Run
mindspore/mindspore/ccsrc/pipeline/jit/static_analysis/prim.cc:mindspore::abstract::ConvertAbstractToPython
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/infer/strided_slice_infer.c:StridedSliceInferShape
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_transform_fp16.c:WinogradInputTransformFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/pooling_fp16.c:AvgPoolingFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/pooling_fp16.c:MaxPoolingFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform4x2UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform4x2ReluUnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform4x2Relu6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6ReluUnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6Relu6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/pooling_int8.c:AvgPoolingOptInt8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/pooling_int8.c:MaxPoolingWithQuantInt8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv3x3_int8.c:Conv3x3Int8OutputUnit
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv_int8.c:Conv1x1PreOptPeroc
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/infer/infer_register.c:RegisterInfer
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/gemm.c:RowMajor2Col12MajorStride
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32_grad/gemm.c:RowMajor2Col8MajorStride
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_transform_fp16.c:Conv3x3Fp16InputUnit
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_transform_fp16.c:Conv3x3Fp16FilterTransform
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/pooling_fp16.c:AvgPoolingFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/pooling_fp16.c:MaxPoolingFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/pack_fp16.c:PackNHWCToNCHWFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:InputTransform6x6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:InputTransform8x8UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform4x2Relu6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6ReluUnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/winograd_utils_fp16.c:OutputTransform8x6Relu6UnitFp16
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/pooling_int8.c:AvgPoolingOptInt8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv3x3_int8.c:Conv3x3Int8InputUnit
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv3x3_int8.c:Conv3x3Int8FilterTransform
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv3x3_int8.c:Conv3x3Int8OutputUnit
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv_int8.c:Conv1x1PreOptPeroc
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/conv_int8.c:Conv1x1PreOptPert
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/int8/pack_int8.c:PackNHWCToNCHWInt8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/pooling_fp32.c:AvgPooling
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/matmul_fp32.c:MatMul4x1Kernel
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/conv_common_fp32.c:SWConv3x32Kernel, SWConv4x24Kernel, SWConv12x8Kernel, SWConv8x8Kernel, SWConv4x8Kernel, SWConv6x16Kernel, SWConv4x16Kernel
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/conv_depthwise_fp32.c:DepthwiseSW3x32Kernel, DepthwiseSW4x24Kernel, DepthwiseSW12x8Kernel, DepthwiseSW8x8Kernel, DepthwiseSW4x8Kernel, DepthwiseSW6x16Kernel, DepthwiseSW4x16Kernel
mindspore/mindspore/core/ir/dtype/type.cc:mindspore::ObjectIdLabel
mindspore/mindspore/python/mindspore/ops/_op_impl/_custom_op/dsd_impl.py:dsd_matmul
mindspore/mindspore/python/mindspore/ops/_op_impl/_custom_op/dsd_back_impl.py:dsdbpropimpl
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/conv_1x1_x86_fp32.c:Conv1x1SW3x32Kernel, Conv1x1SW4x24Kernel, Conv1x1SW12x8Kernel, Conv1x1SW8x8Kernel, Conv1x1SW4x8Kernel, Conv1x1SW6x16Kernel, Conv1x1SW4x16Kernel, Conv1x1SW1x32Kernel, Conv1x1SW1x24Kernel, Conv1x1SW1x16Kernel, Conv1x1SW1x8Kernel
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/matmul_fp32.c:MatMul3x32Kernel, MatMul4x24Kernel, MatMul12x8Kernel, MatMul8x8Kernel, MatMul4x8Kernel, MatMul6x16Kernel, MatMul4x16Kernel, MatVecMul1x32Kernel, MatVecMul1x24Kernel, MatVecMul1x16Kernel, MatVecMul1x8Kernel
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/TiledC4MatMulFp32.c:TiledC4MatmulFp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/PostFuncBiasReluC4.c:PostFuncBiasReluC4
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/WinogradTrans.c:WinogradTransRight
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/WinogradTrans.c:WinogradTransLeft
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/WinogradPostFuncBiasReluC4.c:WinogradPostFuncBiasReluC4
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/PostFuncBiasReluC8.c:PostFuncBiasReluC8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/WinogradPostFuncBiasReluC8.c:WinogradPostFuncBiasReluC8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/deconv_winograd_fp32.c:PackDeConvWgDataFp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/WinogradPostFuncBiasReluC4.c:WinogradPostFuncBiasReluC4
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/sse/PostFuncBiasReluC8.c:PostFuncBiasReluC8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/WinogradTransAvx.c:WinogradTransLeft
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/WinogradTransAvx.c:WinogradTransRight
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/PostFuncBiasReluC8.c:PostFuncBiasReluC8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/WinogradPostFuncBiasReluC8.c:WinogradPostFuncBiasReluC8
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/deconv_winograd_fp32.c:PackDeConvWgDataFp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/deconv_winograd_fp32.c:DeConvWgMerge
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/intrinsics/avx/TiledC8MatMulFp32.c:TiledC8MatmulFp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/quant_dtype_cast_fp16.c:Fp16ToInt8_arm64
mindspore/mindspore/ccsrc/backend/common/session/gpu_session.cc:mindspore::session::gpu::GPUSession::LoadInputData
mindspore/mindspore/ccsrc/debug/dump_proto.cc:mindspore::ProtoExporter::SetNodeOutputType
mindspore/mindspore/ccsrc/debug/dump_proto.cc:mindspore::ProtoExporter::SetValueToProto
mindspore/mindspore/ccsrc/debug/dump_proto.cc:mindspore::ProtoExporter::SetScalarToProto
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_10x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_10x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_11x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_11x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x96_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x96_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_7x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_7x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_5x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_5x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_6x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_6x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x96_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x96_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x80_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x80_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x80_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x80_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x80_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x80_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_9x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_9x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_8x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_8x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_6x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_6x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_8x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_8x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_6x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_6x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_5x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_5x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_9x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_9x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_7x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_7x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x96_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x96_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x80_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x80_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_4x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_4x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_12x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_12x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_10x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_10x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_5x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_5x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_11x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_11x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_5x80_kernel_nhwc_fp32.c:nnacl_gemm_avx512_5x80_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_8x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_8x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_3x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_3x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_12x32_kernel_nhwc_fp32.c:nnacl_gemm_avx512_12x32_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_1x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_1x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_2x96_kernel_nhwc_fp32.c:nnacl_gemm_avx512_2x96_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_7x16_kernel_nhwc_fp32.c:nnacl_gemm_avx512_7x16_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_5x48_kernel_nhwc_fp32.c:nnacl_gemm_avx512_5x48_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_avx512/nnacl_gemm_avx512_6x64_kernel_nhwc_fp32.c:nnacl_gemm_avx512_6x64_kernel_nhwc_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x24_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_3x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x32_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_2x32_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_12x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_12x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x16_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_2x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_8x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_8x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x24_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_2x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x16_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_3x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x32_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_3x32_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x16_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_2x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x32_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_3x32_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_6x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_6x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_6x16_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_6x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_6x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_6x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_9x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_9x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_8x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_8x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_10x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_10x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_6x16_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_6x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x24_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_4x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_11x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_11x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_11x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_11x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_10x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_10x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x16_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_3x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_7x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_7x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x24_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_4x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_12x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_12x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_5x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_5x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_3x8_kernel_nc8hw8_fp32
mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc:mindspore::kernel::MatmulFp32BaseCPUKernel::init_global_variable
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_3x24_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_3x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x16_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_4x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_1x24_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_1x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_4x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_5x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_5x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_7x8_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_7x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_4x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_5x16_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_5x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_1x32_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_1x32_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_5x16_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_5x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_9x8_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_9x8_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_4x16_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_4x16_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x32_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_2x32_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_2x24_kernel_nc8hw8_fp32.c:nnacl_gemm_fma_2x24_kernel_nc8hw8_fp32
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/HPC-generator/gemm_fma/nnacl_gemm_fma_1x32_kernel_nc8hw8_fp32_asm.c:nnacl_gemm_fma_1x32_kernel_nc8hw8_fp32
mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc:mindspore::kernel::MatmulFp32BaseCPUKernel::Run
mindspore/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_partition.cc:mindspore::parallel::GetWeights
mindspore/mindspore/ccsrc/frontend/parallel/auto_parallel/rec_core/rec_partition.cc:mindspore::parallel::PartitionNode
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp16/instance_norm_fp16.c:InstanceNormNC8HW8Fp16
mindspore/mindspore/lite/src/runtime/kernel/arm/fp32/matmul_fp32_base.cc:mindspore::kernel::MatmulFp32BaseCPUKernel::init_global_variable
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/fp32/conv_winograd_fp32.c:ConvWinogardFp32
mindspore/mindspore/ccsrc/plugin/device/ascend/optimizer/ir_fusion/lamb_next_mv_with_decay_v1_rule.cc:mindspore::opt::MatchAdd5Pattern
mindspore/mindspore/ccsrc/plugin/device/cpu/kernel/nnacl/experimental/conv_fp32_nchwx_avx512.c:conv2d_compute_fp32_nchwx_avx512

View File

@ -1,73 +0,0 @@
# Copyright 2021 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.
# ============================================================================
MS_ALL:
include/api
mindspore/core
mindspore/ccsrc/cxx_api
mindspore/ccsrc/backend/common
mindspore/ccsrc/plugin/device/cpu/kernel/nnacl
mindspore/ccsrc/minddata
mindspore/ccsrc/CMakeLists.txt
mindspore/lite/java
mindspore/lite/src/train
mindspore/lite/src/runtime/kernel/arm/fp32
mindspore/lite/src/runtime/kernel/arm/fp32_grad
mindspore/ccsrc/backend/kernel_compiler
mindspore/ccsrc/fl
mindspore/ccsrc/ps
MS_CLOUD:
mindspore/python
mindspore/ccsrc
tests/st
MS_LITE:
include/c_api
include/api/allocator.h
include/api/delegate.h
include/api/kernel.h
include/api/model_parallel_runner.h
mindspore/lite/
cmake/package_lite.cmake
MS_CLOUD_UT:
tests/ut
MS_CLOUD_UT_CPP:
tests/ut/cpp
MS_CLOUD_UT_PYTHON:
tests/ut/python
MS_CLOUD_ST_ASCEND:
tests/st/ops/ascend
MS_CLOUD_ST_GPU:
tests/st/ops/gpu
MS_CLOUD_ST_CPU:
tests/st/ops/cpu
MS_CI:
.jenkins
.clang-format
MS_DOCS:
docker
docs
scripts
README.md
Readme.md
readme.md
README_CN.md
RELEASE.md
release.md
PULL_REQUEST_TEMPLATE.md
CONTRIBUTING.md
LICENSE
NOTICE
SECURITY.md
Third_Party_Open_Source_Software

View File

@ -1,79 +1,63 @@
cmake_minimum_required(VERSION 3.14.0)
project(MindSpore)
cmake_minimum_required(VERSION 3.14)
project (MindSpore)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
message(FATAL_ERROR "GCC version ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.3.0)
message(WARNING "GCC version ${CMAKE_CXX_COMPILER_VERSION} is greater than 7.3.0, may cause unknown problems.")
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3.0)
message(FATAL_ERROR "GCC vesion ${CMAKE_CXX_COMPILER_VERSION} must not be less than 7.3.0")
endif ()
include(${CMAKE_SOURCE_DIR}/cmake/options.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/check_requirements.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
if(NOT ENABLE_GLIBCXX)
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
endif()
endif()
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Wno-inconsistent-missing-override \
-Wno-unused-lambda-capture -Wno-unneeded-internal-declaration -Wno-unused-variable \
-Wno-return-std-move -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
elseif(ENABLE_SYM_FILE)
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -g -ggdb -Wl,--allow-shlib-undefined \
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Werror -Wno-return-std-move -Wno-unused-private-field -Wno-unused-lambda-capture -Wno-sign-compare -Wno-overloaded-virtual -Wno-unneeded-internal-declaration -Wno-unused-variable -Wno-pessimizing-move -Wno-inconsistent-missing-override -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
else()
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Wl,--allow-shlib-undefined \
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O2 -Wl,--allow-shlib-undefined -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2")
endif()
if(ENABLE_PYTHON)
if (ENABLE_PYTHON)
add_compile_definitions(ENABLE_PYTHON)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
-D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 -DHALF_ENABLE_CPP11_USER_LITERALS=0 \
-D_FORTIFY_SOURCE=2 -Wno-cpp -Wno-inconsistent-missing-override -Wno-unused-lambda-capture \
-Wno-unneeded-internal-declaration -Wno-unused-variable -Wno-return-std-move")
else()
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
-Wl,--allow-shlib-undefined -D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 \
-DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2 -Wno-cpp")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer -Wl,--allow-shlib-undefined -D_LIBCPP_INLINE_VISIBILITY='' -D_LIBCPP_DISABLE_EXTERN_TEMPLATE=1 -DHALF_ENABLE_CPP11_USER_LITERALS=0 -D_FORTIFY_SOURCE=2 -Wno-cpp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include -std=c++17 \
-Werror -Wall -Wno-deprecated-declarations -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include -std=c++17 -Werror -Wall -fPIC")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(PYBIND11_CPP_STANDARD -std=c++17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPTION_CXX_FLAGS}")
if(ENABLE_AKG AND CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(Threads)
if (DEFINED ENV{MS_PATCH_PATH})
find_program(Patch_EXECUTABLE patch PATHS $ENV{MS_PATCH_PATH})
set(Patch_FOUND ${Patch_EXECUTABLE})
else ()
find_package(Patch)
endif ()
if (NOT Patch_FOUND)
message(FATAL_ERROR "Patch not found, please set env variable MS_PATCH_PATH, "
"usually locate in GIT_PATH/usr/bin in windows")
endif ()
message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE})
if (ENABLE_AKG AND (ENABLE_D OR ENABLE_GPU))
add_subdirectory("${CMAKE_SOURCE_DIR}/akg")
endif()
include(${CMAKE_SOURCE_DIR}/cmake/mind_expression.cmake)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/securec/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include/flatbuffers)
if(ENABLE_FAST_HASH_TABLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_FAST_HASH_TABLE=1")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/robin_hood/include)
endif()
include(${CMAKE_SOURCE_DIR}/cmake/dependency_utils.cmake)
find_package(Python3 COMPONENTS Interpreter Development)
find_package(Python3 3.7 COMPONENTS Interpreter Development)
if(Python3_FOUND)
set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}")
set(PYTHON_LIBRARIES "${Python3_LIBRARIES}")
if(WIN32)
if(Python3_DIR)
if (WIN32)
if (Python3_DIR)
message("Python3_DIR set already: " ${Python3_DIR})
else()
string(LENGTH ${PYTHON_LIBRARIES} PYTHON_LIBRARIES_LEN)
@ -96,38 +80,30 @@ include_directories(${PYTHON_INCLUDE_DIRS})
set(MS_CCSRC_PATH ${CMAKE_SOURCE_DIR}/mindspore/ccsrc)
set(MS_CCSRC_BUILD_PATH ${BUILD_PATH}/mindspore/mindspore/ccsrc)
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
if (ENABLE_GE)
link_directories(${CMAKE_SOURCE_DIR}/third_party/ge/lib)
elseif(ENABLE_D OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/dependency_graphengine.cmake)
endif()
if (ENABLE_GE OR ENABLE_D OR ENABLE_TESTCASES)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/graphengine/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/graphengine/inc/external)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/graphengine/inc/framework)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/toolchain)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
add_subdirectory(mindspore/ccsrc)
add_subdirectory(mindspore/core)
if(DEFINED ENV{ENABLE_CLOUD_AND_LITE})
set(ENABLE_CLOUD_AND_LITE $ENV{ENABLE_CLOUD_AND_LITE})
endif()
if(ENABLE_CLOUD_AND_LITE)
add_subdirectory(mindspore/lite)
endif()
if(ENABLE_TESTCASES OR ENABLE_CPP_ST)
if (ENABLE_TESTCASES)
add_subdirectory(tests)
endif()
# packaging
file(READ ${CMAKE_SOURCE_DIR}/version.txt VERSION_NUMBER)
string(REPLACE "\n" "" VERSION_NUMBER ${VERSION_NUMBER})
if(${VERSION_NUMBER} MATCHES ".*dev.*")
message("building dev mode")
set(BUILD_DEV_MODE ON)
endif()
if(MODE_ASCEND_ACL)
include(cmake/package_tar.cmake)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
include(cmake/package_win.cmake)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
include(cmake/package_mac.cmake)
else()
include(cmake/package.cmake)
if (ENABLE_SERVING)
add_subdirectory(serving)
add_subdirectory(serving/example/cpp_client)
endif()
include(cmake/package.cmake)

View File

@ -30,37 +30,23 @@ For individual contributor, please refer to [ICLA online document](https://www.m
Please follow this style to make MindSpore easy to review, maintain and develop.
- Coding guidelines
* Coding guidelines
The *Python* coding style suggested by [Python PEP 8 Coding Style](https://pep8.org/) and *C++* coding style suggested by [Google C++ Coding Guidelines](http://google.github.io/styleguide/cppguide.html) are used in MindSpore community. The [CppLint](https://github.com/cpplint/cpplint), [CppCheck](http://cppcheck.sourceforge.net), [CMakeLint](https://github.com/cmake-lint/cmake-lint), [CodeSpell](https://github.com/codespell-project/codespell), [Lizard](http://www.lizard.ws), [ShellCheck](https://github.com/koalaman/shellcheck) and [PyLint](https://pylint.org) are used to check the format of codes, installing these plugins in your IDE is recommended.
The *Python* coding style suggested by [Python PEP 8 Coding Style](https://pep8.org/) and *C++* coding style suggested by [Google C++ Coding Guidelines](http://google.github.io/styleguide/cppguide.html) are used in MindSpore community.
- Unittest guidelines
* Unittest guidelines
The *Python* unittest style suggested by [pytest](http://www.pytest.org/en/latest/) and *C++* unittest style suggested by [Googletest Primer](https://github.com/google/googletest/blob/master/docs/primer.md) are used in MindSpore community. The design intent of a testcase should be reflected by its name of comment.
- Refactoring guidelines
We encourage developers to refactor our code to eliminate the [code smell](https://en.wikipedia.org/wiki/Code_smell). All codes should conform to needs to the coding style and testing style, and refactoring codes are no exception. [Lizard](http://www.lizard.ws) threshold for nloc (lines of code without comments) is 100 and for cnc (cyclomatic complexity number) is 20, when you receive a *Lizard* warning, you have to refactor the code you want to merge.
- Document guidelines
We use *MarkdownLint* to check the format of markdown documents. MindSpore CI modifies the following rules based on the default configuration.
- MD007 (unordered list indentation): The **indent** parameter is set to **4**, indicating that all content in the unordered list needs to be indented using four spaces.
- MD009 (spaces at the line end): The **br_spaces** parameter is set to **2**, indicating that there can be 0 or 2 spaces at the end of a line.
- MD029 (sequence numbers of an ordered list): The **style** parameter is set to **ordered**, indicating that the sequence numbers of the ordered list are in ascending order.
For details, please refer to [RULES](https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md).
The *Python* unittest style suggested by [pytest](http://www.pytest.org/en/latest/) and *C++* unittest style suggested by [Googletest Primer](https://github.com/google/googletest/blob/master/googletest/docs/primer.md) are used in MindSpore community.
### Fork-Pull development model
- Fork MindSpore repository
* Fork MindSpore repository
Before submitting code to MindSpore project, please make sure that this project have been forked to your own repository. It means that there will be parallel development between MindSpore repository and your own repository, so be careful to avoid the inconsistency between them.
- Clone the remote repository
* Clone the remote repository
If you want to download the code to the local machine, `git` is the best way:
```shell
# For GitHub
git clone https://github.com/{insert_your_forked_repo}/mindspore.git
@ -70,21 +56,18 @@ Please follow this style to make MindSpore easy to review, maintain and develop.
git remote add upstream https://gitee.com/mindspore/mindspore.git
```
- Develop code locally
* Develop code locally
To avoid inconsistency between multiple branches, checking out to a new branch is `SUGGESTED`:
```shell
git checkout -b {new_branch_name} origin/master
```
Taking the master branch as an example, MindSpore may create version branches and downstream development branches as needed, please fix bugs upstream first.
Then you can change the code arbitrarily.
- Push the code to the remote repository
* Push the code to the remote repository
After updating the code, you should push the update in the formal way:
```shell
git add .
git status # Check the update status
@ -93,9 +76,9 @@ Please follow this style to make MindSpore easy to review, maintain and develop.
git push origin {new_branch_name}
```
- Pull a request to MindSpore repository
* Pull a request to MindSpore repository
In the last step, your need to pull a compare request between your new branch and MindSpore `master` branch. After finishing the pull request, the Jenkins CI will be automatically set up for building test. Your pull request should be merged into the upstream master branch as soon as possible to reduce the risk of merging.
In the last step, your need to pull a compare request between your new branch and MindSpore `master` branch. After finishing the pull request, the Jenkins CI will be automatically set up for building test.
### Report issues
@ -105,7 +88,6 @@ When reporting issues, refer to this format:
- What version of env (mindspore, os, python etc) are you using?
- Is this a BUG REPORT or FEATURE REQUEST?
- What kind of issue is, add the labels to highlight it on the issue dashboard.
- What happened?
- What you expected to happen?
- How to reproduce it?(as minimally and precisely as possible)
@ -116,15 +98,14 @@ When reporting issues, refer to this format:
- **If you find an unclosed issue, which is exactly what you are going to solve,** please put some comments on that issue to tell others you would be in charge of it.
- **If an issue is opened for a while,** it's recommended for contributors to precheck before working on solving that issue.
- **If you resolve an issue which is reported by yourself,** it's also required to let others know before closing that issue.
- **If you want the issue to be responded as quickly as possible,** please try to label it, you can find kinds of labels on [Label List](https://gitee.com/mindspore/community/blob/master/sigs/dx/docs/labels.md)
### Propose PRs
- Raise your idea as an *issue* on [GitHub](https://github.com/mindspore-ai/mindspore/issues) or [Gitee](https://gitee.com/mindspore/mindspore/issues)
- If it is a new feature that needs lots of design details, a design proposal should also be submitted.
- After reaching consensus in the issue discussions and design proposal reviews, complete the development on the forked repo and submit a PR.
- None of PRs is not permitted until it receives **2+ LGTM** from approvers. Please NOTICE that approver is NOT allowed to add *LGTM* on his own PR.
- After PR is sufficiently discussed, it will get merged, abandoned or rejected depending on the outcome of the discussion.
* Raise your idea as an *issue* on [GitHub](https://github.com/mindspore-ai/mindspore/issues) or [Gitee](https://gitee.com/mindspore/mindspore/issues)
* If it is a new feature that needs lots of design details, a design proposal should also be submitted.
* After reaching consensus in the issue discussions and design proposal reviews, complete the development on the forked repo and submit a PR.
* None of PRs is not permitted until it receives **2+ LGTM** from approvers. Please NOTICE that approver is NOT allowed to add *LGTM* on his own PR.
* After PR is sufficiently discussed, it will get merged, abandoned or rejected depending on the outcome of the discussion.
**PRs advisory:**

28
OWNERS
View File

@ -1,28 +0,0 @@
approvers:
- kingxian
- guoqi1024
- baochong
- zhaizhiqiang
- stsuteng
- kisnwang
files:
"akg":
approvers:
- gaoxiong1
- ckey_dou
- anyrenwei
"graphengine":
approvers:
- zhoufeng54
- jjfeing
- guoqi1024
- baochong
"version.txt":
approvers:
- zhoufeng54
- jjfeing
- guoqi1024
- baochong

149
README.md
View File

@ -1,23 +1,14 @@
![MindSpore Logo](https://gitee.com/mindspore/mindspore/raw/master/docs/MindSpore-logo.png "MindSpore logo")
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mindspore.svg)](https://pypi.org/project/mindspore)
[![PyPI](https://badge.fury.io/py/mindspore.svg)](https://badge.fury.io/py/mindspore)
[![Downloads](https://pepy.tech/badge/mindspore)](https://pepy.tech/project/mindspore)
[![DockerHub](https://img.shields.io/docker/pulls/mindspore/mindspore-cpu.svg)](https://hub.docker.com/r/mindspore/mindspore-cpu)
[![LICENSE](https://img.shields.io/github/license/mindspore-ai/mindspore.svg?style=flat-square)](https://github.com/mindspore-ai/mindspore/blob/master/LICENSE)
[![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/mindspore/shared_invite/zt-dgk65rli-3ex4xvS4wHX7UDmsQmfu8w)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://gitee.com/mindspore/mindspore/pulls)
![MindSpore Logo](docs/MindSpore-logo.png "MindSpore logo")
============================================================
[查看中文](./README_CN.md)
<!-- TOC -->
- [What Is MindSpore](#what-is-mindspore)
- [Automatic Differentiation](#automatic-differentiation)
- [Automatic Parallel](#automatic-parallel)
- [Installation](#installation)
- [Pip mode method installation](#pip-mode-method-installation)
- [Source code compilation installation](#source-code-compilation-installation)
- [Binaries](#binaries)
- [From Source](#from-source)
- [Docker Image](#docker-image)
- [Quickstart](#quickstart)
- [Docs](#docs)
@ -25,13 +16,9 @@
- [Governance](#governance)
- [Communication](#communication)
- [Contributing](#contributing)
- [Maintenance phases](#maintenance-phases)
- [Maintenance status](#maintenance-status)
- [Release Notes](#release-notes)
- [License](#license)
<!-- /TOC -->
## What Is MindSpore
MindSpore is a new open source deep learning training/inference framework that
@ -42,22 +29,23 @@ processor, and software hardware co-optimization. At the meantime MindSpore as
a global AI open source community, aims to further advance the development and
enrichment of the AI software/hardware application ecosystem.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/MindSpore-architecture.png" alt="MindSpore Architecture"/>
<img src="docs/MindSpore-architecture.png" alt="MindSpore Architecture" width="600"/>
For more details please check out our [Architecture Guide](https://www.mindspore.cn/docs/programming_guide/en/master/architecture.html).
For more details please check out our [Architecture Guide](https://www.mindspore.cn/docs/en/master/architecture.html).
### Automatic Differentiation
Currently, there are two automatic differentiation techniques in mainstream deep learning frameworks:
There are currently three automatic differentiation techniques in mainstream deep learning frameworks:
- **Operator Overloading (OO)**: Overloading the basic operators of the programming language to encapsulate their gradient rules. Record the operation trajectory of the network during forward execution in an operator overloaded manner, then apply the chain rule to the dynamically generated data flow graph to implement automatic differentiation.
- **Source Transformation (ST)**: This technology is evolving from the functional programming framework and performs automatic differential transformation on the intermediate expression (the expression form of the program during the compilation process) in the form of just-in-time compilation (JIT), supporting complex control flow scenarios, higher-order functions and closures.
- **Conversion based on static compute graph**: Convert the network into a static data flow graph at compile time, then turn the chain rule into a data flow graph to implement automatic differentiation.
- **Conversion based on dynamic compute graph**: Record the operation trajectory of the network during forward execution in an operator overloaded manner, then apply the chain rule to the dynamically generated data flow graph to implement automatic differentiation.
- **Conversion based on source code**: This technology is evolving from the functional programming framework and performs automatic differential transformation on the intermediate expression (the expression form of the program during the compilation process) in the form of just-in-time compilation (JIT), supporting complex control flow scenarios, higher-order functions and closures.
PyTorch used OO. Compared to ST, OO generates gradient graph in runtime, so it does not need to take function call and control flow into consideration, which makes it easier to develop. However, OO can not perform gradient graph optimization in compilation time and the control flow has to be unfolded in runtime, so it is difficult to achieve extreme optimization in performance.
TensorFlow adopted static calculation diagrams in the early days, whereas PyTorch used dynamic calculation diagrams. Static maps can utilize static compilation technology to optimize network performance, however, building a network or debugging it is very complicated. The use of dynamic graphics is very convenient, but it is difficult to achieve extreme optimization in performance.
MindSpore implemented automatic differentiation based on ST. On the one hand, it supports automatic differentiation of automatic control flow, so it is quite convenient to build models like PyTorch. On the other hand, MindSpore can perform static compilation optimization on neural networks to achieve great performance.
But MindSpore finds another way, automatic differentiation based on source code conversion. On the one hand, it supports automatic differentiation of automatic control flow, so it is quite convenient to build models like PyTorch. On the other hand, MindSpore can perform static compilation optimization on neural networks to achieve great performance.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-differentiation.png" alt="Automatic Differentiation" width="600"/>
<img src="docs/Automatic-differentiation.png" alt="Automatic Differentiation" width="600"/>
The implementation of MindSpore automatic differentiation can be understood as the symbolic differentiation of the program itself. Because MindSpore IR is a functional intermediate expression, it has an intuitive correspondence with the composite function in basic algebra. The derivation formula of the composite function composed of arbitrary basic functions can be derived. Each primitive operation in MindSpore IR can correspond to the basic functions in basic algebra, which can build more complex flow control.
@ -65,13 +53,13 @@ The implementation of MindSpore automatic differentiation can be understood as t
The goal of MindSpore automatic parallel is to build a training method that combines data parallelism, model parallelism, and hybrid parallelism. It can automatically select a least cost model splitting strategy to achieve automatic distributed parallel training.
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-parallel.png" alt="Automatic Parallel" width="600"/>
<img src="docs/Automatic-parallel.png" alt="Automatic Parallel" width="600"/>
At present, MindSpore uses a fine-grained parallel strategy of splitting operators, that is, each operator in the figure is split into a cluster to complete parallel operations. The splitting strategy during this period may be very complicated, but as a developer advocating Pythonic, you don't need to care about the underlying implementation, as long as the top-level API compute is efficient.
At present, MindSpore uses a fine-grained parallel strategy of splitting operators, that is, each operator in the figure is splitted into a cluster to complete parallel operations. The splitting strategy during this period may be very complicated, but as a developer advocating Pythonic, you don't need to care about the underlying implementation, as long as the top-level API compute is efficient.
## Installation
### Pip mode method installation
### Binaries
MindSpore offers build options across multiple backends:
@ -79,9 +67,8 @@ MindSpore offers build options across multiple backends:
| :---------------- | :--------------- | :----- |
| Ascend910 | Ubuntu-x86 | ✔️ |
| | Ubuntu-aarch64 | ✔️ |
| | EulerOS-x86 | ✔️ |
| | EulerOS-aarch64 | ✔️ |
| | CentOS-x86 | ✔️ |
| | CentOS-aarch64 | ✔️ |
| GPU CUDA 10.1 | Ubuntu-x86 | ✔️ |
| CPU | Ubuntu-x86 | ✔️ |
| | Ubuntu-aarch64 | ✔️ |
@ -91,8 +78,8 @@ For installation using `pip`, take `CPU` and `Ubuntu-x86` build version as an ex
1. Download whl from [MindSpore download page](https://www.mindspore.cn/versions/en), and install the package.
```bash
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0-rc1/MindSpore/cpu/ubuntu_x86/mindspore-1.2.0rc1-cp37-cp37m-linux_x86_64.whl
```
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.7.0-beta/MindSpore/cpu/ubuntu_x86/mindspore-0.7.0-cp37-cp37m-linux_x86_64.whl
```
2. Run the following command to verify the install.
@ -120,24 +107,13 @@ For installation using `pip`, take `CPU` and `Ubuntu-x86` build version as an ex
mul = Mul()
print(mul(x, y))
```
```text
```
[ 4. 10. 18.]
```
Use pip mode method to install MindSpore in different environments. Refer to the following documents.
### From Source
- [Using pip mode method to install MindSpore in Ascend environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_ascend_install_pip_en.md)
- [Using pip mode method to install MindSpore in GPU environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_gpu_install_pip_en.md)
- [Using pip mode method to install MindSpore in CPU environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_cpu_install_pip_en.md)
### Source code compilation installation
Use the source code compilation method to install MindSpore in different environments. Refer to the following documents.
- [Using the source code compilation method to install MindSpore in Ascend environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_ascend_install_source_en.md)
- [Using the source code compilation method to install MindSpore in GPU environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_gpu_install_source_en.md)
- [Using the source code compilation method to install MindSpore in CPU environment](https://gitee.com/mindspore/docs/blob/master/install/mindspore_cpu_install_source_en.md)
[Install MindSpore](https://www.mindspore.cn/install/en).
### Docker Image
@ -147,28 +123,27 @@ currently the containerized build options are supported as follows:
| Hardware Platform | Docker Image Repository | Tag | Description |
| :---------------- | :---------------------- | :-- | :---------- |
| CPU | `mindspore/mindspore-cpu` | `x.y.z` | Production environment with pre-installed MindSpore `x.y.z` CPU release. |
| | | `devel` | Development environment provided to build MindSpore (with `CPU` backend) from the source, refer to <https://www.mindspore.cn/install/en> for installation details. |
| | | `devel` | Development environment provided to build MindSpore (with `CPU` backend) from the source, refer to https://www.mindspore.cn/install/en for installation details. |
| | | `runtime` | Runtime environment provided to install MindSpore binary package with `CPU` backend. |
| GPU | `mindspore/mindspore-gpu` | `x.y.z` | Production environment with pre-installed MindSpore `x.y.z` GPU release. |
| | | `devel` | Development environment provided to build MindSpore (with `GPU CUDA10.1` backend) from the source, refer to <https://www.mindspore.cn/install/en> for installation details. |
| | | `devel` | Development environment provided to build MindSpore (with `GPU CUDA10.1` backend) from the source, refer to https://www.mindspore.cn/install/en for installation details. |
| | | `runtime` | Runtime environment provided to install MindSpore binary package with `GPU CUDA10.1` backend. |
| Ascend | <center>&mdash;</center> | <center>&mdash;</center> | Coming soon. |
> **NOTICE:** For GPU `devel` docker image, it's NOT suggested to directly install the whl package after building from the source, instead we strongly RECOMMEND you transfer and install the whl package inside GPU `runtime` docker image.
- CPU
* CPU
For `CPU` backend, you can directly pull and run the latest stable image using the below command:
```bash
docker pull mindspore/mindspore-cpu:1.1.0
docker run -it mindspore/mindspore-cpu:1.1.0 /bin/bash
```
docker pull mindspore/mindspore-cpu:0.7.0-beta
docker run -it mindspore/mindspore-cpu:0.7.0-beta /bin/bash
```
- GPU
* GPU
For `GPU` backend, please make sure the `nvidia-container-toolkit` has been installed in advance, here are some install guidelines for `Ubuntu` users:
```bash
```
DISTRIBUTION=$(. /etc/os-release; echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$DISTRIBUTION/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list
@ -176,10 +151,8 @@ currently the containerized build options are supported as follows:
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit nvidia-docker2
sudo systemctl restart docker
```
Then edit the file daemon.json:
```bash
```
$ vim /etc/docker/daemon.json
{
"runtimes": {
@ -190,37 +163,31 @@ currently the containerized build options are supported as follows:
}
}
```
Restart docker again:
```bash
```
sudo systemctl daemon-reload
sudo systemctl restart docker
```
Then you can pull and run the latest stable image using the below command:
```bash
docker pull mindspore/mindspore-gpu:1.1.0
docker run -it -v /dev/shm:/dev/shm --runtime=nvidia --privileged=true mindspore/mindspore-gpu:1.1.0 /bin/bash
```
docker pull mindspore/mindspore-gpu:0.7.0-beta
docker run -it --runtime=nvidia --privileged=true mindspore/mindspore-gpu:0.7.0-beta /bin/bash
```
To test if the docker image works, please execute the python code below and check the output:
```python
import numpy as np
import mindspore.context as context
from mindspore import Tensor
from mindspore.ops import functional as F
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
context.set_context(device_target="GPU")
x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
print(F.tensor_add(x, y))
```
```text
```
[[[ 2. 2. 2. 2.],
[ 2. 2. 2. 2.],
[ 2. 2. 2. 2.]],
@ -235,11 +202,11 @@ currently the containerized build options are supported as follows:
```
If you want to learn more about the building process of MindSpore docker images,
please check out [docker](https://gitee.com/mindspore/mindspore/blob/master/scripts/docker/README.md) repo for the details.
please check out [docker](docker/README.md) repo for the details.
## Quickstart
See the [Quick Start](https://www.mindspore.cn/tutorials/en/master/beginner/quick_start.html)
See the [Quick Start](https://www.mindspore.cn/tutorial/en/master/quick_start/quick_start.html)
to implement the image classification.
## Docs
@ -262,43 +229,13 @@ Check out how MindSpore Open Governance [works](https://gitee.com/mindspore/comm
## Contributing
Welcome contributions. See our [Contributor Wiki](https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md) for
Welcome contributions. See our [Contributor Wiki](CONTRIBUTING.md) for
more details.
## Maintenance phases
Project stable branches will be in one of the following states:
| **State** | **Time frame** | **Summary** |
|-------------|---------------|--------------------------------------------------|
| Planning | 1 - 3 months | Features are under planning. |
| Development | 3 months | Features are under development. |
| Maintained | 6 - 12 months | All bugfixes are appropriate. Releases produced. |
| Unmaintained| 0 - 3 months | All bugfixes are appropriate. No Maintainers and No Releases produced. |
| End Of Life (EOL) | N/A | Branch no longer accepting changes. |
## Maintenance status
| **Branch** | **Status** | **Initial Release Date** | **Next Phase** | **EOL Date**|
|------------|--------------|--------------------------|----------------------------------------|-------------|
| **r1.6** | Maintained | 2022-01-29 | Unmaintained <br> 2023-01-29 estimated | |
| **r1.5** | Maintained | 2021-10-15 | Unmaintained <br> 2022-10-15 estimated | |
| **r1.4** | Maintained | 2021-08-15 | Unmaintained <br> 2022-08-15 estimated | |
| **r1.3** | Maintained | 2021-07-15 | Unmaintained <br> 2022-07-15 estimated | |
| **r1.2** | Unmaintained | 2021-04-15 | End Of Life <br> 2022-04-15 estimated | |
| **r1.1** | End Of Life | 2020-12-31 | | 2021-09-30 |
| **r1.0** | End Of Life | 2020-09-24 | | 2021-07-30 |
| **r0.7** | End Of Life | 2020-08-31 | | 2021-02-28 |
| **r0.6** | End Of Life | 2020-07-31 | | 2020-12-30 |
| **r0.5** | End Of Life | 2020-06-30 | | 2021-06-30 |
| **r0.3** | End Of Life | 2020-05-31 | | 2020-09-30 |
| **r0.2** | End Of Life | 2020-04-30 | | 2020-08-31 |
| **r0.1** | End Of Life | 2020-03-28 | | 2020-06-30 |
## Release Notes
The release notes, see our [RELEASE](https://gitee.com/mindspore/mindspore/blob/master/RELEASE.md).
The release notes, see our [RELEASE](RELEASE.md).
## License
[Apache License 2.0](https://gitee.com/mindspore/mindspore#/mindspore/mindspore/blob/master/LICENSE)
[Apache License 2.0](LICENSE)

View File

@ -1,23 +1,14 @@
![MindSpore标志](https://gitee.com/mindspore/mindspore/raw/master/docs/MindSpore-logo.png "MindSpore logo")
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mindspore.svg)](https://pypi.org/project/mindspore)
[![PyPI](https://badge.fury.io/py/mindspore.svg)](https://badge.fury.io/py/mindspore)
[![Downloads](https://pepy.tech/badge/mindspore)](https://pepy.tech/project/mindspore)
[![DockerHub](https://img.shields.io/docker/pulls/mindspore/mindspore-cpu.svg)](https://hub.docker.com/r/mindspore/mindspore-cpu)
[![LICENSE](https://img.shields.io/github/license/mindspore-ai/mindspore.svg?style=flat-square)](https://github.com/mindspore-ai/mindspore/blob/master/LICENSE)
[![Slack](https://img.shields.io/badge/slack-chat-green.svg?logo=slack)](https://join.slack.com/t/mindspore/shared_invite/zt-dgk65rli-3ex4xvS4wHX7UDmsQmfu8w)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://gitee.com/mindspore/mindspore/pulls)
![MindSpore标志](docs/MindSpore-logo.png "MindSpore logo")
============================================================
[View English](./README.md)
<!-- TOC -->
- [MindSpore介绍](#mindspore介绍)
- [自动微分](#自动微分)
- [自动并行](#自动并行)
- [安装](#安装)
- [pip方式安装](#pip方式安装)
- [码编译方式安装](#码编译方式安装)
- [二进制文件](#二进制文件)
- [源](#源)
- [Docker镜像](#docker镜像)
- [快速入门](#快速入门)
- [文档](#文档)
@ -25,36 +16,36 @@
- [治理](#治理)
- [交流](#交流)
- [贡献](#贡献)
- [分支维护策略](#分支维护策略)
- [现有分支维护状态](#现有分支维护状态)
- [版本说明](#版本说明)
- [许可证](#许可证)
<!-- /TOC -->
## MindSpore介绍
MindSpore是一种适用于端边云场景的新型开源深度学习训练/推理框架。
MindSpore提供了友好的设计和高效的执行旨在提升数据科学家和算法工程师的开发体验并为Ascend AI处理器提供原生支持以及软硬件协同优化。
同时MindSpore作为全球AI开源社区致力于进一步开发和丰富AI软硬件应用生态。
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/MindSpore-architecture-zh.png" alt="MindSpore Architecture"/>
欲了解更多详情,请查看我们的[总体架构](https://www.mindspore.cn/docs/programming_guide/zh-CN/master/architecture.html)。
<img src="docs/MindSpore-architecture.png" alt="MindSpore Architecture" width="600"/>
欲了解更多详情,请查看我们的[总体架构](https://www.mindspore.cn/docs/zh-CN/master/architecture.html)。
### 自动微分
当前主流深度学习框架中有种自动微分技术:
当前主流深度学习框架中有种自动微分技术:
- **操作符重载法** 通过操作符重载对编程语言中的基本操作语义进行重定义,封装其微分规则。 在程序运行时记录算子过载正向执行时网络的运行轨迹,对动态生成的数据流图应用链式法则,实现自动微分。
- **代码变换法** 该技术是从功能编程框架演进而来以即时编译Just-in-time CompilationJIT的形式对中间表达式程序在编译过程中的表达式进行自动差分转换支持复杂的控制流场景、高阶函数和闭包。
- **基于静态计算图的转换**:编译时将网络转换为静态数据流图,将链式法则应用于数据流图,实现自动微分。
- **基于动态计算图的转换**:记录算子过载正向执行时网络的运行轨迹,对动态生成的数据流图应用链式法则,实现自动微分。
- **基于源码的转换**该技术是从功能编程框架演进而来以即时编译Just-in-time CompilationJIT的形式对中间表达式程序在编译过程中的表达式进行自动差分转换支持复杂的控制流场景、高阶函数和闭包。
PyTorch采用的是操作符重载法。相较于代码变换法操作符重载法是在运行时生成微分计算图的 无需考虑函数调用与控制流等情况, 开发更为简单。 但该方法不能在编译时刻做微分图的优化, 控制流也需要根据运行时的信息来展开, 很难实现性能的极限优化。
TensorFlow早期采用的是静态计算图PyTorch采用的是动态计算图。静态映射可以利用静态编译技术来优化网络性能但是构建网络或调试网络非常复杂。动态图的使用非常方便很难实现性能的极限优化。
MindSpore则采用的是代码变换法。一方面它支持自动控制流的自动微分因此像PyTorch这样的模型构建非常方便。另一方面MindSpore可以对神经网络进行静态编译优化以获得更好的性能。
MindSpore找到了另一种方法,即基于源代码转换的自动微分。一方面它支持自动控制流的自动微分因此像PyTorch这样的模型构建非常方便。另一方面MindSpore可以对神经网络进行静态编译优化以获得更好的性能。
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-differentiation.png" alt="Automatic Differentiation" width="600"/>
<img src="docs/Automatic-differentiation.png" alt="Automatic Differentiation" width="600"/>
MindSpore自动微分的实现可以理解为程序本身的符号微分。MindSpore IR是一个函数中间表达式它与基础代数中的复合函数具有直观的对应关系。复合函数的公式由任意可推导的基础函数组成。MindSpore IR中的每个原语操作都可以对应基础代数中的基本功能从而可以建立更复杂的流控制。
@ -62,23 +53,22 @@ MindSpore自动微分的实现可以理解为程序本身的符号微分。MindS
MindSpore自动并行的目的是构建数据并行、模型并行和混合并行相结合的训练方法。该方法能够自动选择开销最小的模型切分策略实现自动分布并行训练。
<img src="https://gitee.com/mindspore/mindspore/raw/master/docs/Automatic-parallel.png" alt="Automatic Parallel" width="600"/>
<img src="docs/Automatic-parallel.png" alt="Automatic Parallel" width="600"/>
目前MindSpore采用的是算子切分的细粒度并行策略即图中的每个算子被切分为一个集群完成并行操作。在此期间的切分策略可能非常复杂但是作为一名Python开发者您无需关注底层实现只要顶层API计算是有效的即可。
## 安装
### pip方式安装
### 二进制文件
MindSpore提供跨多个后端的构建选项
| 硬件平台 | 操作系统 | 状态 |
| 硬件平台 | 操作系统 | 状态 |
| :------------ | :-------------- | :--- |
| Ascend 910 | Ubuntu-x86 | ✔️ |
| | Ubuntu-aarch64 | ✔️ |
| | EulerOS-x86 | ✔️ |
| | EulerOS-aarch64 | ✔️ |
| | CentOS-x86 | ✔️ |
| | CentOS-aarch64 | ✔️ |
| GPU CUDA 10.1 | Ubuntu-x86 | ✔️ |
| CPU | Ubuntu-x86 | ✔️ |
| | Ubuntu-aarch64 | ✔️ |
@ -88,8 +78,8 @@ MindSpore提供跨多个后端的构建选项
1. 请从[MindSpore下载页面](https://www.mindspore.cn/versions)下载并安装whl包。
```bash
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.0-rc1/MindSpore/cpu/ubuntu_x86/mindspore-1.2.0rc1-cp37-cp37m-linux_x86_64.whl
```
pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/0.7.0-beta/MindSpore/cpu/ubuntu_x86/mindspore-0.7.0-cp37-cp37m-linux_x86_64.whl
```
2. 执行以下命令,验证安装结果。
@ -100,41 +90,29 @@ MindSpore提供跨多个后端的构建选项
import mindspore.nn as nn
from mindspore import Tensor
from mindspore.ops import operations as P
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
class Mul(nn.Cell):
def __init__(self):
super(Mul, self).__init__()
self.mul = P.Mul()
def construct(self, x, y):
return self.mul(x, y)
x = Tensor(np.array([1.0, 2.0, 3.0]).astype(np.float32))
y = Tensor(np.array([4.0, 5.0, 6.0]).astype(np.float32))
mul = Mul()
print(mul(x, y))
```
```text
```
[ 4. 10. 18.]
```
### 来源
使用pip方式在不同的环境安装MindSpore可参考以下文档。
- [Ascend环境使用pip方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_ascend_install_pip.md)
- [GPU环境使用pip方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_gpu_install_pip.md)
- [CPU环境使用pip方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_cpu_install_pip.md)
### 源码编译方式安装
使用源码编译方式在不同的环境安装MindSpore可参考以下文档。
- [Ascend环境使用源码编译方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_ascend_install_source.md)
- [GPU环境使用源码编译方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_gpu_install_source.md)
- [CPU环境使用源码编译方式安装MindSpore](https://gitee.com/mindspore/docs/blob/master/install/mindspore_cpu_install_source.md)
[MindSpore安装](https://www.mindspore.cn/install)。
### Docker镜像
@ -144,28 +122,27 @@ MindSpore的Docker镜像托管在[Docker Hub](https://hub.docker.com/r/mindspore
| 硬件平台 | Docker镜像仓库 | 标签 | 说明 |
| :----- | :------------------------ | :----------------------- | :--------------------------------------- |
| CPU | `mindspore/mindspore-cpu` | `x.y.z` | 已经预安装MindSpore `x.y.z` CPU版本的生产环境。 |
| | | `devel` | 提供开发环境从源头构建MindSpore`CPU`后端)。安装详情请参考<https://www.mindspore.cn/install> 。 |
| | | `devel` | 提供开发环境从源头构建MindSpore`CPU`后端。安装详情请参考https://www.mindspore.cn/install 。 |
| | | `runtime` | 提供运行时环境安装MindSpore二进制包`CPU`后端)。 |
| GPU | `mindspore/mindspore-gpu` | `x.y.z` | 已经预安装MindSpore `x.y.z` GPU版本的生产环境。 |
| | | `devel` | 提供开发环境从源头构建MindSpore`GPU CUDA10.1`后端)。安装详情请参考<https://www.mindspore.cn/install> 。 |
| | | `devel` | 提供开发环境从源头构建MindSpore`GPU CUDA10.1`后端。安装详情请参考https://www.mindspore.cn/install 。 |
| | | `runtime` | 提供运行时环境安装MindSpore二进制包`GPU CUDA10.1`后端)。 |
| Ascend | <center>&mdash;</center> | <center>&mdash;</center> | 即将推出,敬请期待。 |
> **注意:** 不建议从源头构建GPU `devel` Docker镜像后直接安装whl包。我们强烈建议您在GPU `runtime` Docker镜像中传输并安装whl包。
- CPU
* CPU
对于`CPU`后端,可以直接使用以下命令获取并运行最新的稳定镜像:
```bash
docker pull mindspore/mindspore-cpu:1.1.0
docker run -it mindspore/mindspore-cpu:1.1.0 /bin/bash
```
docker pull mindspore/mindspore-cpu:0.7.0-beta
docker run -it mindspore/mindspore-cpu:0.7.0-beta /bin/bash
```
- GPU
* GPU
对于`GPU`后端,请确保`nvidia-container-toolkit`已经提前安装,以下是`Ubuntu`用户安装指南:
```bash
```
DISTRIBUTION=$(. /etc/os-release; echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$DISTRIBUTION/nvidia-docker.list | tee /etc/apt/sources.list.d/nvidia-docker.list
@ -173,10 +150,8 @@ MindSpore的Docker镜像托管在[Docker Hub](https://hub.docker.com/r/mindspore
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit nvidia-docker2
sudo systemctl restart docker
```
编辑文件 daemon.json:
```bash
```
$ vim /etc/docker/daemon.json
{
"runtimes": {
@ -187,37 +162,31 @@ MindSpore的Docker镜像托管在[Docker Hub](https://hub.docker.com/r/mindspore
}
}
```
再次重启docker:
```bash
```
sudo systemctl daemon-reload
sudo systemctl restart docker
```
使用以下命令获取并运行最新的稳定镜像:
```bash
docker pull mindspore/mindspore-gpu:1.1.0
docker run -it -v /dev/shm:/dev/shm --runtime=nvidia --privileged=true mindspore/mindspore-gpu:1.1.0 /bin/bash
```
docker pull mindspore/mindspore-gpu:0.7.0-beta
docker run -it --runtime=nvidia --privileged=true mindspore/mindspore-gpu:0.7.0-beta /bin/bash
```
要测试Docker是否正常工作请运行下面的Python代码并检查输出
```python
import numpy as np
import mindspore.context as context
from mindspore import Tensor
from mindspore.ops import functional as F
context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU")
context.set_context(device_target="GPU")
x = Tensor(np.ones([1,3,3,4]).astype(np.float32))
y = Tensor(np.ones([1,3,3,4]).astype(np.float32))
print(F.tensor_add(x, y))
```
```text
```
[[[ 2. 2. 2. 2.],
[ 2. 2. 2. 2.],
[ 2. 2. 2. 2.]],
@ -231,11 +200,12 @@ MindSpore的Docker镜像托管在[Docker Hub](https://hub.docker.com/r/mindspore
[ 2. 2. 2. 2.]]]
```
如果您想了解更多关于MindSpore Docker镜像的构建过程请查看[docker](https://gitee.com/mindspore/mindspore/blob/master/scripts/docker/README.md) repo了解详细信息。
如果您想了解更多关于MindSpore Docker镜像的构建过程请查看[docker](docker/README.md) repo了解详细信息。
## 快速入门
参考[快速入门](https://www.mindspore.cn/tutorials/zh-CN/master/beginner/quick_start.html)实现图片分类。
参考[快速入门](https://www.mindspore.cn/tutorial/zh-CN/master/quick_start/quick_start.html)实现图片分类。
## 文档
@ -256,42 +226,13 @@ MindSpore的Docker镜像托管在[Docker Hub](https://hub.docker.com/r/mindspore
## 贡献
欢迎参与贡献。更多详情,请参阅我们的[贡献者Wiki](https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md)。
欢迎参与贡献。更多详情,请参阅我们的[贡献者Wiki](CONTRIBUTING.md)。
## 分支维护策略
MindSpore的版本分支有以下几种维护阶段
| **状态** | **持续时间** | **说明** |
|-------------|---------------|--------------------------------------------------|
| Planning | 1 - 3 months | 特性规划。 |
| Development | 3 months | 特性开发。 |
| Maintained | 6 - 12 months | 允许所有问题修复的合入,并发布版本。 |
| Unmaintained| 0 - 3 months | 允许所有问题修复的合入,无专人维护,不再发布版本。 |
| End Of Life (EOL) | N/A | 不再接受修改合入该分支。 |
## 现有分支维护状态
| **分支名** | **当前状态** | **上线时间** | **后续状态** | **EOL 日期**|
|------------|--------------|----------------------|----------------------------------------|------------|
| **r1.6** | Maintained | 2022-01-29 | Unmaintained <br> 2023-01-29 estimated | |
| **r1.5** | Maintained | 2021-10-15 | Unmaintained <br> 2022-10-15 estimated | |
| **r1.4** | Maintained | 2021-08-15 | Unmaintained <br> 2022-08-15 estimated | |
| **r1.3** | Maintained | 2021-07-15 | Unmaintained <br> 2022-07-15 estimated | |
| **r1.2** | Unmaintained | 2021-04-15 | End Of Life <br> 2022-04-15 estimated | |
| **r1.1** | End Of Life | 2020-12-31 | | 2021-09-30 |
| **r1.0** | End Of Life | 2020-09-24 | | 2021-07-30 |
| **r0.7** | End Of Life | 2020-08-31 | | 2021-02-28 |
| **r0.6** | End Of Life | 2020-07-31 | | 2020-12-30 |
| **r0.5** | End Of Life | 2020-06-30 | | 2021-06-30 |
| **r0.3** | End Of Life | 2020-05-31 | | 2020-09-30 |
| **r0.2** | End Of Life | 2020-04-30 | | 2020-08-31 |
| **r0.1** | End Of Life | 2020-03-28 | | 2020-06-30 |
## 版本说明
版本说明请参阅[RELEASE](https://gitee.com/mindspore/mindspore/blob/master/RELEASE.md)。
版本说明请参阅[RELEASE](RELEASE.md)。
## 许可证
[Apache License 2.0](https://gitee.com/mindspore/mindspore#/mindspore/mindspore/blob/master/LICENSE)
[Apache License 2.0](LICENSE)

3592
RELEASE.md

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +1,14 @@
# Security for MindSpore training
## Security Risk Description
# Security Risk Description
1. When MindSpore is used for AI model training, if the user-defined computational graph structure (for example, Python code for generating the MindSpore computational graph) is provided by an untrusted third party, malicious code may exist and will be loaded and executed to attack the system.
2. Model files are stored in binary mode. When MindSpore is used to optimize or infer AI models and the model files are loaded in deserialization mode, once malicious code is written into the model files, the code are loaded and executed, causing attacks on the system.
3. MindSpore performs only model training and inference based on the data provided by users. Users need to protect data security to avoid privacy leakage.
4. MindSpore is a distributed training platform. When MindSpore is used for distributed training, if an Ascend chip is used for training, a device provides a secure transmission protocol for gradient fusion. If GPUs or other clusters are used for training, identity authentication and secure transmission are not provided.
## Security Usage Suggestions
# Security Usage Suggestions
1. Run MindSpore in the sandbox.
2. Run MindSpore as a non-root user.
3. Ensure that the source of a computational graph structure is trustworthy. Do not write code irrelevant to model training in the network structure definition.
4. Ensure that the source of a network model is trustworthy or enter secure network model parameters to prevent model parameters from being tampered with.
5. Ensure that GPU distributed training is performed on an isolated cluster network.
# Security for MindSpore Lite
## Security Risk Description
When run a model using MindSpore Lite, the value from the model will be read and used as the parameter or input of a operator, if the value read from the model is invalid, it may cause unexpected result. For example, if the invalid value is used as the offset of a vector, it may cause your app run into segmentation fault issue.
## Security Usage Suggestions
1. Make sure your model is well verified and protected.
2. The exception catching mechanism of C++ is an effective method to improve robustness of your app, consider adding code to catch exception when calling the MindSpore Lite API, as exception will be raised in some case such as the example mentioned in the risk description above.

File diff suppressed because it is too large Load Diff

2
akg

@ -1 +1 @@
Subproject commit 0ddab6d9cad4c4c9faf72585e5a52faf79f55e4d
Subproject commit 76a1ecf9da48fa463e25ad63c26281fb5867874d

160
build.bat
View File

@ -15,70 +15,118 @@
@echo off
@title mindspore_build
SET BASE_PATH=%CD%
SET BUILD_PATH=%BASE_PATH%/build
SET threads=8
SET ENABLE_GITEE=OFF
set VERSION_STR=''
for /f "tokens=1" %%a in (version.txt) do (set VERSION_STR=%%a)
ECHO %2%|FINDSTR "^[0-9][0-9]*$"
IF %errorlevel% == 0 (
SET threads=%2%
)
IF "%FROM_GITEE%" == "1" (
echo "DownLoad from gitee"
SET ENABLE_GITEE=ON
)
IF NOT EXIST "%BUILD_PATH%" (
SET BASEPATH=%CD%
IF NOT EXIST "%BASEPATH%/build" (
md "build"
)
cd %BUILD_PATH%
cd %BASEPATH%/build
set BUILD_PATH=%CD%
IF NOT EXIST "%BUILD_PATH%/mindspore" (
md "mindspore"
)
cd %BUILD_PATH%/mindspore
cd %CD%/mindspore
IF "%1%" == "lite" (
echo "======Start building MindSpore Lite %VERSION_STR%======"
rd /s /q "%BASE_PATH%\output"
(git log -1 | findstr "^commit") > %BUILD_PATH%\.commit_id
IF defined VisualStudioVersion (
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off -DVERSION_STR=%VERSION_STR% ^
-DCMAKE_BUILD_TYPE=Release -G "Ninja" "%BASE_PATH%/mindspore/lite"
call :gene_gtest
call :run_cmake
IF errorlevel 1 (
echo "cmake fail one time."
call :gene_protobuf
call :gene_flatbuffer
call :run_cmake
IF errorlevel 1 (
echo "cmake fail."
goto run_fail
)
) ELSE (
cmake -DMSLITE_MINDDATA_IMPLEMENT=off -DMSLITE_ENABLE_TRAIN=off -DVERSION_STR=%VERSION_STR% ^
-DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - MinGW Makefiles" "%BASE_PATH%/mindspore/lite"
call :gene_protobuf
call :gene_flatbuffer
)
cd %BUILD_PATH%/mindspore
IF "%2%" == "" (
cmake --build . --target package -- -j6
) ELSE (
cmake --build . --target package -- -j%2%
)
IF errorlevel 1 (
echo "build fail."
goto run_fail
) ELSE (
cd %BASEPATH%/output
rd /s /q _CPack_Packages
)
) ELSE (
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_GITEE=%ENABLE_GITEE% ^
-G "CodeBlocks - MinGW Makefiles" ../..
)
IF NOT %errorlevel% == 0 (
echo "cmake fail."
call :clean
EXIT /b 1
)
cmake --build . --target package -- -j%threads%
IF NOT %errorlevel% == 0 (
echo "build fail."
call :clean
EXIT /b 1
)
call :clean
EXIT /b 0
:clean
IF EXIST "%BASE_PATH%/output" (
cd %BASE_PATH%/output
if EXIST "%BASE_PATH%/output/_CPack_Packages" (
rd /s /q _CPack_Packages
)
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON ^
-G "CodeBlocks - MinGW Makefiles" ../..
IF NOT %errorlevel% == 0 (
echo "cmake fail."
goto run_fail
)
cd %BASE_PATH%
IF "%1%" == "" (
cmake --build . --target package -- -j6
) ELSE (
cmake --build . --target package -- -j%1%
)
IF NOT %errorlevel% == 0 (
echo "build fail."
goto run_fail
)
)
cd %BASEPATH%
goto run_eof
:run_cmake
cd %BUILD_PATH%/mindspore
cmake -DBUILD_DEVICE=on -DBUILD_CONVERTER=on -DPLATFORM_ARM64=off -DSUPPORT_TRAIN=off ^
-DCMAKE_BUILD_TYPE=Release -DSUPPORT_GPU=off -DBUILD_MINDDATA=off -DOFFLINE_COMPILE=off ^
-G "CodeBlocks - MinGW Makefiles" "%BASEPATH%/mindspore/lite"
GOTO:EOF
:gene_gtest
cd %BASEPATH%/third_party
IF EXIST googletest rd /s /q googletest
git submodule update --init --recursive googletest
cd %BUILD_PATH%/mindspore
GOTO:EOF
:gene_protobuf
SET PROTOC="%BASEPATH%/build/mindspore/_deps/protobuf-src/_build/protoc"
SET PROTO_SRC_DIR="%BASEPATH%/mindspore/lite/tools/converter/parser/caffe"
cd %PROTO_SRC_DIR%
%PROTOC% *.proto --proto_path=%PROTO_SRC_DIR% --cpp_out=%PROTO_SRC_DIR%
SET PROTO_SRC_DIR="%BASEPATH%/mindspore/lite/tools/converter/parser/onnx"
cd %PROTO_SRC_DIR%
%PROTOC% *.proto --proto_path=%PROTO_SRC_DIR% --cpp_out=%PROTO_SRC_DIR%
cd %BUILD_PATH%/mindspore
GOTO:EOF
:gene_flatbuffer
SET FLATC="%BASEPATH%/build/mindspore/_deps/flatbuffers-src/_build/flatc"
SET FLAT_DIR=%BASEPATH%/mindspore/lite/schema
cd %FLAT_DIR%
IF EXIST inner rd /s /q inner
md inner
%FLATC% -c -b *.fbs
%FLATC% -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "%FLAT_DIR%/inner" *.fbs
SET FLAT_DIR=%BASEPATH%/mindspore/lite/tools/converter/parser/tflite
cd %FLAT_DIR%
%FLATC% -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "%FLAT_DIR%" *.fbs
cd %BUILD_PATH%/mindspore
GOTO:EOF
:run_fail
cd %BASEPATH%
set errorlevel=1
:run_eof

645
build.sh
View File

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019-2021 Huawei Technologies Co., Ltd
# Copyright 2019 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.
@ -16,17 +16,51 @@
set -e
BASEPATH=$(cd "$(dirname $0)"; pwd)
export CUDA_PATH=""
CUDA_PATH=""
CUDNN_PATH=""
export BUILD_PATH="${BASEPATH}/build/"
source ./scripts/build/usage.sh
source ./scripts/build/default_options.sh
source ./scripts/build/option_proc_debug.sh
source ./scripts/build/option_proc_mindspore.sh
source ./scripts/build/option_proc_lite.sh
source ./scripts/build/process_options.sh
source ./scripts/build/parse_device.sh
source ./scripts/build/build_mindspore.sh
# print usage message
usage()
{
echo "Usage:"
echo "bash build.sh [-d] [-r] [-v] [-c on|off] [-t on|off] [-g on|off] [-h] [-b ge] [-m infer|train] \\"
echo " [-a on|off] [-Q on|off] [-p on|off] [-i] [-L] [-R] [-D on|off] [-j[n]] [-e gpu|d|cpu] \\"
echo " [-P on|off] [-z [on|off]] [-M on|off] [-V 9.2|10.1] [-I arm64|arm32|x86_64] [-K] \\"
echo " [-B on|off] [-w on|off] [-E] [-l on|off] [-n]"
echo ""
echo "Options:"
echo " -d Debug mode"
echo " -r Release mode, default mode"
echo " -v Display build command"
echo " -c Enable code coverage, default off"
echo " -t Run testcases, default on"
echo " -g Use glog to output log, default on"
echo " -h Print usage"
echo " -b Select other backend, available: \\"
echo " ge:graph engine"
echo " -m Select graph engine backend mode, available: infer, train, default is infer"
echo " -a Enable ASAN, default off"
echo " -p Enable pipeline profile, print to stdout, default off"
echo " -R Enable pipeline profile, record to json, default off"
echo " -i Enable increment building, default off"
echo " -L Enable load ANF-IR as input of 'infer', default off"
echo " -j[n] Set the threads when building (Default: -j8)"
echo " -e Use gpu, d or cpu"
echo " -P Enable dump anf graph to file in ProtoBuffer format, default on"
echo " -Q Enable dump memory, default off"
echo " -D Enable dumping of function graph ir, default on"
echo " -z Compile dataset & mindrecord, default on"
echo " -n Compile minddata lite"
echo " -M Enable MPI and NCCL for GPU training, gpu default on"
echo " -V Specify the minimum required cuda version, default CUDA 10.1"
echo " -I Enable compiling mindspore lite for arm64, arm32 or x86_64, default disable mindspore lite compiling"
echo " -K Compile with AKG, default on"
echo " -s Enable serving module, default off"
echo " -w Enable acl module, default off"
echo " -B Enable debugger, default off"
echo " -E Enable IBVERBS for parameter server, default off"
echo " -l Compile with python dependency, default on"
}
# check value of input is 'on' or 'off'
# usage: check_on_off arg_value arg_name
@ -39,20 +73,239 @@ check_on_off()
fi
}
update_submodule()
# check and set options
checkopts()
{
git submodule update --init graphengine
cd "${BASEPATH}/graphengine"
git submodule update --init metadef
cd "${BASEPATH}"
if [[ "X$ENABLE_AKG" = "Xon" ]]; then
if [[ "X$ENABLE_D" == "Xon" ]]; then
git submodule update --init akg
else
GIT_LFS_SKIP_SMUDGE=1 git submodule update --init akg
fi
fi
# Init default values of build options
THREAD_NUM=8
DEBUG_MODE="off"
VERBOSE=""
ENABLE_COVERAGE="off"
RUN_TESTCASES="off"
ENABLE_BACKEND=""
TRAIN_MODE="INFER"
ENABLE_ASAN="off"
ENABLE_PROFILE="off"
INC_BUILD="off"
ENABLE_LOAD_IR="off"
ENABLE_TIMELINE="off"
ENABLE_DUMP2PROTO="on"
ENABLE_DUMPE2E="off"
ENABLE_DUMP_IR="on"
COMPILE_MINDDATA="on"
COMPILE_MINDDATA_LITE="off"
ENABLE_MPI="off"
CUDA_VERSION="10.1"
COMPILE_LITE="off"
LITE_PLATFORM=""
SUPPORT_TRAIN="off"
USE_GLOG="on"
ENABLE_AKG="on"
ENABLE_SERVING="off"
ENABLE_ACL="off"
ENABLE_DEBUGGER="off"
ENABLE_IBVERBS="off"
ENABLE_PYTHON="on"
ENABLE_GPU="off"
# Process the options
while getopts 'drvj:c:t:hsb:a:g:p:ie:m:l:I:LRP:Q:D:zM:V:K:swB:EnT:' opt
do
OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]')
case "${opt}" in
d)
DEBUG_MODE="on"
;;
n)
COMPILE_MINDDATA_LITE="on"
;;
r)
DEBUG_MODE="off"
;;
v)
VERBOSE="VERBOSE=1"
;;
j)
THREAD_NUM=$OPTARG
;;
c)
check_on_off $OPTARG c
ENABLE_COVERAGE="$OPTARG"
;;
t)
check_on_off $OPTARG t
RUN_TESTCASES="$OPTARG"
;;
g)
check_on_off $OPTARG g
USE_GLOG="$OPTARG"
;;
h)
usage
exit 0
;;
b)
if [[ "X$OPTARG" != "Xge" && "X$OPTARG" != "Xcpu" ]]; then
echo "Invalid value ${OPTARG} for option -b"
usage
exit 1
fi
ENABLE_BACKEND=$(echo "$OPTARG" | tr '[a-z]' '[A-Z]')
if [[ "X$ENABLE_BACKEND" != "XCPU" ]]; then
ENABLE_CPU="on"
fi
;;
a)
check_on_off $OPTARG a
ENABLE_ASAN="$OPTARG"
;;
p)
check_on_off $OPTARG p
ENABLE_PROFILE="$OPTARG"
;;
l)
check_on_off $OPTARG l
ENABLE_PYTHON="$OPTARG"
;;
i)
INC_BUILD="on"
;;
m)
if [[ "X$OPTARG" != "Xinfer" && "X$OPTARG" != "Xtrain" ]]; then
echo "Invalid value ${OPTARG} for option -m"
usage
exit 1
fi
TRAIN_MODE=$(echo "$OPTARG" | tr '[a-z]' '[A-Z]')
;;
L)
ENABLE_LOAD_IR="on"
echo "build with enable load anf ir"
;;
R)
ENABLE_TIMELINE="on"
echo "enable time_line record"
;;
e)
if [[ "X$OPTARG" == "Xgpu" ]]; then
ENABLE_GPU="on"
ENABLE_CPU="on"
ENABLE_MPI="on"
elif [[ "X$OPTARG" == "Xd" || "X$OPTARG" == "Xascend" ]]; then
ENABLE_D="on"
ENABLE_CPU="on"
ENABLE_SERVING="on"
elif [[ "X$OPTARG" == "Xcpu" ]]; then
ENABLE_CPU="on"
else
echo "Invalid value ${OPTARG} for option -e"
usage
exit 1
fi
;;
M)
check_on_off $OPTARG M
ENABLE_MPI="$OPTARG"
;;
V)
if [[ "X$OPTARG" != "X9.2" && "X$OPTARG" != "X10.1" ]]; then
echo "Invalid value ${OPTARG} for option -V"
usage
exit 1
fi
if [[ "X$OPTARG" == "X9.2" ]]; then
echo "Unsupported CUDA version 9.2"
exit 1
fi
CUDA_VERSION="$OPTARG"
;;
P)
check_on_off $OPTARG p
ENABLE_DUMP2PROTO="$OPTARG"
echo "enable dump anf graph to proto file"
;;
Q)
check_on_off $OPTARG Q
ENABLE_DUMPE2E="$OPTARG"
echo "enable dump end to end"
;;
D)
check_on_off $OPTARG D
ENABLE_DUMP_IR="$OPTARG"
echo "enable dump function graph ir"
;;
z)
eval ARG=\$\{$OPTIND\}
if [[ -n $ARG && $ARG != -* ]]; then
OPTARG=$ARG
check_on_off $OPTARG z
OPTIND=$((OPTIND + 1))
else
OPTARG=""
fi
if [[ "X$OPTARG" == "Xoff" ]]; then
COMPILE_MINDDATA="off"
fi
;;
I)
COMPILE_LITE="on"
if [[ "$OPTARG" == "arm64" ]]; then
LITE_PLATFORM="arm64"
elif [[ "$OPTARG" == "arm32" ]]; then
LITE_PLATFORM="arm32"
elif [[ "$OPTARG" == "x86_64" ]]; then
ENABLE_CONVERTER="on"
LITE_PLATFORM="x86_64"
else
echo "-I parameter must be arm64、arm32 or x86_64"
exit 1
fi
;;
K)
ENABLE_AKG="on"
echo "enable compile with akg"
;;
s)
ENABLE_SERVING="on"
echo "enable serving"
;;
w)
ENABLE_SERVING="on"
echo "enable serving"
ENABLE_ACL="on"
echo "enable acl"
;;
B)
check_on_off $OPTARG B
ENABLE_DEBUGGER="on"
echo "enable debugger"
;;
E)
ENABLE_IBVERBS="on"
echo "enable IBVERBS for parameter server"
;;
T)
check_on_off $OPTARG T
SUPPORT_TRAIN=$OPTARG
echo "support train on device "
;;
*)
echo "Unknown option ${opt}!"
usage
exit 1
esac
done
}
checkopts "$@"
if [[ "X$ENABLE_GPU" = "Xon" ]] && [[ "X$ENABLE_DUMPE2E" = "Xon" ]]; then
ENABLE_DEBUGGER="on"
fi
echo "---------------- MindSpore: build start ----------------"
mkdir -pv "${BUILD_PATH}/package/mindspore/lib"
git submodule update --init graphengine
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
git submodule update --init --recursive akg
fi
build_exit()
{
@ -61,39 +314,327 @@ build_exit()
exit 1
}
make_clean()
# Create building path
build_mindspore()
{
echo "enable make clean"
cd "${BUILD_PATH}/mindspore"
cmake --build . --target clean
echo "start build mindspore project."
mkdir -pv "${BUILD_PATH}/mindspore"
cd "${BUILD_PATH}/mindspore"
CMAKE_ARGS="-DDEBUG_MODE=$DEBUG_MODE -DBUILD_PATH=$BUILD_PATH"
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_LOAD_ANF_IR=$ENABLE_LOAD_IR"
if [[ "X$ENABLE_COVERAGE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_COVERAGE=ON"
fi
if [[ "X$RUN_TESTCASES" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_TESTCASES=ON"
fi
if [[ -n "$ENABLE_BACKEND" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_${ENABLE_BACKEND}=ON"
fi
if [[ -n "$TRAIN_MODE" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_${TRAIN_MODE}=ON"
fi
if [[ "X$ENABLE_ASAN" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_ASAN=ON"
fi
if [[ "X$ENABLE_PROFILE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_PROFILE=ON"
fi
if [[ "X$ENABLE_TIMELINE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_TIMELINE=ON"
fi
if [[ "X$ENABLE_DUMP2PROTO" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_DUMP_PROTO=ON"
fi
if [[ "X$ENABLE_DUMPE2E" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_DUMP_E2E=ON"
fi
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_DUMP_IR=${ENABLE_DUMP_IR}"
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_PYTHON=${ENABLE_PYTHON}"
if [[ "X$ENABLE_MPI" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_MPI=ON"
fi
if [[ "X$ENABLE_D" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_D=ON"
fi
if [[ "X$ENABLE_GPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GPU=ON -DUSE_CUDA=ON -DCUDA_PATH=$CUDA_PATH -DCUDNN_PATH=$CUDNN_PATH -DMS_REQUIRE_CUDA_VERSION=${CUDA_VERSION}"
fi
if [[ "X$ENABLE_CPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_CPU=ON"
fi
if [[ "X$COMPILE_MINDDATA" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_MINDDATA=ON"
fi
if [[ "X$USE_GLOG" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DUSE_GLOG=ON"
fi
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_AKG=ON"
fi
if [[ "X$ENABLE_SERVING" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_SERVING=ON"
fi
if [[ "X$ENABLE_ACL" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_ACL=ON"
fi
if [[ "X$ENABLE_DEBUGGER" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_DEBUGGER=ON"
fi
if [[ "X$ENABLE_IBVERBS" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_IBVERBS=ON"
fi
echo "${CMAKE_ARGS}"
if [[ "X$INC_BUILD" = "Xoff" ]]; then
cmake ${CMAKE_ARGS} ../..
fi
if [[ -n "$VERBOSE" ]]; then
CMAKE_VERBOSE="--verbose"
fi
cmake --build . --target package ${CMAKE_VERBOSE} -j$THREAD_NUM
echo "success building mindspore project!"
}
echo "---------------- MindSpore: build start ----------------"
init_default_options
process_options "$@"
parse_device
checkndk() {
if [ "${ANDROID_NDK}" ]; then
echo -e "\e[31mANDROID_NDK_PATH=$ANDROID_NDK \e[0m"
else
echo -e "\e[31mplease set ANDROID_NDK in environment variable for example: export ANDROID_NDK=/root/usr/android-ndk-r20b/ \e[0m"
exit 1
fi
}
gene_flatbuffer() {
FLAT_DIR="${BASEPATH}/mindspore/lite/schema"
cd ${FLAT_DIR} && rm -rf "${FLAT_DIR}/inner" && mkdir -p "${FLAT_DIR}/inner"
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/inner"
FLAT_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/tflite"
cd ${FLAT_DIR}
find . -name "*.fbs" -print0 | xargs -0 "${FLATC}" -c -b --reflect-types --gen-mutable --reflect-names --gen-object-api -o "${FLAT_DIR}/"
}
build_flatbuffer() {
cd ${BASEPATH}
FLATC="${BASEPATH}"/third_party/flatbuffers/build/flatc
if [[ ! -f "${FLATC}" ]]; then
git submodule update --init --recursive third_party/flatbuffers
cd ${BASEPATH}/third_party/flatbuffers
rm -rf build && mkdir -pv build && cd build && cmake .. && make -j$THREAD_NUM
gene_flatbuffer
fi
if [[ "${INC_BUILD}" == "off" ]]; then
gene_flatbuffer
fi
}
gene_protobuf() {
PROTO_SRC_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/caffe"
find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
PROTO_SRC_DIR="${BASEPATH}/mindspore/lite/tools/converter/parser/onnx"
find ${PROTO_SRC_DIR} -name "*.proto" -print0 | xargs -0 "${PROTOC}" -I"${PROTO_SRC_DIR}" --cpp_out="${PROTO_SRC_DIR}"
}
build_protobuf() {
cd ${BASEPATH}
PROTOC="${BASEPATH}"/third_party/protobuf/build/bin/protoc
if [[ ! -f "${PROTOC}" ]]; then
git submodule update --init --recursive third_party/protobuf
cd ${BASEPATH}/third_party/protobuf
rm -rf build && mkdir -pv build && ./autogen.sh
./configure --prefix=${BASEPATH}/third_party/protobuf/build
make clean && make -j$THREAD_NUM && make install
gene_protobuf
fi
if [[ "${INC_BUILD}" == "off" ]]; then
gene_protobuf
fi
}
build_gtest() {
cd ${BASEPATH}
git submodule update --init --recursive third_party/googletest
}
gene_clhpp() {
CL_SRC_DIR="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl"
if [ ! -d ${CL_SRC_DIR} ]; then
return
fi
cd ${CL_SRC_DIR}/
rm -rf *.inc
echo "$(cd "$(dirname $0)"; pwd)"
for file_path in "${CL_SRC_DIR}"/*
do
file="$(basename ${file_path})"
inc_file=`echo ${CL_SRC_DIR}/${file} | sed 's/$/.inc/'`
sed 's/^/\"/;s/$/ \\n\" \\/' ${CL_SRC_DIR}/${file} > ${inc_file}
kernel_name=`echo ${file} | sed s'/.\{3\}$//'`
sed -i "1i\static const char *${kernel_name}_source =\"\\n\" \\" ${inc_file}
sed -i '$a\;' ${inc_file}
done
}
gene_ocl_program() {
CL_SRC_DIR="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl"
SPIRV_DIR=build/spirv
rm -rf ${SPIRV_DIR}
mkdir -pv ${SPIRV_DIR}
if [ ! -d ${CL_SRC_DIR} ]; then
return
fi
for file_path in "${CL_SRC_DIR}"/*
do
file="$(basename ${file_path})"
if [ "${file##*.}" != "cl" ]; then
continue
fi
clang -Xclang -finclude-default-header -cl-std=CL2.0 --target=spir64-unknown-unknown -emit-llvm \
-c -O0 -o ${SPIRV_DIR}/${file%.*}.bc ${CL_SRC_DIR}/${file}
done
bcs=`ls ${SPIRV_DIR}/*.bc`
llvm-link ${bcs} -o ${SPIRV_DIR}/program.bc
llvm-spirv -o ${SPIRV_DIR}/program.spv ${SPIRV_DIR}/program.bc
CL_PROGRAM_PATH="${BASEPATH}/mindspore/lite/src/runtime/kernel/opencl/cl/program.inc"
echo "#include <vector>" > ${CL_PROGRAM_PATH}
echo "std::vector<unsigned char> g_program_binary = {" >> ${CL_PROGRAM_PATH}
#hexdump -v -e '16/1 "0x%02x, " "\n"' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
hexdump -v -e '1/1 "0x%02x, "' ${SPIRV_DIR}/program.spv >> ${CL_PROGRAM_PATH}
echo "};" >> ${CL_PROGRAM_PATH}
echo "Compile SPIRV done"
}
build_opencl() {
cd ${BASEPATH}
git submodule update --init third_party/OpenCL-Headers
git submodule update --init third_party/OpenCL-CLHPP
if [[ "${OPENCL_OFFLINE_COMPILE}" == "on" ]]; then
gene_ocl_program
else
gene_clhpp
fi
}
build_opencv() {
cd ${BASEPATH}
if [[ "${INC_BUILD}" == "off" ]]; then
git submodule update --init --recursive third_party/opencv
cd ${BASEPATH}/third_party/opencv
rm -rf build && mkdir -p build && cd build && cmake ${CMAKE_MINDDATA_ARGS} -DBUILD_SHARED_LIBS=ON -DBUILD_ANDROID_PROJECTS=OFF \
-DBUILD_LIST=core,imgcodecs,imgproc -DBUILD_ZLIB=ON .. && make -j$THREAD_NUM
fi
}
build_jpeg_turbo() {
cd ${BASEPATH}
if [[ "${INC_BUILD}" == "off" ]]; then
git submodule update --init --recursive third_party/libjpeg-turbo
cd ${BASEPATH}/third_party/libjpeg-turbo
rm -rf build && mkdir -p build && cd build && cmake ${CMAKE_MINDDATA_ARGS} -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${BASEPATH}/third_party/libjpeg-turbo" .. && make -j$THREAD_NUM && make install
fi
}
build_eigen() {
cd ${BASEPATH}
git submodule update --init --recursive third_party/eigen
}
build_minddata_lite_deps()
{
echo "start build minddata lite project"
if [[ "${LITE_PLATFORM}" == "arm64" ]]; then
CMAKE_MINDDATA_ARGS="-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=19 \
-DANDROID_NDK=${ANDROID_NDK} -DANDROID_ABI=arm64-v8a -DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang \
-DANDROID_STL=c++_shared -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
elif [[ "${LITE_PLATFORM}" == "arm32" ]]; then
CMAKE_MINDDATA_ARGS="-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=19 \
-DANDROID_NDK=${ANDROID_NDK} -DANDROID_ABI=armeabi-v7a -DANDROID_TOOLCHAIN_NAME=clang \
-DANDROID_STL=c++_shared -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
else
CMAKE_MINDDATA_ARGS="-DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
fi
build_opencv
build_eigen
build_jpeg_turbo
}
build_lite()
{
echo "start build mindspore lite project"
if [ "${ENABLE_GPU}" == "on" ] && [ "${LITE_PLATFORM}" == "arm64" ]; then
echo "start build opencl"
build_opencl
fi
if [[ "${LITE_PLATFORM}" == "x86_64" ]]; then
build_protobuf
fi
build_flatbuffer
build_gtest
if [ "${COMPILE_MINDDATA_LITE}" == "on" ]; then
build_minddata_lite_deps
fi
cd "${BASEPATH}/mindspore/lite"
if [[ "${INC_BUILD}" == "off" ]]; then
rm -rf build
fi
mkdir -pv build
cd build
BUILD_TYPE="Release"
if [[ "${DEBUG_MODE}" == "on" ]]; then
BUILD_TYPE="Debug"
fi
if [[ "${LITE_PLATFORM}" == "arm64" ]]; then
checkndk
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="arm64-v8a" -DANDROID_TOOLCHAIN_NAME="aarch64-linux-android-clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DBUILD_DEVICE=on -DPLATFORM_ARM64=on -DBUILD_CONVERTER=off -DENABLE_NEON=on -DENABLE_FP16="off" \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
-DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp "${BASEPATH}/mindspore/lite"
elif [[ "${LITE_PLATFORM}" == "arm32" ]]; then
checkndk
cmake -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" -DANDROID_NATIVE_API_LEVEL="19" \
-DANDROID_NDK="${ANDROID_NDK}" -DANDROID_ABI="armeabi-v7a" -DANDROID_TOOLCHAIN_NAME="clang" \
-DANDROID_STL="c++_shared" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_DEVICE=on -DPLATFORM_ARM32=on -DENABLE_NEON=on -DSUPPORT_TRAIN=${SUPPORT_TRAIN} -DBUILD_CONVERTER=off \
-DSUPPORT_GPU=${ENABLE_GPU} -DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
-DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp "${BASEPATH}/mindspore/lite"
else
cmake -DBUILD_DEVICE=on -DPLATFORM_ARM64=off -DBUILD_CONVERTER=${ENABLE_CONVERTER} -DSUPPORT_TRAIN=${SUPPORT_TRAIN} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSUPPORT_GPU=${ENABLE_GPU} -DBUILD_MINDDATA=${COMPILE_MINDDATA_LITE} \
-DOFFLINE_COMPILE=${OPENCL_OFFLINE_COMPILE} -DCMAKE_INSTALL_PREFIX=${BASEPATH}/output/tmp "${BASEPATH}/mindspore/lite"
fi
VERBOSE=2 make -j$THREAD_NUM && make install && make package
COMPILE_RET=$?
if [[ "${COMPILE_RET}" -ne 0 ]]; then
echo "---------------- mindspore lite: build failed ----------------"
exit 1
else
mv ${BASEPATH}/output/tmp/*.tar.gz* ${BASEPATH}/output/
rm -rf ${BASEPATH}/output/tmp/
echo "---------------- mindspore lite: build success ----------------"
exit 0
fi
}
if [[ "X$COMPILE_LITE" = "Xon" ]]; then
export COMPILE_MINDDATA_LITE
export ENABLE_VERBOSE
export LITE_PLATFORM
export LITE_ENABLE_AAR
source mindspore/lite/build_lite.sh
build_lite
exit
else
mkdir -pv "${BUILD_PATH}/package/mindspore/lib"
update_submodule
build_mindspore
if [[ "X$ENABLE_MAKE_CLEAN" = "Xon" ]]; then
make_clean
fi
if [[ "X$ENABLE_ACL" == "Xon" ]] && [[ "X$ENABLE_D" == "Xoff" ]]; then
echo "acl mode, skipping deploy phase"
rm -rf ${BASEPATH}/output/_CPack_Packages/
else
cp -rf ${BUILD_PATH}/package/mindspore/lib ${BASEPATH}/mindspore/python/mindspore
cp -rf ${BUILD_PATH}/package/mindspore/*.so ${BASEPATH}/mindspore/python/mindspore
fi
build_mindspore
fi
echo "---------------- MindSpore: build end ----------------"
cp -rf ${BUILD_PATH}/package/mindspore/lib ${BUILD_PATH}/../mindspore
cp -rf ${BUILD_PATH}/package/mindspore/*.so ${BUILD_PATH}/../mindspore
echo "---------------- mindspore: build end ----------------"

View File

@ -1,10 +0,0 @@
approvers:
- zhoufeng54
- hangangqiang
- jpc_chenjianping
- tiancixiao
reviewers:
- nicholas_yhr
- liubuyu
- chengxb7532
- shenwei41

View File

@ -1,54 +0,0 @@
function(changerpath target_so target_name link_sos)
set(depend_so "")
foreach(link_so ${link_sos})
set(some-file "${CMAKE_SOURCE_DIR}/build/${target_name}_${link_so}.txt")
set(some-file1 "${CMAKE_SOURCE_DIR}/build/${target_name}_${link_so}1.txt")
set(some-file2 "${CMAKE_SOURCE_DIR}/build/${target_name}_${link_so}2.txt")
add_custom_command(
OUTPUT
${some-file}
COMMAND
otool -L ${target_so} | tail -n +2 | grep ${link_so} | head -n1 > ${some-file}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build"
VERBATIM
)
add_custom_command(
OUTPUT
${some-file1}
COMMAND
cat ${some-file} | cut -d " " -f 1 | sed -E "s/^.//g" > ${some-file1}
DEPENDS
${some-file}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build"
VERBATIM
)
add_custom_command(
OUTPUT
${some-file2}
COMMAND
awk -F "/" "{print $NF}" ${some-file1} > ${some-file2}
DEPENDS
${some-file1}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build"
VERBATIM
)
add_custom_target(
link_${target_name}_${link_so} ALL
COMMAND install_name_tool -change `cat ${some-file1}` @rpath/`cat ${some-file2}` ${target_so}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build"
DEPENDS ${target_so} ${some-file1} ${some-file2}
COMMENT "install tool name"
)
add_custom_command(
TARGET link_${target_name}_${link_so}
POST_BUILD
COMMAND rm ${some-file} ${some-file1} ${some-file2}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/build"
VERBATIM
)
if(depend_so)
add_dependencies(link_${target_name}_${link_so} link_${target_name}_${depend_so})
endif()
set(depend_so ${link_so})
endforeach()
endfunction()

View File

@ -1,141 +0,0 @@
## define customized find functions, print customized error messages
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.")
endif()
endfunction()
function(find_required_program prog_name)
find_program(${prog_name}_EXE ${prog_name})
if(NOT ${prog_name}_EXE)
message(FATAL_ERROR "Required program ${prog_name} not found, "
"please install the package and try building MindSpore again.")
endif()
endfunction()
## find python, quit if the found python is static
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(Python3_FIND_REGISTRY LAST)
set(Python3_FIND_STRATEGY LOCATION)
endif()
set(Python3_USE_STATIC_LIBS FALSE)
set(Python3_FIND_VIRTUALENV ONLY)
find_package(Python3 COMPONENTS Interpreter Development)
if(Python3_FOUND)
message("Python3 found, version: ${Python3_VERSION}")
message("Python3 library path: ${Python3_LIBRARY}")
message("Python3 interpreter: ${Python3_EXECUTABLE}")
elseif(Python3_LIBRARY AND Python3_EXECUTABLE AND
${Python3_VERSION} VERSION_GREATER_EQUAL "3.7.0" AND ${Python3_VERSION} VERSION_LESS "3.9.9")
message(WARNING "Maybe python3 environment is broken.")
message("Python3 library path: ${Python3_LIBRARY}")
message("Python3 interpreter: ${Python3_EXECUTABLE}")
else()
message(FATAL_ERROR "Python3 not found, please install Python>=3.7.5, and set --enable-shared "
"if you are building Python locally")
endif()
## packages used both on windows and linux
if(DEFINED ENV{MS_PATCH_PATH})
find_program(Patch_EXECUTABLE patch PATHS $ENV{MS_PATCH_PATH})
set(Patch_FOUND ${Patch_EXECUTABLE})
else()
find_package(Patch)
endif()
if(NOT Patch_FOUND)
message(FATAL_ERROR "Patch not found, "
"please set environment variable MS_PATCH_PATH to path where Patch is located, "
"usually found in GIT_PATH/usr/bin on Windows")
endif()
message(PATCH_EXECUTABLE = ${Patch_EXECUTABLE})
find_required_package(Threads)
# add openmp if the onednn use ms threadpool
if(USE_MS_THREADPOOL_FOR_DNNL)
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
else()
message(WARNING "OpenMP not found")
endif()
endif()
## packages used on Linux
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
if(ENABLE_MINDDATA)
find_required_program(tclsh)
endif()
## packages used in GPU mode only
if(ENABLE_GPU)
find_library(gmp_LIB gmp)
find_library(gmpxx_LIB gmpxx)
find_file(gmp_HEADER gmp.h)
if(NOT gmp_LIB OR NOT gmpxx_LIB OR NOT gmp_HEADER)
message(FATAL_ERROR "Required package gmp not found, please install gmp and try building MindSpore again.")
endif()
find_required_program(automake)
find_required_program(autoconf)
find_required_program(libtoolize)
find_required_package(FLEX)
endif()
endif()
# for macos, find appropriate macosx SDK then set SDKROOT and MACOSX_DEPLOYMENT_TARGET
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(NOT DEFINED ENV{SDKROOT})
# arm64: macosx11.x
# x86_64: macosx10.x, macosx11.x
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm64")
set(MACOSX_SDK_REGEX "MacOSX11(\\.\\d+)?")
else()
set(MACOSX_SDK_REGEX "MacOSX1[01](\\.\\d+)?")
endif()
set(MACOSX_XCODE_SDK_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs")
set(MACOSX_CLT_SDK_PATH "/Library/Developer/CommandLineTools/SDKs")
set(MACOSX_SDK_SEARCH_PATHS "${MACOSX_XCODE_SDK_PATH}/*" "${MACOSX_CLT_SDK_PATH}/*")
file(GLOB ALL_SDK_NAME ${MACOSX_SDK_SEARCH_PATHS})
# get highest SDK version meets the requirements
execute_process(
COMMAND bash -c "echo '${ALL_SDK_NAME}' | grep -Eo '${MACOSX_SDK_REGEX}' | sort -n | tail -1 | tr -d '\\n'"
OUTPUT_VARIABLE MACOSX_FIND_SDK_NAME
)
if(NOT MACOSX_FIND_SDK_NAME)
message(FATAL_ERROR
"can not find appropriate macosx SDK, find in ${ALL_SDK_NAME}, you may set SDKROOT manually"
)
endif()
if(IS_DIRECTORY "${MACOSX_XCODE_SDK_PATH}/${MACOSX_FIND_SDK_NAME}.sdk")
set(ENV{SDKROOT} "${MACOSX_XCODE_SDK_PATH}/${MACOSX_FIND_SDK_NAME}.sdk")
else()
set(ENV{SDKROOT} "${MACOSX_CLT_SDK_PATH}/${MACOSX_FIND_SDK_NAME}.sdk")
endif()
endif()
message("macosx sdkroot: $ENV{SDKROOT}")
# set macosx deployment target based on SDK
if(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
execute_process(
COMMAND bash -c "cat $ENV{SDKROOT}/SDKSettings.json | \
grep -Eo 'MACOSX_DEPLOYMENT_TARGET\\\":\\\"\\d{2}\\.\\d+' | cut -d '\"' -f 3 | tr -d '\\n'"
OUTPUT_VARIABLE MACOSX_FIND_SDK_VERSION
)
if(NOT MACOSX_FIND_SDK_VERSION)
message(FATAL_ERROR "can not find MACOSX_DEPLOYMENT_TARGET in SDKROOT, \
please check whether it's a valid SDK path")
endif()
if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
elseif(${MACOSX_FIND_SDK_VERSION} VERSION_LESS "10.15")
set(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOSX_FIND_SDK_VERSION} CACHE STRING
"minimum macosx deployment target version" FORCE)
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
endif()
endif()
message("macosx deployment target version: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()

View File

@ -1,48 +1,76 @@
message(STATUS "Compiling GraphEngine")
if(NOT(BUILD_LITE))
set(GE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/graphengine)
else()
set(GE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../graphengine)
endif()
message(STATUS "ENABLE_GE set to FALSE, compiling GraphEngine")
set(GE_SOURCE_DIR ${CMAKE_SOURCE_DIR}/graphengine)
message(STATUS "[ME] build_path: ${BUILD_PATH}")
message(STATUS "ge dir: ${GE_SOURCE_DIR}")
# download json headers, rather than whole repository
include(${GE_SOURCE_DIR}/cmake/ge_utils.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/json.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/eigen.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/gtest.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/protobuf.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/onnx.cmake)
include(${GE_SOURCE_DIR}/cmake/external_libs/securec.cmake)
function(find_submodule_lib module name path)
find_library(${module}_LIBRARY_DIR NAMES ${name} NAMES_PER_DIR PATHS ${path}
PATH_SUFFIXES lib
)
if("${${module}_LIBRARY_DIR}" STREQUAL "${module}_LIBRARY_DIR-NOTFOUND")
message(FATAL_ERROR "${name} not found in any of following paths: ${path}")
endif()
add_library(${module} SHARED IMPORTED)
set_target_properties(${module} PROPERTIES
IMPORTED_LOCATION ${${module}_LIBRARY_DIR}
)
endfunction()
function(ge_protobuf_generate c_var h_var)
common_protobuf_generate(${CMAKE_BINARY_DIR}/proto/ge/proto ${c_var} ${h_var} ${ARGN})
set(${c_var} ${${c_var}} PARENT_SCOPE)
set(${h_var} ${${h_var}} PARENT_SCOPE)
endfunction()
if(ENABLE_TESTCASES OR MODE_ASCEND_ALL OR MODE_ASCEND_ACL)
if(NOT(BUILD_LITE))
file(GLOB_RECURSE GE_PROTO_FILE RELATIVE ${CMAKE_SOURCE_DIR} "graphengine/metadef/proto/*.proto")
# for CPU/GPU mode, find slog from local prebuild
if (NOT ENABLE_D)
set(GE_PREBUILD_PATH ${GE_SOURCE_DIR}/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR})
find_library(slog libslog.so ${GE_PREBUILD_PATH})
find_library(error_manager liberror_manager.so ${GE_PREBUILD_PATH})
elseif (DEFINED ENV{D_LINK_PATH})
set(GE_LIB_PATH $ENV{D_LINK_PATH})
set(GE_SYS_ARCH "")
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
# x86 ubuntu
set(GE_SYS_ARCH "x86_64")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64")
# arm euleros
set(GE_SYS_ARCH "aarch64")
else()
file(GLOB_RECURSE GE_PROTO_FILE ${TOP_DIR}/graphengine/metadef/proto/*.proto)
message(FATAL_ERROR "Running on a unsupported architecture: ${SYSTEM_TYPE}, build terminated")
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(graph SHARED ${GE_PROTO_SRCS})
set(GE_LIB_PATH ${GE_LIB_PATH}/${GE_SYS_ARCH})
find_library(slog libslog.so ${GE_LIB_PATH})
find_library(mmpa libmmpa.so ${GE_LIB_PATH})
find_library(runtime libruntime.so ${GE_LIB_PATH})
find_library(msprof libmsprof.so ${GE_LIB_PATH})
find_library(register libregister.so ${GE_LIB_PATH})
find_library(hccl libhccl.so ${GE_LIB_PATH})
find_library(cce libcce.so ${GE_LIB_PATH})
find_library(resource libresource.so ${GE_LIB_PATH})
find_library(error_manager liberror_manager.so ${GE_LIB_PATH})
else()
message(FATAL_ERROR "No compile option defined for GraphEngine, exiting")
# Ascend mode
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
else()
set(ASCEND_PATH /usr/local/Ascend)
endif()
set(ASCEND_DRIVER_PATH ${ASCEND_PATH}/driver/lib64/common)
set(ASCEND_RUNTIME_PATH ${ASCEND_PATH}/fwkacllib/lib64)
find_library(c_sec libc_sec.so ${ASCEND_DRIVER_PATH})
find_library(slog libslog.so ${ASCEND_DRIVER_PATH})
find_library(mmpa libmmpa.so ${ASCEND_DRIVER_PATH})
find_library(cce libcce.so ${ASCEND_RUNTIME_PATH})
find_library(hccl libhccl.so ${ASCEND_RUNTIME_PATH})
find_library(runtime libruntime.so ${ASCEND_RUNTIME_PATH})
find_library(msprof libmsprof.so ${ASCEND_RUNTIME_PATH})
find_library(register libregister.so ${ASCEND_RUNTIME_PATH})
find_library(resource libresource.so ${ASCEND_RUNTIME_PATH})
find_library(error_manager liberror_manager.so ${ASCEND_RUNTIME_PATH})
endif()
# compile libraries from following directories
# this cmake file is called only when NOT ENABLE_GE is set
set(_ge_tmp_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
string(REPLACE " -Wall" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# force __FILE__ to show relative path of file, from source directory
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILE__='\"$(subst $(realpath ${CMAKE_SOURCE_DIR})/,,$(abspath $<))\"' -Wno-builtin-macro-redefined")
add_subdirectory(${GE_SOURCE_DIR}/src/common/graph)
if(ENABLE_D)
add_subdirectory(${GE_SOURCE_DIR}/src/ge/common)
add_subdirectory(${GE_SOURCE_DIR}/src/ge/ge_runtime)
endif()
set(CMAKE_CXX_FLAGS ${_ge_tmp_CMAKE_CXX_FLAGS})

View File

@ -4,7 +4,7 @@
# GTest_LIBRARY
#
if(NOT TARGET gtest)
if (NOT TARGET gtest)
set(BUILD_TESTING OFF CACHE BOOL "Disable glog test")
set(_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
@ -17,8 +17,7 @@ if(NOT TARGET gtest)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_CXX_FLAGS "${SECURE_CXX_FLAGS}")
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0"
AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND SYSTEM_TYPE MATCHES "euleros")
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND SYSTEM_TYPE MATCHES "euleros")
# -D_GLIBCXX_USE_CXX11_ABI=0 added for the ABI incompatible for libtsdclient.so
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()

View File

@ -3,7 +3,7 @@
#
# PROTOBUF_LIBRARY - Link this to use protobuf
#
if(NOT TARGET protobuf::libprotobuf)
if (NOT TARGET protobuf::libprotobuf)
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Disable protobuf test")
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Gen shared library")
set(_ms_tmp_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
@ -14,7 +14,7 @@ if(NOT TARGET protobuf::libprotobuf)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/protobuf/cmake ${CMAKE_BINARY_DIR}/protobuf)
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS})
endif()
endif ()
include_directories(${CMAKE_CURRENT_LIST_DIR}/../third_party/protobuf/src)
@ -47,7 +47,7 @@ function(ms_protobuf_generate c_var h_var)
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/${rel_path}"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file}
DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM )
endforeach()
set_source_files_properties(${${c_var}} ${${h_var}} PROPERTIES GENERATED TRUE)
@ -86,12 +86,10 @@ function(ms_protobuf_generate_py c_var h_var py_var)
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/${rel_path} ${abs_file}
COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/"
"${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py"
COMMAND cp "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py"
"${PROJECT_SOURCE_DIR}/mindspore/python/mindspore/train/"
COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py"
COMMAND cp "${CMAKE_BINARY_DIR}/${rel_path}/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/"
DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM )
endforeach()
set_source_files_properties(${${c_var}} ${${h_var}} ${${py_var}} PROPERTIES GENERATED TRUE)

View File

@ -4,16 +4,12 @@
# SECUREC_LIBRARY
#
if(NOT TARGET securec)
if (NOT TARGET securec)
set(_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
if(TARGET_OHOS_LITE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SECURE_CXX_FLAGS}")
else()
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_compile_definitions(SECUREC_ONLY_DECLARE_MEMSET)
endif()
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/securec ${CMAKE_BINARY_DIR}/securec)

View File

@ -1,47 +0,0 @@
# securec arm library
#
#
# SECUREC_ARM_LIBRARY
#
if(NOT TARGET securec_arm)
set(_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(_ms_tmp_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
if(TARGET_OHOS_LITE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SECURE_CXX_FLAGS}")
else()
set(CMAKE_C_FLAGS "${SECURE_CXX_FLAGS}")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
add_compile_definitions(SECUREC_ONLY_DECLARE_MEMSET)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ${_ms_tmp_CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_C_FLAGS ${_ms_tmp_CMAKE_C_FLAGS})
endif()
if(NOT MSVC)
SET(CMAKE_BUILD_TYPE "Debug")
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -fPIC -O0 -Wall -Wno-deprecated-declarations -g2 -ggdb \
-fno-inline-functions -fno-omit-frame-pointer -fstack-protector-all")
else()
SET(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -Wno-nullability-completeness -fPIC -O0 -Wall \
-Wno-deprecated-declarations -g2 -ggdb -fno-inline-functions -fno-omit-frame-pointer \
-fstack-protector-all -D_LIBCPP_INLINE_VISIBILITY='' -D'_LIBCPP_EXTERN_TEMPLATE(...)='")
endif()
SET(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -fPIC -O3 -Wall -Wno-deprecated-declarations -fstack-protector-all")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#add flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -Werror")
endif()
include_directories(${PROJECT_SOURCE_DIR}/third_party/securec/include)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
list(APPEND SECUREC_ARM_LIBRARY "memset_s.c")
else()
aux_source_directory(${PROJECT_SOURCE_DIR}/third_party/securec/src SECUREC_ARM_LIBRARY)
endif()
add_library(securec_arm STATIC ${SECUREC_ARM_LIBRARY})
set(SECUREC_ARM_LIBRARY securec_arm)

View File

@ -3,7 +3,7 @@
function(find_python_package out_inc out_lib)
# Use PYTHON_EXECUTABLE if it is defined, otherwise default to python
if("${PYTHON_EXECUTABLE}" STREQUAL "")
if ("${PYTHON_EXECUTABLE}" STREQUAL "")
set(PYTHON_EXECUTABLE "python3")
else()
set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}")
@ -15,10 +15,9 @@ function(find_python_package out_inc out_lib)
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; \
print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))"
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)
string(STRIP "${lib}" lib)

View File

@ -1,34 +1,9 @@
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "https://gitee.com/src-openeuler/abseil-cpp.git")
set(GIT_TAG "openEuler-22.03-LTS")
set(MD5 "06c9554d9f9776bb1a4b848ca206c0af")
set(ABSL_SRC "${TOP_DIR}/build/mindspore/_deps/absl-src")
__download_pkg_with_git(absl ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
execute_process(COMMAND tar -xf ${ABSL_SRC}/abseil-cpp-20210324.2.tar.gz --strip-components 1 -C ${ABSL_SRC})
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/abseil-cpp/repository/archive/20210324.2.tar.gz")
set(MD5 "e0b585398b89ee92a10d8c68ef7eed48")
else()
set(REQ_URL "https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz")
set(MD5 "e0b585398b89ee92a10d8c68ef7eed48")
endif()
endif()
if(NOT ENABLE_GLIBCXX)
set(absl_CXXFLAGS "${absl_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
mindspore_add_pkg(absl
VER 20210324.2
VER 20200225.2
LIBS absl_strings absl_throw_delegate absl_raw_logging_internal absl_int128 absl_bad_optional_access
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE
-DCMAKE_CXX_STANDARD=11
)
URL https://github.com/abseil/abseil-cpp/archive/20200225.2.tar.gz
MD5 73f2b6e72f1599a9139170c29482ddc4
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE)
include_directories(${absl_INC})

View File

@ -1,22 +1,12 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/c-ares/repository/archive/cares-1_15_0.tar.gz")
set(MD5 "459876e53724a2c87ed2876312b96aed")
else()
set(REQ_URL "https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz")
set(MD5 "d2391da274653f7643270623e822dff7")
endif()
mindspore_add_pkg(c-ares
VER 1.15.0
LIBS cares
URL ${REQ_URL}
MD5 ${MD5}
LIBS cares
URL https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz
MD5 d2391da274653f7643270623e822dff7
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release
-DCARES_SHARED:BOOL=OFF
-DCARES_STATIC:BOOL=ON
-DCARES_STATIC_PIC:BOOL=ON
-DHAVE_LIBNSL:BOOL=OFF
PATCHES ${TOP_DIR}/third_party/patch/c-ares/CVE-2021-3672.patch)
-DCARES_STATIC_PIC:BOOL=ON)
include_directories(${c-ares_INC})
add_library(mindspore::cares ALIAS c-ares::cares)

View File

@ -1,37 +0,0 @@
set(cmsis_pkg_name cmsis)
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/CMSIS_5/repository/archive/5.7.0.tar.gz")
set(MD5 "0eaa594b0c62dd72e41ec181c4689842")
else()
set(REQ_URL "https://github.com/ARM-software/CMSIS_5/archive/5.7.0.tar.gz")
set(MD5 "0eaa594b0c62dd72e41ec181c4689842")
endif()
set(INCLUDE "./")
mindspore_add_pkg(${cmsis_pkg_name}
VER 5.7.0
HEAD_ONLY ${INCLUDE}
URL ${REQ_URL}
MD5 ${MD5})
message("micro get ${cmsis_pkg_name} config hash: ${${cmsis_pkg_name}_CONFIG_HASH}")
file(GLOB cmsic_children RELATIVE ${_MS_LIB_CACHE} ${_MS_LIB_CACHE}/*)
foreach(child ${cmsic_children})
string(FIND "${child}" "${cmsis_pkg_name}" position)
if(NOT "${position}" EQUAL "-1")
file(STRINGS ${_MS_LIB_CACHE}/${child}/options.txt cmsis_configs)
foreach(cmsis_config ${cmsis_configs})
string(FIND "${cmsis_config}" "${MD5}" position_md5)
if(NOT "${position_md5}" EQUAL "-1")
if(NOT IS_DIRECTORY ${CMAKE_BINARY_DIR}/${cmsis_pkg_name})
MESSAGE("copy cmsis libaray: ${child} to ${CMAKE_BINARY_DIR}")
file(COPY ${_MS_LIB_CACHE}/${child}/CMSIS DESTINATION ${CMAKE_BINARY_DIR}/${cmsis_pkg_name})
endif()
endif()
endforeach()
endif()
endforeach()

View File

@ -1,21 +1,11 @@
set(cppjieba_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(cppjieba_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/cppjieba/repository/archive/v5.0.3.tar.gz")
set(MD5 "06fcc22b4db6c332dc1b0bd353bdf6f2")
else()
set(REQ_URL "https://github.com/yanyiwu/cppjieba/archive/v5.0.3.tar.gz")
set(MD5 "b8b3f7a73032c9ce9daafa4f67196c8c")
endif()
mindspore_add_pkg(cppjieba
VER 5.0.3
HEAD_ONLY ./
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${TOP_DIR}/third_party/patch/cppjieba/cppjieba.patch001)
URL https://github.com/yanyiwu/cppjieba/archive/v5.0.3.tar.gz
MD5 b8b3f7a73032c9ce9daafa4f67196c8c
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/cppjieba/cppjieba.patch001)
include_directories(${cppjieba_INC}include)
include_directories(${cppjieba_INC}deps)
add_library(mindspore::cppjieba ALIAS cppjieba)
add_library(mindspore::cppjieba ALIAS cppjieba)

View File

@ -1,17 +1,11 @@
set(Eigen3_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(Eigen3_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(REQ_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz")
set(MD5 "609286804b0f79be622ccf7f9ff2b660")
mindspore_add_pkg(Eigen3
VER 3.3.9
URL ${REQ_URL}
MD5 ${MD5}
VER 3.3.7
URL https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz
MD5 9e30f67e8531477de4117506fe44669b
CMAKE_OPTION -DBUILD_TESTING=OFF)
find_package(Eigen3 3.3.9 REQUIRED ${MS_FIND_NO_DEFAULT_PATH})
find_package(Eigen3 3.3.7 REQUIRED ${MS_FIND_NO_DEFAULT_PATH})
include_directories(${Eigen3_INC})
include_directories(${EIGEN3_INCLUDE_DIR})
set_property(TARGET Eigen3::Eigen PROPERTY IMPORTED_GLOBAL TRUE)

View File

@ -1,66 +1,20 @@
if(MSVC)
set(flatbuffers_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(flatbuffers_CFLAGS "${CMAKE_C_FLAGS}")
set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
else()
set(flatbuffers_CXXFLAGS "-fPIC -fPIE -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong")
set(flatbuffers_CFLAGS "-fPIC -fPIE -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-strong")
endif()
if(WIN32)
set(flatbuffers_USE_STATIC_LIBS ON)
endif()
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "https://gitee.com/src-openeuler/flatbuffers.git")
set(GIT_TAG "openEuler-22.03-LTS")
set(MD5 "f1c724296be49a29ded69278a9a770c7")
set(FLATBUFFER_SRC "${TOP_DIR}/mindspore/lite/build/_deps/flatbuffers-src")
set(FLATBUFFER_DIR "${FLATBUFFER_SRC}/flatbuffers-2.0.0")
__download_pkg_with_git(flatbuffers ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
execute_process(COMMAND tar -xf ${FLATBUFFER_SRC}/v2.0.0.tar.gz WORKING_DIRECTORY ${FLATBUFFER_SRC})
foreach(_SUBMODULE_FILE ${PKG_SUBMODULES})
STRING(REGEX REPLACE "(.+)_(.+)" "\\1" _SUBMODEPATH ${_SUBMODULE_FILE})
STRING(REGEX REPLACE "(.+)/(.+)" "\\2" _SUBMODENAME ${_SUBMODEPATH})
file(GLOB ${pkg_name}_INSTALL_SUBMODULE ${_SUBMODULE_FILE}/*)
file(COPY ${${pkg_name}_INSTALL_SUBMODULE} DESTINATION ${${pkg_name}_SOURCE_DIR}/3rdparty/${_SUBMODENAME})
endforeach()
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/flatbuffers/repository/archive/v2.0.0.tar.gz")
set(MD5 "5c23d17c0486b81d4c11907e8f7bf36b")
else()
set(REQ_URL "https://github.com/google/flatbuffers/archive/v2.0.0.tar.gz")
set(MD5 "a27992324c3cbf86dd888268a23d17bd")
endif()
endif()
if(APPLE)
set(flatbuffers_CXXFLAGS "${flatbuffers_CXXFLAGS} -Wno-deprecated")
endif()
if(APPLE)
mindspore_add_pkg(flatbuffers
VER 2.0.0
LIBS flatbuffers
EXE flatc
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_INSTALL_LIBDIR=lib)
else()
mindspore_add_pkg(flatbuffers
VER 2.0.0
LIBS flatbuffers
EXE flatc
URL ${REQ_URL}
MD5 ${MD5}
DIR ${FLATBUFFER_DIR}
CMAKE_OPTION -DCMAKE_C_COMPILER=${FLATC_GCC_COMPILER} -DCMAKE_CXX_COMPILER=${FLATC_GXX_COMPILER}
-DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release)
set(flatbuffers_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(flatbuffers_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if (WIN32)
set(flatbuffers_USE_STATIC_LIBS ON)
endif()
mindspore_add_pkg(flatbuffers
VER 1.11.0
LIBS flatbuffers
EXE flatc
URL https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz
MD5 02c64880acb89dbd57eebacfd67200d8
CMAKE_OPTION -DFLATBUFFERS_BUILD_TESTS=OFF )
include_directories(${flatbuffers_INC})
add_library(mindspore::flatbuffers ALIAS flatbuffers::flatbuffers)
add_executable(mindspore::flatc ALIAS flatbuffers::flatc)
include_directories(${flatbuffers_INC})
function(ms_build_flatbuffers source_schema_files
source_schema_dirs
custom_target_name
@ -69,13 +23,13 @@ function(ms_build_flatbuffers source_schema_files
set(total_schema_dirs "")
set(total_generated_files "")
set(FLATC mindspore::flatc)
foreach(schema_dir ${source_schema_dirs})
foreach (schema_dir ${source_schema_dirs})
set(total_schema_dirs -I ${schema_dir} ${total_schema_dirs})
endforeach()
foreach(schema IN LISTS ${source_schema_files})
foreach(schema ${source_schema_files})
get_filename_component(filename ${schema} NAME_WE)
if(NOT ${generated_output_dir} STREQUAL "")
if (NOT ${generated_output_dir} STREQUAL "")
set(generated_file ${generated_output_dir}/${filename}_generated.h)
add_custom_command(
OUTPUT ${generated_file}
@ -93,56 +47,7 @@ function(ms_build_flatbuffers source_schema_files
add_custom_target(${custom_target_name} ALL
DEPENDS ${total_generated_files})
if(NOT ${generated_output_dir} STREQUAL "")
include_directories(${generated_output_dir})
set_property(TARGET ${custom_target_name}
PROPERTY GENERATED_OUTPUT_DIR
${generated_output_dir})
endif()
endfunction()
function(ms_build_flatbuffers_lite
source_schema_files source_schema_dirs custom_target_name generated_output_dir if_inner)
set(total_schema_dirs "")
set(total_generated_files "")
set(FLATC mindspore::flatc)
foreach(schema_dir ${source_schema_dirs})
set(total_schema_dirs -I ${schema_dir} ${total_schema_dirs})
endforeach()
foreach(schema IN LISTS ${source_schema_files})
get_filename_component(filename ${schema} NAME_WE)
if(NOT ${generated_output_dir} STREQUAL "")
set(generated_file ${generated_output_dir}/${filename}_generated.h)
if(if_inner MATCHES "inner")
add_custom_command(
OUTPUT ${generated_file}
COMMAND ${FLATC} --gen-mutable
--reflect-names --gen-object-api -o ${generated_output_dir}
${total_schema_dirs}
-c -b --reflect-types ${schema}
DEPENDS ${FLATC} ${schema}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Running C++ flatbuffers compiler on ${schema}" VERBATIM)
else()
add_custom_command(
OUTPUT ${generated_file}
COMMAND ${FLATC} -o ${generated_output_dir}
${total_schema_dirs}
-c -b ${schema}
DEPENDS ${FLATC} ${schema}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Running C++ flatbuffers compiler on ${schema}" VERBATIM)
endif()
list(APPEND total_generated_files ${generated_file})
endif()
endforeach()
add_custom_target(${custom_target_name} ALL
DEPENDS ${total_generated_files})
if(NOT ${generated_output_dir} STREQUAL "")
if (NOT ${generated_output_dir} STREQUAL "")
include_directories(${generated_output_dir})
set_property(TARGET ${custom_target_name}
PROPERTY GENERATED_OUTPUT_DIR

View File

@ -1,52 +1,10 @@
if(BUILD_LITE)
if(MSVC)
set(flatbuffers_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(flatbuffers_CFLAGS "${CMAKE_C_FLAGS}")
set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
else()
set(glog_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 ${SECURE_CXX_FLAGS} -Dgoogle=mindspore_private")
set(glog_CFLAGS "-D_FORTIFY_SOURCE=2 -O2 ${SECURE_C_FLAGS}")
set(glog_LDFLAGS "${SECURE_SHARED_LINKER_FLAGS}")
endif()
set(glog_patch "")
set(glog_lib glog)
else()
set(glog_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 ${SECURE_CXX_FLAGS} -Dgoogle=mindspore_private")
set(glog_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(glog_patch ${CMAKE_SOURCE_DIR}/third_party/patch/glog/glog.patch001)
set(glog_lib mindspore_glog)
endif()
if(NOT ENABLE_GLIBCXX)
set(glog_CXXFLAGS "${glog_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/glog/repository/archive/v0.4.0.tar.gz")
set(MD5 "9a7598a00c569a11ff1a419076de4ed7")
else()
set(REQ_URL "https://github.com/google/glog/archive/v0.4.0.tar.gz")
set(MD5 "0daea8785e6df922d7887755c3d100d0")
endif()
set(glog_option -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DWITH_GFLAGS=OFF
-DCMAKE_BUILD_TYPE=Release)
if(WIN32 AND NOT MSVC)
execute_process(COMMAND "${CMAKE_C_COMPILER}" -dumpmachine
OUTPUT_VARIABLE i686_or_x86_64
)
if(i686_or_x86_64 MATCHES "^i686-")
set(glog_option ${glog_option} -DHAVE_DBGHELP=ON)
endif()
endif()
set(glog_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 ${SECURE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
set(glog_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(glog
VER 0.4.0
LIBS ${glog_lib}
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${glog_patch}
CMAKE_OPTION ${glog_option})
LIBS glog
URL https://github.com/google/glog/archive/v0.4.0.tar.gz
MD5 0daea8785e6df922d7887755c3d100d0
CMAKE_OPTION -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON)
include_directories(${glog_INC})
add_library(mindspore::glog ALIAS glog::${glog_lib})
add_library(mindspore::glog ALIAS glog::glog)

View File

@ -1,63 +1,41 @@
set(grpc_USE_STATIC_LIBS OFF)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2 \
-Dgrpc=mindspore_grpc -Dgrpc_impl=mindspore_grpc_impl -Dgrpc_core=mindspore_grpc_core")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(grpc_USE_STATIC_LIBS ON)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
else()
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2 \
-Dgrpc=mindspore_grpc -Dgrpc_impl=mindspore_grpc_impl -Dgrpc_core=mindspore_grpc_core")
if(NOT ENABLE_GLIBCXX)
set(grpc_CXXFLAGS "${grpc_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
set(grpc_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
endif()
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(grpc_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
set(grpc_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
if(EXISTS ${protobuf_ROOT}/lib64)
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${protobuf_ROOT}/lib64/cmake/protobuf")
if (EXISTS ${protobuf_ROOT}/lib64)
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${protobuf_ROOT}/lib64/cmake/protobuf")
else()
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${protobuf_ROOT}/lib/cmake/protobuf")
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${protobuf_ROOT}/lib/cmake/protobuf")
endif()
message("grpc using Protobuf_DIR : " ${_FINDPACKAGE_PROTOBUF_CONFIG_DIR})
if(EXISTS ${absl_ROOT}/lib64)
set(_FINDPACKAGE_ABSL_CONFIG_DIR "${absl_ROOT}/lib64/cmake/absl")
if (EXISTS ${absl_ROOT}/lib64)
set(_FINDPACKAGE_ABSL_CONFIG_DIR "${absl_ROOT}/lib64/cmake/absl")
else()
set(_FINDPACKAGE_ABSL_CONFIG_DIR "${absl_ROOT}/lib/cmake/absl")
set(_FINDPACKAGE_ABSL_CONFIG_DIR "${absl_ROOT}/lib/cmake/absl")
endif()
message("grpc using absl_DIR : " ${_FINDPACKAGE_ABSL_CONFIG_DIR})
if(EXISTS ${re2_ROOT}/lib64)
set(_FINDPACKAGE_RE2_CONFIG_DIR "${re2_ROOT}/lib64/cmake/re2")
else()
set(_FINDPACKAGE_RE2_CONFIG_DIR "${re2_ROOT}/lib/cmake/re2")
endif()
message("grpc using re2_DIR : " ${_FINDPACKAGE_RE2_CONFIG_DIR})
if(EXISTS ${openssl_ROOT})
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "-DOPENSSL_ROOT_DIR:PATH=${openssl_ROOT}")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/grpc/repository/archive/v1.36.1.tar.gz")
set(MD5 "71252ebcd8e9e32a818a907dfd4b63cc")
else()
set(REQ_URL "https://github.com/grpc/grpc/archive/v1.36.1.tar.gz")
set(MD5 "90c93203e95e89af5f46738588217057")
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "")
if (OPENSSL_ROOT_DIR)
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}")
endif()
mindspore_add_pkg(grpc
VER 1.36.1
LIBS mindspore_grpc++ mindspore_grpc mindspore_gpr mindspore_upb mindspore_address_sorting
VER 1.27.3
LIBS grpc++ grpc gpr upb address_sorting
EXE grpc_cpp_plugin
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${TOP_DIR}/third_party/patch/grpc/grpc.patch001
URL https://github.com/grpc/grpc/archive/v1.27.3.tar.gz
MD5 0c6c3fc8682d4262dd0e5e6fabe1a7e2
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release
-DBUILD_SHARED_LIBS=ON
-DgRPC_INSTALL:BOOL=ON
-DgRPC_BUILD_TESTS:BOOL=OFF
-DgRPC_PROTOBUF_PROVIDER:STRING=package
@ -71,22 +49,25 @@ mindspore_add_pkg(grpc
-Dc-ares_DIR:PATH=${c-ares_ROOT}/lib/cmake/c-ares
-DgRPC_SSL_PROVIDER:STRING=package
${_CMAKE_ARGS_OPENSSL_ROOT_DIR}
-DgRPC_RE2_PROVIDER:STRING=package
-Dre2_DIR:PATH=${_FINDPACKAGE_RE2_CONFIG_DIR}
)
include_directories(${grpc_INC})
add_library(mindspore::grpc++ ALIAS grpc::mindspore_grpc++)
add_library(mindspore::grpc++ ALIAS grpc::grpc++)
# link other grpc libs
target_link_libraries(grpc::mindspore_grpc++ INTERFACE grpc::mindspore_grpc grpc::mindspore_gpr grpc::mindspore_upb
grpc::mindspore_address_sorting)
target_link_libraries(grpc::grpc++ INTERFACE grpc::grpc grpc::gpr grpc::upb grpc::address_sorting)
# link built dependencies
target_link_libraries(grpc::grpc++ INTERFACE mindspore::z)
target_link_libraries(grpc::grpc++ INTERFACE mindspore::cares)
target_link_libraries(grpc::grpc++ INTERFACE mindspore::absl_strings mindspore::absl_throw_delegate
mindspore::absl_raw_logging_internal mindspore::absl_int128 mindspore::absl_bad_optional_access)
# link system openssl
find_package(OpenSSL REQUIRED)
target_link_libraries(grpc::grpc++ INTERFACE OpenSSL::SSL OpenSSL::Crypto)
# modify mindspore macro define
add_compile_definitions(grpc=mindspore_grpc)
add_compile_definitions(grpc_impl=mindspore_grpc_impl)
add_compile_definitions(grpc_core=mindspore_grpc_core)
function(ms_grpc_generate c_var h_var)
if(NOT ARGN)
@ -117,8 +98,7 @@ function(ms_grpc_generate c_var h_var)
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto"
COMMAND protobuf::protoc --version
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto
--grpc_out=${CMAKE_BINARY_DIR}/proto
--plugin=protoc-gen-grpc=$<TARGET_FILE:grpc::grpc_cpp_plugin> ${abs_file}
--grpc_out=${CMAKE_BINARY_DIR}/proto --plugin=protoc-gen-grpc=$<TARGET_FILE:grpc::grpc_cpp_plugin> ${abs_file}
DEPENDS protobuf::protoc grpc::grpc_cpp_plugin ${abs_file}
COMMENT "Running C++ gRPC compiler on ${file}" VERBATIM)
endforeach()
@ -126,4 +106,5 @@ function(ms_grpc_generate c_var h_var)
set_source_files_properties(${${c_var}} ${${h_var}} PROPERTIES GENERATED TRUE)
set(${c_var} ${${c_var}} PARENT_SCOPE)
set(${h_var} ${${h_var}} PARENT_SCOPE)
endfunction()

View File

@ -1,67 +1,13 @@
set(gtest_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(gtest_CXXFLAGS "-D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
set(gtest_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(CMAKE_OPTION
-DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON
-DCMAKE_MACOSX_RPATH=TRUE -Dgtest_disable_pthreads=ON)
if(BUILD_LITE)
if(PLATFORM_ARM64)
set(CMAKE_OPTION -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake
-DANDROID_NATIVE_API_LEVEL=19
-DANDROID_NDK=$ENV{ANDROID_NDK}
-DANDROID_ABI=arm64-v8a
-DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang
-DANDROID_STL=${ANDROID_STL}
${CMAKE_OPTION})
endif()
if(PLATFORM_ARM32)
set(CMAKE_OPTION -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake
-DANDROID_NATIVE_API_LEVEL=19
-DANDROID_NDK=$ENV{ANDROID_NDK}
-DANDROID_ABI=armeabi-v7a
-DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang
-DANDROID_STL=${ANDROID_STL}
${CMAKE_OPTION})
endif()
endif()
if(NOT ENABLE_GLIBCXX)
set(gtest_CXXFLAGS "${gtest_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.1.tar.gz")
set(MD5 "2e6fbeb6a91310a16efe181886c59596")
else()
set(REQ_URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz")
set(MD5 "2e6fbeb6a91310a16efe181886c59596")
endif()
mindspore_add_pkg(gtest
VER 1.8.1
LIBS gtest gmock
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION ${CMAKE_OPTION})
VER 1.8.0
LIBS gtest
URL https://github.com/google/googletest/archive/release-1.8.0.tar.gz
MD5 16877098823401d1bf2ed7891d7dce36
CMAKE_OPTION -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON
-DCMAKE_MACOSX_RPATH=TRUE -Dgtest_disable_pthreads=ON)
include_directories(${gtest_INC})
add_library(mindspore::gtest ALIAS gtest::gtest)
add_library(mindspore::gmock ALIAS gtest::gmock)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
file(COPY ${gtest_DIRPATH}/bin/libgtest${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_DIRPATH}/bin/libgtest_main${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_DIRPATH}/bin/libgmock_main${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_DIRPATH}/bin/libgmock${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
else()
file(COPY ${gtest_LIBPATH}/libgtest${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_LIBPATH}/libgtest_main${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_LIBPATH}/libgmock${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_LIBPATH}/libgmock_main${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION
${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
endif()
file(COPY ${gtest_LIBPATH}/libgtest${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)
file(COPY ${gtest_LIBPATH}/libgtest_main${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_BINARY_DIR}/googletest/googlemock/gtest)

View File

@ -1,67 +1,17 @@
set(LIB_ICU_COMMON icuuc)
set(LIB_ICU_DATA icudata)
set(LIB_ICU_I18N icui18n)
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "https://gitee.com/src-openeuler/icu.git")
set(GIT_TAG "openEuler-22.03-LTS")
set(MD5 "fa4070da839ce75469a8de962f2a0c2a")
set(ICU4C_SRC "${TOP_DIR}/build/mindspore/_deps/icu4c-src/icu4c")
set(ICU4C_TAR_SRC "${TOP_DIR}/build/mindspore/_deps/icu4c-src")
__download_pkg_with_git(icu4c ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
execute_process(COMMAND mkdir ${ICU4C_SRC})
execute_process(COMMAND tar -xf ${ICU4C_TAR_SRC}/icu4c-69_1-src.tgz --strip-components 1 -C ${ICU4C_SRC})
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/icu/repository/archive/release-69-1.tar.gz")
set(MD5 "9f218f0eee9d49831e7e48fd136e689c")
else()
set(REQ_URL "https://github.com/unicode-org/icu/archive/release-69-1.tar.gz")
set(MD5 "135125f633864285d637db5c01e0388b")
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
message("icu4c thirdparty do not support windows currently.")
else()
set(JSON_FILE "{ \n\
\"strategy\": \"additive\",\n\
\"featureFilters\": {\n\
\"normalization\": \"include\"\n\
}\n\
}\
")
file(WRITE ${CMAKE_BINARY_DIR}/icu4c_filter.json ${JSON_FILE})
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
mindspore_add_pkg(icu4c
VER 69.1
LIBS ${LIB_ICU_COMMON} ${LIB_ICU_DATA} ${LIB_ICU_I18N}
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/icu4c/icu4c.patch01
CONFIGURE_COMMAND ./icu4c/source/runConfigureICU MacOSX --disable-tests
--disable-samples --disable-icuio --disable-extras
ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json
)
else()
mindspore_add_pkg(icu4c
VER 69.1
LIBS ${LIB_ICU_COMMON} ${LIB_ICU_DATA} ${LIB_ICU_I18N}
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${TOP_DIR}/third_party/patch/icu4c/icu4c.patch01
CONFIGURE_COMMAND ./icu4c/source/runConfigureICU Linux --enable-rpath --disable-tests --disable-samples
--disable-icuio --disable-extras
ICU_DATA_FILTER_FILE=${CMAKE_BINARY_DIR}/icu4c_filter.json
)
endif()
mindspore_add_pkg(icu4c
VER 67.1
LIBS ${LIB_ICU_COMMON} ${LIB_ICU_DATA} ${LIB_ICU_I18N}
URL https://github.com/unicode-org/icu/archive/release-67-1.tar.gz
MD5 fd525fb47d8827b0b7da78b51dd2d93f
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/scripts/build_icu4c.sh
)
include_directories(${icu4c_INC})
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
include(${CMAKE_SOURCE_DIR}/cmake/change_rpath.cmake)
changerpath($<TARGET_FILE:icu4c::${LIB_ICU_COMMON}> ${LIB_ICU_COMMON} "libicuuc;libicudata")
changerpath($<TARGET_FILE:icu4c::${LIB_ICU_DATA}> ${LIB_ICU_DATA} "libicudata")
changerpath($<TARGET_FILE:icu4c::${LIB_ICU_I18N}> ${LIB_ICU_I18N} "libicuuc;libicudata;libicui18n")
endif()
add_library(mindspore::icuuc ALIAS icu4c::${LIB_ICU_COMMON})
add_library(mindspore::icudata ALIAS icu4c::${LIB_ICU_DATA})
add_library(mindspore::icui18n ALIAS icu4c::${LIB_ICU_I18N})

View File

@ -1,55 +1,18 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/libjpeg-turbo/repository/archive/2.0.4.tar.gz")
set(MD5 "44c43e4a9fb352f47090804529317c88")
else()
set(REQ_URL "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.4.tar.gz")
set(MD5 "44c43e4a9fb352f47090804529317c88")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \
-O2")
else()
set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \
-D_FORTIFY_SOURCE=2 -O2")
endif()
set(jpeg_turbo_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack,-s")
set(jpeg_turbo_USE_STATIC_LIBS ON)
set(JPEG_TURBO_PATCHE ${CMAKE_SOURCE_DIR}/third_party/patch/jpeg_turbo/jpeg_turbo.patch001)
set(CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=TRUE -DWITH_SIMD=ON)
if(BUILD_LITE)
set(jpeg_turbo_USE_STATIC_LIBS OFF)
set(JPEG_TURBO_PATCHE ${TOP_DIR}/third_party/patch/jpeg_turbo/jpeg_turbo.patch001)
if(PLATFORM_ARM64)
set(CMAKE_OPTION -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake
-DANDROID_NATIVE_API_LEVEL=19
-DANDROID_NDK=$ENV{ANDROID_NDK}
-DANDROID_ABI=arm64-v8a
-DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang
-DANDROID_STL=c++_shared -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
if(PLATFORM_ARM32)
set(CMAKE_OPTION -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake
-DANDROID_NATIVE_API_LEVEL=19
-DANDROID_NDK=$ENV{ANDROID_NDK}
-DANDROID_ABI=armeabi-v7a
-DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-clang
-DANDROID_STL=c++_shared -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2")
else()
set(jpeg_turbo_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2")
endif()
set(jpeg_turbo_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
mindspore_add_pkg(jpeg_turbo
VER 2.0.4
LIBS jpeg turbojpeg
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION ${CMAKE_OPTION}
PATCHES ${JPEG_TURBO_PATCHE}
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.4.tar.gz
MD5 44c43e4a9fb352f47090804529317c88
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=TRUE -DWITH_SIMD=ON
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/jpeg_turbo/jpeg_turbo.patch001
)
include_directories(${jpeg_turbo_INC})
add_library(mindspore::jpeg_turbo ALIAS jpeg_turbo::jpeg)

View File

@ -1,26 +1,9 @@
if(MSVC)
set(flatbuffers_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(flatbuffers_CFLAGS "${CMAKE_CXX_FLAGS}")
set(flatbuffers_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
else()
set(nlohmann_json373_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(nlohmann_json373_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.7.3.zip")
set(MD5 "b758acca4f3e133bacf919e31ca302e3")
set(INCLUDE "./include")
else()
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip")
set(MD5 "fb96f95cdf609143e998db401ca4f324")
set(INCLUDE "./include")
endif()
mindspore_add_pkg(nlohmann_json373
VER 3.7.3
HEAD_ONLY ${INCLUDE}
URL ${REQ_URL}
MD5 ${MD5})
include_directories(${nlohmann_json373_INC})
add_library(mindspore::json ALIAS nlohmann_json373)
set(nlohmann_json_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(nlohmann_json_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(nlohmann_json
VER 3.6.1
HEAD_ONLY ./
URL https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip
MD5 0dc903888211db3a0f170304cd9f3a89)
include_directories(${nlohmann_json_INC})
add_library(mindspore::json ALIAS nlohmann_json)

View File

@ -1,30 +1,11 @@
set(libevent_CFLAGS "-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2")
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(libevent_LDFLAGS "-Wl,-z,now")
endif()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/libevent/repository/archive/release-2.1.12-stable.tar.gz")
set(MD5 "0d5a27436bf7ff8253420c8cf09f47ca")
else()
set(REQ_URL
"https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz")
set(MD5 "b5333f021f880fe76490d8a799cd79f4")
endif()
message("libevent using openssl stub dir: " ${openssl_ROOT})
mindspore_add_pkg(libevent
VER 2.1.12
LIBS event event_pthreads event_core event_openssl
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/libevent/libevent.patch001
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING=OFF -DOPENSSL_ROOT_DIR:PATH=${openssl_ROOT})
LIBS event event_pthreads
URL https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz
MD5 b5333f021f880fe76490d8a799cd79f4
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING=OFF)
include_directories(${libevent_INC})
add_library(mindspore::event ALIAS libevent::event)
add_library(mindspore::event_pthreads ALIAS libevent::event_pthreads)
add_library(mindspore::event_core ALIAS libevent::event_core)
add_library(mindspore::event_openssl ALIAS libevent::event_openssl)

View File

@ -1,4 +1,4 @@
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(tiff_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2")
set(tiff_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -Wno-unused-result \
@ -8,29 +8,19 @@ else()
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2")
set(tiff_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-unused-result \
-Wno-unused-but-set-variable -fPIC -D_FORTIFY_SOURCE=2 -O2")
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(tiff_CFLAGS "${tiff_CFLAGS} -Wno-int-to-pointer-cast -Wno-implicit-fallthrough -Wno-pointer-to-int-cast")
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(tiff_CFLAGS "${tiff_CFLAGS} -Wno-int-to-pointer-cast -Wno-implicit-fallthrough -Wno-pointer-to-int-cast")
endif()
endif()
set(tiff_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/libtiff/repository/archive/v4.2.0.tar.gz")
set(MD5 "1b8f32e39940ffbdac3638f7081ba9e0")
else()
set(REQ_URL "http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz")
set(MD5 "2bbf6db1ddc4a59c89d6986b368fc063")
endif()
mindspore_add_pkg(tiff
VER 4.2.0
VER 4.1.0
LIBS tiff
URL ${REQ_URL}
MD5 ${MD5}
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.tar.gz
MD5 21de8d35c1b21ac82663fa9f56d3350d
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -Djbig=OFF -Dlzma=OFF -Djpeg12=OFF -Dzstd=OFF -Dpixarlog=OFF
-Dold-jpeg=OFF -Dwebp=OFF -DBUILD_SHARED_LIBS=OFF -Dlibdeflate=OFF
PATCHES ${TOP_DIR}/third_party/patch/libtiff/CVE-2022-0561_and_CVE-2022-0562.patch001
PATCHES ${TOP_DIR}/third_party/patch/libtiff/CVE-2022-0908.patch002)
-Dold-jpeg=OFF -Dwebp=OFF -DBUILD_SHARED_LIBS=OFF)
message("tiff include = ${tiff_INC}")
message("tiff lib = ${tiff_LIB}")

View File

@ -1,44 +1,20 @@
set(onednn_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(onednn_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if(USE_MS_THREADPOOL_FOR_DNNL)
set(USE_MS_THREADPOOL "-DDNNL_CPU_RUNTIME=THREADPOOL")
else()
set(USE_MS_THREADPOOL "")
endif()
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "git@gitee.com:src-openeuler/onednn.git")
set(GIT_TAG "0d726f1")
set(MD5 "6a062e36ea1bee03ff55bf44ee243e27")
__download_pkg_with_git(ONEDNN ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
set(ONE_DNN_SRC "${TOP_DIR}/mindspore/lite/build/_deps/onednn-src")
execute_process(COMMAND tar -xf ${ONE_DNN_SRC}/v2.2.tar.gz --strip-components 1 -C ${ONE_DNN_SRC})
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
mindspore_add_pkg(onednn
VER 2.2
VER 1.5
LIBS dnnl mkldnn
HEAD_ONLY ./include
RELEASE on
URL http://tools.mindspore.cn/libs/dnnl/dnnl_win_2.2.0_cpu_vcomp.zip
MD5 139fcdbd601a970fb86dd15b30ba5ae3)
URL https://github.com/oneapi-src/oneDNN/releases/download/v1.5/dnnl_win_1.5.0_cpu_vcomp.zip
MD5 17757c84f49edd42d34ae8c9288110a1)
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/MKL-DNN/repository/archive/v2.2.tar.gz")
set(MD5 "49c650e0cc24ef9ae7033d4cb22ebfad")
else()
set(REQ_URL "https://github.com/oneapi-src/oneDNN/archive/v2.2.tar.gz")
set(MD5 "6a062e36ea1bee03ff55bf44ee243e27")
endif()
mindspore_add_pkg(onednn
VER 2.2
VER 1.5
LIBS dnnl mkldnn
URL ${REQ_URL}
MD5 ${MD5}
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/onednn/0001-fix-user-threadpool-bug.patch
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/onednn/0002-fix-pool-nthr-bug.patch
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/onednn/0003-fix-zero-threads-identified-on-AMD.patch
CMAKE_OPTION -DDNNL_ARCH_OPT_FLAGS='' -DDNNL_BUILD_EXAMPLES=OFF -DDNNL_BUILD_TESTS=OFF
${USE_MS_THREADPOOL} -DDNNL_ENABLE_CONCURRENT_EXEC=ON)
URL https://github.com/oneapi-src/oneDNN/archive/v1.5.tar.gz
MD5 5d97e0e8f4c0b37da5f524533b7a644b
CMAKE_OPTION -DDNNL_ARCH_OPT_FLAGS='' -DDNNL_CPU_RUNTIME='SEQ' -DDNNL_BUILD_EXAMPLES=OFF -DDNNL_BUILD_TESTS=OFF)
endif()
include_directories(${onednn_INC})

View File

@ -1,19 +1,12 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/nccl/repository/archive/v2.7.6-1.tar.gz")
set(MD5 "6884364c2b1cf229f0bdaf94efcb5782")
else()
set(REQ_URL "https://github.com/NVIDIA/nccl/archive/v2.7.6-1.tar.gz")
set(MD5 "073b19899f374c5ba07d2db02dc38f9f")
endif()
set(nccl_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(nccl
VER 2.7.6-1
VER 2.4.8-1
LIBS nccl
URL ${REQ_URL}
MD5 ${MD5}
BUILD_OPTION src.build
URL https://github.com/NVIDIA/nccl/archive/v2.4.8-1.tar.gz
MD5 f14b37d6af1c79db5f57cb029a753727
BUILD_OPTION src.build NVCC_GENCODE="-gencode=arch=compute_70,code=sm_70"
INSTALL_INCS build/include/*
INSTALL_LIBS build/lib/*)
include_directories(${nccl_INC})
add_library(mindspore::nccl ALIAS nccl::nccl)
add_library(mindspore::nccl ALIAS nccl::nccl)

View File

@ -1,17 +1,10 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/ompi/repository/archive/v4.0.3.tar.gz")
set(MD5 "70f764c26ab6cd99487d58be0cd8c409")
else()
set(REQ_URL "https://github.com/open-mpi/ompi/archive/v4.0.3.tar.gz")
set(MD5 "86cb724e8fe71741ad3be4e7927928a2")
endif()
set(ompi_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(ompi
VER 4.0.3
VER 3.1.5
LIBS mpi
URL ${REQ_URL}
MD5 ${MD5}
URL https://github.com/open-mpi/ompi/archive/v3.1.5.tar.gz
MD5 f7f220b26532c11a2efbc0bb73af3282
PRE_CONFIGURE_COMMAND ./autogen.pl
CONFIGURE_COMMAND ./configure)
include_directories(${ompi_INC})

View File

@ -0,0 +1,5 @@
mindspore_add_pkg(ms_onnx
VER 1.6.0
HEAD_ONLY ./
URL https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz
MD5 512f2779d6215d4a36f366b6b9acdf1e)

View File

@ -1,55 +0,0 @@
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "git@gitee.com:src-openeuler/opencl-clhpp.git")
set(GIT_TAG "7347fa1bb52ebee9f3d6c44ff65ef3c4253cab79")
set(MD5 "d41d8cd98f00b204e9800998ecf8427e")
__download_pkg_with_git(OpenCL-CLHPP ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
set(OPENCL_CLHPP_SRC "${TOP_DIR}/mindspore/lite/build/_deps/opencl-clhpp-src")
execute_process(COMMAND tar -xf ${OPENCL_CLHPP_SRC}/v2.0.12.tar.gz --strip-components 1 -C ${OPENCL_CLHPP_SRC})
set(OPENCL_HEADER_SRC "${TOP_DIR}/mindspore/lite/build/_deps/opencl-headers-src")
execute_process(COMMAND mkdir -p ${OPENCL_HEADER_SRC})
execute_process(COMMAND tar -xf ${OPENCL_CLHPP_SRC}/v2020.12.18.tar.gz --strip-components 1 -C ${OPENCL_HEADER_SRC})
elseif(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/OpenCL-Headers/repository/archive/v2020.12.18.tar.gz")
set(MD5 "9a34e50198ac54b795bf3822bb6e429a")
__download_pkg(OpenCL-Headers ${REQ_URL} ${MD5})
set(REQ_URL "https://gitee.com/mirrors/OpenCL-CLHPP/repository/archive/v2.0.12.tar.gz")
set(MD5 "3439d8eb6d247bfd02164bcd0c8e5adb")
__download_pkg(OpenCL-CLHPP ${REQ_URL} ${MD5})
else()
set(REQ_URL "https://github.com/KhronosGroup/OpenCL-Headers/archive/v2020.12.18.tar.gz")
set(MD5 "ea0296fb79951f43082b742234f26c9a")
__download_pkg(OpenCL-Headers ${REQ_URL} ${MD5})
set(REQ_URL "https://github.com/KhronosGroup/OpenCL-CLHPP/archive/v2.0.12.tar.gz")
set(MD5 "bd00fca8f861b3b65660d719f00a58dd")
__download_pkg(OpenCL-CLHPP ${REQ_URL} ${MD5})
endif()
function(gene_opencl CL_SRC_DIR)
message(STATUS "**********gene opencl********* cl path: " "${CL_SRC_DIR}")
if(NOT EXISTS ${CL_SRC_DIR})
return()
endif()
file(GLOB_RECURSE CL_LIST ${CL_SRC_DIR}/*.cl)
foreach(file_path ${CL_LIST})
file(REMOVE ${file_path}.inc)
string(REGEX REPLACE ".+/(.+)\\..*" "\\1" kernel_name "${file_path}")
set(inc_file_ex "${file_path}.inc")
execute_process(
COMMAND bash -c "sed 's/\\\\/\\\\\\\\/g' "
COMMAND bash -c "sed 's/\\\"/\\\\\\\"/g' "
COMMAND bash -c "sed 's/$/\\\\n\\\" \\\\/' "
COMMAND bash -c "sed 's/^/\\\"/' "
WORKING_DIRECTORY ${CL_SRC_DIR}
INPUT_FILE ${file_path}
OUTPUT_FILE ${inc_file_ex}
RESULT_VARIABLE RESULT)
if(NOT RESULT EQUAL "0")
message(FATAL_ERROR "error! when generate ${inc_file_ex}")
endif()
__exec_cmd(COMMAND sed -i "1i\\static const char *${kernel_name}_source =\\\"\\\\n\\\" \\\\"
${inc_file_ex} WORKING_DIRECTORY ${CL_SRC_DIR})
__exec_cmd(COMMAND sed -i "$a\\\\\;" ${inc_file_ex} WORKING_DIRECTORY ${CL_SRC_DIR})
endforeach()
endfunction()

View File

@ -1,56 +1,30 @@
if(MSVC)
set(opencv_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(opencv_CFLAGS "${CMAKE_C_FLAGS}")
set(opencv_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(opencv_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(opencv_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(opencv_LDFLAGS "-Wl")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(opencv_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(opencv_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(opencv_CXXFLAGS "${opencv_CXXFLAGS} -Wno-attributes -Wno-unknown-pragmas")
set(opencv_CXXFLAGS "${opencv_CXXFLAGS} -Wno-unused-value -Wno-implicit-fallthrough")
else()
set(opencv_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2")
set(opencv_CXXFLAGS "${opencv_CXXFLAGS} -O2")
if(NOT ENABLE_GLIBCXX)
set(opencv_CXXFLAGS "${opencv_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
set(opencv_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
set(opencv_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -D_FORTIFY_SOURCE=2 -O2")
set(opencv_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack -s")
set(opencv_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "https://gitee.com/src-openeuler/opencv.git")
set(GIT_TAG "openEuler-22.03-LTS")
set(MD5 "e2b5aa4946559d0a397148d6e1ab7284")
set(OPENCV_SRC "${TOP_DIR}/build/mindspore/_deps/opencv-src")
__download_pkg_with_git(opencv ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
execute_process(COMMAND tar -xf ${OPENCV_SRC}/opencv-4.5.2.tar.gz --strip-components 1 -C ${OPENCV_SRC})
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/opencv/repository/archive/4.5.2.tar.gz")
set(MD5 "d3141f649ab2d76595fdd8991ee15c55")
else()
set(REQ_URL "https://github.com/opencv/opencv/archive/4.5.2.tar.gz")
set(MD5 "d3141f649ab2d76595fdd8991ee15c55")
endif()
endif()
if(MSVC)
if (WIN32)
mindspore_add_pkg(opencv
VER 4.5.2
LIBS opencv_core452.lib opencv_imgcodecs452.lib opencv_imgproc452.lib
LIB_PATH x64/*/lib
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DWITH_PROTOBUF=OFF -DWITH_WEBP=OFF -DWITH_IPP=OFF
-DWITH_ADE=OFF
VER 4.2.0
LIBS libopencv_core420.dll.a libopencv_imgcodecs420.dll.a libopencv_imgproc420.dll.a
LIB_PATH x64/mingw/lib
URL https://github.com/opencv/opencv/archive/4.2.0.tar.gz
MD5 e8cb208ce2723481408b604b480183b6
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DWITH_PROTOBUF=OFF -DWITH_WEBP=OFF -DWITH_IPP=OFF -DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=OFF
-DBUILD_OPENEXR=ON
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
@ -62,75 +36,38 @@ if(MSVC)
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DCV_TRACE=OFF # cause memory usage increacing
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB})
elseif(WIN32)
mindspore_add_pkg(opencv
VER 4.5.2
LIBS libopencv_core452.dll.a libopencv_imgcodecs452.dll.a libopencv_imgproc452.dll.a
LIB_PATH x64/mingw/lib
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DWITH_PROTOBUF=OFF -DWITH_WEBP=OFF -DWITH_IPP=OFF
-DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=OFF
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DBUILD_opencv_videoio=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DCV_TRACE=OFF # cause memory usage increacing
-DWITH_LAPACK=OFF
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB})
else()
mindspore_add_pkg(opencv
VER 4.5.2
LIBS opencv_core opencv_imgcodecs opencv_imgproc
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DWITH_PROTOBUF=OFF -DWITH_WEBP=OFF -DWITH_IPP=OFF
-DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=OFF
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DCV_TRACE=OFF # cause memory usage increacing
-DWITH_LAPACK=OFF
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB})
VER 4.2.0
LIBS opencv_core opencv_imgcodecs opencv_imgproc
URL https://github.com/opencv/opencv/archive/4.2.0.tar.gz
MD5 e8cb208ce2723481408b604b480183b6
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DWITH_PROTOBUF=OFF -DWITH_WEBP=OFF -DWITH_IPP=OFF -DWITH_ADE=OFF
-DBUILD_ZLIB=ON
-DBUILD_JPEG=ON
-DBUILD_PNG=ON
-DBUILD_OPENEXR=ON
-DBUILD_TESTS=OFF
-DBUILD_PERF_TESTS=OFF
-DBUILD_opencv_apps=OFF
-DCMAKE_SKIP_RPATH=TRUE
-DBUILD_opencv_python3=OFF
-DWITH_FFMPEG=OFF
-DWITH_TIFF=ON
-DBUILD_TIFF=OFF
-DWITH_JASPER=OFF
-DBUILD_JASPER=OFF
-DTIFF_INCLUDE_DIR=${tiff_INC}
-DTIFF_LIBRARY=${tiff_LIB})
endif()
if(MSVC)
if (WIN32)
include_directories(${opencv_INC})
add_library(mindspore::opencv_core ALIAS opencv::opencv_core452.lib)
add_library(mindspore::opencv_imgcodecs ALIAS opencv::opencv_imgcodecs452.lib)
add_library(mindspore::opencv_imgproc ALIAS opencv::opencv_imgproc452.lib)
elseif(WIN32)
include_directories(${opencv_INC})
add_library(mindspore::opencv_core ALIAS opencv::libopencv_core452.dll.a)
add_library(mindspore::opencv_imgcodecs ALIAS opencv::libopencv_imgcodecs452.dll.a)
add_library(mindspore::opencv_imgproc ALIAS opencv::libopencv_imgproc452.dll.a)
add_library(mindspore::opencv_core ALIAS opencv::libopencv_core420.dll.a)
add_library(mindspore::opencv_imgcodecs ALIAS opencv::libopencv_imgcodecs420.dll.a)
add_library(mindspore::opencv_imgproc ALIAS opencv::libopencv_imgproc420.dll.a)
else()
include_directories(${opencv_INC}/opencv4)
add_library(mindspore::opencv_core ALIAS opencv::opencv_core)

View File

@ -1,78 +0,0 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/openssl/repository/archive/OpenSSL_1_1_1k.tar.gz")
set(MD5 "bdd51a68ad74618dd2519da8e0bcc759")
else()
set(REQ_URL "https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz")
set(MD5 "bdd51a68ad74618dd2519da8e0bcc759")
endif()
if(BUILD_LITE)
set(OPENSSL_PATCH_ROOT ${TOP_DIR}/third_party/patch/openssl)
else()
set(OPENSSL_PATCH_ROOT ${CMAKE_SOURCE_DIR}/third_party/patch/openssl)
endif()
if(BUILD_LITE)
if(PLATFORM_ARM64 AND ANDROID_NDK_TOOLCHAIN_INCLUDED)
set(openssl_USE_STATIC_LIBS OFF)
set(ANDROID_NDK_ROOT $ENV{ANDROID_NDK})
set(PATH
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin:
${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:
$ENV{PATH})
mindspore_add_pkg(openssl
VER 1.1.1k
LIBS ssl crypto
URL ${REQ_URL}
MD5 ${MD5}
CONFIGURE_COMMAND ./Configure android-arm64 -D__ANDROID_API__=29 no-zlib
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3711.patch
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3712.patch
)
elseif(PLATFORM_ARM32 AND ANDROID_NDK_TOOLCHAIN_INCLUDED)
set(ANDROID_NDK_ROOT $ENV{ANDROID_NDK})
set(PATH
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin:
${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:
$ENV{PATH})
mindspore_add_pkg(openssl
VER 1.1.1k
LIBS ssl crypto
URL ${REQ_URL}
MD5 ${MD5}
CONFIGURE_COMMAND ./Configure android-arm -D__ANDROID_API__=19 no-zlib
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3711.patch
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3712.patch
)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR APPLE)
mindspore_add_pkg(openssl
VER 1.1.1k
LIBS ssl crypto
URL ${REQ_URL}
MD5 ${MD5}
CONFIGURE_COMMAND ./config no-zlib
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3711.patch
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3712.patch
)
else()
MESSAGE(FATAL_ERROR "openssl does not support compilation for the current environment.")
endif()
include_directories(${openssl_INC})
add_library(mindspore::ssl ALIAS openssl::ssl)
add_library(mindspore::crypto ALIAS openssl::crypto)
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR APPLE)
mindspore_add_pkg(openssl
VER 1.1.1k
LIBS ssl crypto
URL ${REQ_URL}
MD5 ${MD5}
CONFIGURE_COMMAND ./config no-zlib no-shared
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3711.patch
PATCHES ${OPENSSL_PATCH_ROOT}/CVE-2021-3712.patch
)
include_directories(${openssl_INC})
add_library(mindspore::ssl ALIAS openssl::ssl)
add_library(mindspore::crypto ALIAS openssl::crypto)
endif()
endif()

View File

@ -1,73 +1,32 @@
set(protobuf_USE_STATIC_LIBS ON)
if(BUILD_LITE)
if(MSVC)
set(protobuf_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(protobuf_CFLAGS "${CMAKE_C_FLAGS}")
set(protobuf_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(_ms_tmp_CMAKE_STATIC_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
else()
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
if(NOT ENABLE_GLIBCXX)
set(protobuf_CXXFLAGS "${protobuf_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC \
-fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
else()
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
if(NOT ENABLE_GLIBCXX)
set(protobuf_CXXFLAGS "${protobuf_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
set(protobuf_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
endif()
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
set(_ms_tmp_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS})
string(REPLACE " -Wall" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.13.0.tar.gz")
set(MD5 "53ab10736257b3c61749de9800b8ce97")
else()
set(REQ_URL "https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz")
set(MD5 "1a6274bc4a65b55a6fa70e264d796490")
endif()
if(BUILD_LITE)
set(PROTOBUF_PATCH_ROOT ${TOP_DIR}/third_party/patch/protobuf)
else()
set(PROTOBUF_PATCH_ROOT ${CMAKE_SOURCE_DIR}/third_party/patch/protobuf)
endif()
mindspore_add_pkg(protobuf
VER 3.13.0
VER 3.8.0
LIBS protobuf
EXE protoc
URL ${REQ_URL}
MD5 ${MD5}
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
MD5 3d9e32700639618a4d2d342c99d4507a
CMAKE_PATH cmake/
CMAKE_OPTION -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
PATCHES ${PROTOBUF_PATCH_ROOT}/CVE-2021-22570.patch)
CMAKE_OPTION -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF)
include_directories(${protobuf_INC})
add_library(mindspore::protobuf ALIAS protobuf::protobuf)
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS})
if(MSVC)
set(CMAKE_STATIC_LIBRARY_PREFIX, ${_ms_tmp_CMAKE_STATIC_LIBRARY_PREFIX})
endif()
function(common_protobuf_generate path c_var h_var)
function(ms_protobuf_generate c_var h_var)
if(NOT ARGN)
message(SEND_ERROR "Error: ms_protobuf_generate() called without any proto files")
return()
@ -82,13 +41,15 @@ function(common_protobuf_generate path c_var h_var)
get_filename_component(file_dir ${abs_file} PATH)
file(RELATIVE_PATH rel_path ${CMAKE_CURRENT_SOURCE_DIR} ${file_dir})
list(APPEND ${c_var} "${path}/${file_name}.pb.cc")
list(APPEND ${h_var} "${path}/${file_name}.pb.h")
list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc")
list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h")
add_custom_command(
OUTPUT "${path}/${file_name}.pb.cc" "${path}/${file_name}.pb.h"
OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
"${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory "${path}"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${path} ${abs_file}
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/proto"
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
endforeach()
@ -96,16 +57,7 @@ function(common_protobuf_generate path c_var h_var)
set_source_files_properties(${${c_var}} ${${h_var}} PROPERTIES GENERATED TRUE)
set(${c_var} ${${c_var}} PARENT_SCOPE)
set(${h_var} ${${h_var}} PARENT_SCOPE)
endfunction()
function(ms_protobuf_generate c_var h_var)
if(NOT ENABLE_CLOUD_AND_LITE)
common_protobuf_generate(${CMAKE_BINARY_DIR}/proto ${c_var} ${h_var} ${ARGN})
else()
common_protobuf_generate(${CMAKE_BINARY_DIR}/proto/lite ${c_var} ${h_var} ${ARGN})
endif()
set(${c_var} ${${c_var}} PARENT_SCOPE)
set(${h_var} ${${h_var}} PARENT_SCOPE)
endfunction()
function(ms_protobuf_generate_py c_var h_var py_var)
@ -126,7 +78,7 @@ function(ms_protobuf_generate_py c_var h_var py_var)
list(APPEND ${c_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc")
list(APPEND ${h_var} "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h")
list(APPEND ${py_var} "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py")
if(WIN32)
if (WIN32)
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
"${CMAKE_BINARY_DIR}/proto/${file_name}.pb.h"
@ -136,12 +88,10 @@ function(ms_protobuf_generate_py c_var h_var py_var)
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/"
"${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
"${PROJECT_SOURCE_DIR}/mindspore/python/mindspore/train/"
COMMAND perl -pi.bak -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/"
DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM )
else()
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/proto/${file_name}.pb.cc"
@ -152,10 +102,8 @@ function(ms_protobuf_generate_py c_var h_var py_var)
COMMAND protobuf::protoc -I${file_dir} --cpp_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND protobuf::protoc -I${file_dir} --python_out=${CMAKE_BINARY_DIR}/proto ${abs_file}
COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/"
"${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND cp "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
"${PROJECT_SOURCE_DIR}/mindspore/python/mindspore/train/"
COMMAND perl -pi -e "s/import (.+_pb2.*)/from . import \\1/" "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py"
COMMAND cp "${CMAKE_BINARY_DIR}/proto/${file_name}_pb2.py" "${PROJECT_SOURCE_DIR}/mindspore/train/"
DEPENDS protobuf::protoc ${abs_file}
COMMENT "Running C++ protocol buffer compiler on ${file}" VERBATIM)
endif()
@ -164,4 +112,5 @@ function(ms_protobuf_generate_py c_var h_var py_var)
set(${c_var} ${${c_var}} PARENT_SCOPE)
set(${h_var} ${${h_var}} PARENT_SCOPE)
set(${py_var} ${${py_var}} PARENT_SCOPE)
endfunction()

View File

@ -1,73 +0,0 @@
set(protobuf_arm_USE_STATIC_LIBS ON)
if(BUILD_LITE)
if(MSVC)
set(protobuf_arm_CXXFLAGS "${CMAKE_CXX_FLAGS}")
set(protobuf_arm_CFLAGS "${CMAKE_C_FLAGS}")
set(protobuf_arm_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
set(_ms_tmp_CMAKE_STATIC_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
else()
set(protobuf_arm_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
if(NOT ENABLE_GLIBCXX)
set(protobuf_arm_CXXFLAGS "${protobuf_arm_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
set(protobuf_arm_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
else()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(protobuf_arm_CXXFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC \
-fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(protobuf_arm_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
else()
set(protobuf_arm_CXXFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter \
-fPIC -fvisibility=hidden -D_FORTIFY_SOURCE=2 -O2")
if(NOT ENABLE_GLIBCXX)
set(protobuf_arm_CXXFLAGS "${protobuf_arm_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
endif()
set(protobuf_arm_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
set(_ms_tmp_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS})
string(REPLACE " -Wall" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.13.0.tar.gz")
set(MD5 "53ab10736257b3c61749de9800b8ce97")
else()
set(REQ_URL "https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz")
set(MD5 "1a6274bc4a65b55a6fa70e264d796490")
endif()
if(BUILD_LITE)
set(PROTOBUF_PATCH_ROOT ${TOP_DIR}/third_party/patch/protobuf)
else()
set(PROTOBUF_PATCH_ROOT ${CMAKE_SOURCE_DIR}/third_party/patch/protobuf)
endif()
mindspore_add_pkg(protobuf_arm
VER 3.13.0
LIBS protobuf
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_PATH cmake/
CMAKE_OPTION
-Dprotobuf_BUILD_TESTS=OFF
-Dprotobuf_BUILD_SHARED_LIBS=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-Dprotobuf_WITH_ZLIB=OFF
PATCHES ${PROTOBUF_PATCH_ROOT}/CVE-2021-22570.patch)
include_directories(${protobuf_arm_INC})
add_library(mindspore::protobuf_arm ALIAS protobuf_arm::protobuf)
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS})
if(MSVC)
set(CMAKE_STATIC_LIBRARY_PREFIX, ${_ms_tmp_CMAKE_STATIC_LIBRARY_PREFIX})
endif()

View File

@ -0,0 +1,14 @@
set(pslite_USE_STATIC_LIBS ON)
if (${ENABLE_IBVERBS} STREQUAL "ON")
set(pslite_CXXFLAGS "USE_IBVERBS=1")
endif()
mindspore_add_pkg(pslite
LIBS ps
URL https://github.com/dmlc/ps-lite/archive/34fd45cae457d59850fdcb2066467778d0673f21.zip
MD5 393c0e27b68bfaf96718caa3aa96f5a3
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/pslite/ps_lite.patch001
ONLY_MAKE True
ONLY_MAKE_INCS include/*
ONLY_MAKE_LIBS build/*)
include_directories(${pslite_INC})
add_library(mindspore::pslite ALIAS pslite::ps)

View File

@ -1,60 +1,11 @@
set(PYTHON_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if(ENABLE_GITEE)
if(PYTHON_VERSION MATCHES "3.9")
set(REQ_URL "https://gitee.com/mirrors/pybind11/repository/archive/v2.6.1.tar.gz")
set(MD5 "cd04f7bd275fedb97e8b583c115769e6")
elseif(PYTHON_VERSION MATCHES "3.8")
set(REQ_URL "https://gitee.com/mirrors/pybind11/repository/archive/v2.6.1.tar.gz")
set(MD5 "cd04f7bd275fedb97e8b583c115769e6")
elseif(PYTHON_VERSION MATCHES "3.7")
set(REQ_URL "https://gitee.com/mirrors/pybind11/repository/archive/v2.4.3.tar.gz")
set(MD5 "8f69438201bc824c63e5774bf8c1d422")
else()
message("Could not find 'Python 3.8' or 'Python 3.7' or 'Python 3.9'")
return()
endif()
else()
if(PYTHON_VERSION MATCHES "3.9")
set(REQ_URL "https://github.com/pybind/pybind11/archive/v2.6.1.tar.gz")
set(MD5 "32a7811f3db423df4ebfc731a28e5901")
elseif(PYTHON_VERSION MATCHES "3.8")
set(REQ_URL "https://github.com/pybind/pybind11/archive/v2.6.1.tar.gz")
set(MD5 "32a7811f3db423df4ebfc731a28e5901")
elseif(PYTHON_VERSION MATCHES "3.7")
set(REQ_URL "https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz")
set(MD5 "62254c40f89925bb894be421fe4cdef2")
else()
message("Could not find 'Python 3.8' or 'Python 3.7' or 'Python 3.9'")
return()
endif()
endif()
set(pybind11_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(pybind11_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if(PYTHON_VERSION MATCHES "3.9")
mindspore_add_pkg(pybind11
VER 2.6.1
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DPYBIND11_TEST=OFF -DPYBIND11_LTO_CXX_FLAGS=FALSE
)
elseif(PYTHON_VERSION MATCHES "3.8")
mindspore_add_pkg(pybind11
VER 2.6.1
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DPYBIND11_TEST=OFF -DPYBIND11_LTO_CXX_FLAGS=FALSE
)
else()
mindspore_add_pkg(pybind11
mindspore_add_pkg(pybind11
VER 2.4.3
URL ${REQ_URL}
MD5 ${MD5}
URL https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz
MD5 62254c40f89925bb894be421fe4cdef2
CMAKE_OPTION -DPYBIND11_TEST=OFF -DPYBIND11_LTO_CXX_FLAGS=FALSE
)
endif()
include_directories(${pybind11_INC})
find_package(pybind11 REQUIRED)
set_property(TARGET pybind11::module PROPERTY IMPORTED_GLOBAL TRUE)

View File

@ -1,22 +0,0 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/re2/repository/archive/2019-12-01.tar.gz")
set(MD5 "527eab0c75d6a1a0044c6eefd816b2fb")
else()
set(REQ_URL "https://github.com/google/re2/archive/2019-12-01.tar.gz")
set(MD5 "527eab0c75d6a1a0044c6eefd816b2fb")
endif()
if(NOT ENABLE_GLIBCXX)
set(re2_CXXFLAGS "${re2_CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
endif()
mindspore_add_pkg(re2
VER 20191201
LIBS re2
URL ${REQ_URL}
MD5 ${MD5}
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=TRUE)
include_directories(${re2_INC})
add_library(mindspore::re2 ALIAS re2::re2)

View File

@ -1,58 +1,25 @@
if(ENABLE_GITEE_EULER)
set(GIT_REPOSITORY "https://gitee.com/src-openeuler/sentencepiece.git")
set(GIT_TAG "master")
set(MD5 "4f88df28544b5f1a351f3dbf6b6413b8")
set(SENTENCEPIECE_SRC "${TOP_DIR}/build/mindspore/_deps/sentencepiece-src")
__download_pkg_with_git(sentencepiece ${GIT_REPOSITORY} ${GIT_TAG} ${MD5})
execute_process(COMMAND tar -xf ${SENTENCEPIECE_SRC}/v0.1.92.tar.gz --strip-components 1 -C ${SENTENCEPIECE_SRC})
else()
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/sentencepiece/repository/archive/v0.1.92.tar.gz")
set(MD5 "0fc99de9f09b9184398f49647791799f")
else()
set(REQ_URL "https://github.com/google/sentencepiece/archive/v0.1.92.tar.gz")
set(MD5 "5dfd2241914b5598a68b2a8542ed8e91")
endif()
endif()
if(WIN32)
set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-stringop-overflow \
-Wno-format-extra-args -Wno-format")
set(sentencepiece_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(sentencepiece
VER 0.1.92
LIBS sentencepiece sentencepiece_train
URL ${REQ_URL}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=ON -DSPM_ENABLE_SHARED=OFF
MD5 ${MD5}
)
else()
set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-sign-compare")
set(sentencepiece_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
if(ENABLE_GLIBCXX)
if (WIN32)
set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-stringop-overflow -Wno-format-extra-args -Wno-format")
set(sentencepiece_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(sentencepiece
VER 0.1.92
LIBS sentencepiece sentencepiece_train
URL ${REQ_URL}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_SHARED=OFF
-DPROTOBUF_INC=${protobuf_INC} -DCMAKE_CXX_STANDARD=11
MD5 ${MD5}
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sentencepiece/sentencepiece.patch001_cpu
)
else()
mindspore_add_pkg(sentencepiece
VER 0.1.92
LIBS sentencepiece sentencepiece_train
URL ${REQ_URL}
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_SHARED=OFF
-DPROTOBUF_INC=${protobuf_INC}
MD5 ${MD5}
PATCHES ${TOP_DIR}/third_party/patch/sentencepiece/sentencepiece.patch001
)
endif()
endif()
VER 0.1.92
LIBS sentencepiece sentencepiece_train
URL https://github.com/google/sentencepiece/archive/v0.1.92.tar.gz
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=ON
MD5 5dfd2241914b5598a68b2a8542ed8e91
)
else ()
set(sentencepiece_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -Wno-sign-compare")
set(sentencepiece_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(sentencepiece
VER 0.1.92
LIBS sentencepiece sentencepiece_train
URL https://github.com/google/sentencepiece/archive/v0.1.92.tar.gz
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=OFF -DSPM_ENABLE_SHARED=OFF -DPROTOBUF_INC=${protobuf_INC}
MD5 5dfd2241914b5598a68b2a8542ed8e91
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sentencepiece/sentencepiece.patch001
)
endif ()
include_directories(${sentencepiece_INC})
add_library(mindspore::sentencepiece ALIAS sentencepiece::sentencepiece)
add_library(mindspore::sentencepiece_train ALIAS sentencepiece::sentencepiece_train)
add_library(mindspore::sentencepiece_train ALIAS sentencepiece::sentencepiece_train)

View File

@ -1,40 +1,30 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/sqlite/repository/archive/version-3.36.0.tar.gz")
set(MD5 "715df9c2d2ccf6207158d6c087f711cf")
else()
set(REQ_URL "https://github.com/sqlite/sqlite/archive/version-3.36.0.tar.gz")
set(MD5 "715df9c2d2ccf6207158d6c087f711cf")
endif()
if(WIN32)
if (WIN32)
mindspore_add_pkg(sqlite
VER 3.36.0
VER 3.32.2
LIBS sqlite3
URL https://sqlite.org/2021/sqlite-amalgamation-3360000.zip
MD5 c5d360c74111bafae1b704721ff18fe6
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.windows.patch002
URL https://sqlite.org/2020/sqlite-amalgamation-3320200.zip
MD5 1eccea18d248eb34c7378b2b3f63f1db
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.windows.patch001
CMAKE_OPTION " "
)
else()
set(sqlite_USE_STATIC_LIBS ON)
else ()
set(sqlite_USE_STATIC_LIBS ON)
set(sqlite_CXXFLAGS)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \
-O2")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2")
else()
set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \
-D_FORTIFY_SOURCE=2 -O2")
set(sqlite_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 -O2")
endif()
set(sqlite_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
mindspore_add_pkg(sqlite
VER 3.36.0
VER 3.32.2
LIBS sqlite3
URL ${REQ_URL}
MD5 ${MD5}
URL https://github.com/sqlite/sqlite/archive/version-3.32.2.tar.gz
MD5 ea6d3b3289b4ac216fb06081a01ef101
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.patch001
CONFIGURE_COMMAND ./configure --enable-shared=no --disable-tcl --disable-editline --enable-json1)
endif()
endif ()
include_directories(${sqlite_INC})
add_library(mindspore::sqlite ALIAS sqlite::sqlite3)

View File

@ -1,24 +1,10 @@
set(tinyxml2_CXXFLAGS "-fstack-protector -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result")
set(tinyxml2_CFLAGS "-fstack-protector -D_FORTIFY_SOURCE=2 -O2")
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/tinyxml2/repository/archive/8.0.0.tar.gz")
set(MD5 "5dc535c8b34ee621fe2128f072d275b5")
else()
set(REQ_URL "https://github.com/leethomason/tinyxml2/archive/8.0.0.tar.gz")
set(MD5 "5dc535c8b34ee621fe2128f072d275b5")
endif()
if(NOT WIN32 AND NOT APPLE)
set(tinyxml2_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
endif()
set(tinyxml2_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result")
set(tinyxml2_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(tinyxml2
VER 8.0.0
LIBS tinyxml2
URL ${REQ_URL}
URL https://github.com/leethomason/tinyxml2/archive/8.0.0.tar.gz
CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release
MD5 ${MD5})
MD5 5dc535c8b34ee621fe2128f072d275b5)
include_directories(${tinyxml2_INC})
add_library(mindspore::tinyxml2 ALIAS tinyxml2::tinyxml2)

View File

@ -0,0 +1,10 @@
set(incubator_tvm_predict_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(incubator_tvm_predict_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
mindspore_add_pkg(incubator_tvm_predict
VER 0.6.0
HEAD_ONLY ./
URL https://github.com/apache/incubator-tvm/release/download/v0.6.0/apache-tvm-src-v0.6.0-incubating.tar.gz
MD5 2d77a005f0046d937b99c67de82f6438
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/predict/0001-RetBugFix-CustomRuntime_v06.patch)
include_directories(${incubator_tvm_predict_INC})
add_library(mindspore::incubator_tvm_predict ALIAS incubator_tvm_predict)

View File

@ -0,0 +1,5 @@
mindspore_add_pkg(zeromq
VER 4.1.4
HEAD_ONLY ./
URL https://raw.githubusercontent.com/mli/deps/master/build/zeromq-4.1.4.tar.gz
MD5 a611ecc93fffeb6d058c0e6edf4ad4fb)

View File

@ -1,16 +1,8 @@
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/zlib/repository/archive/v1.2.11.tar.gz")
set(MD5 "b0ecd8eda7c5d6ed9b4a4187363482fe")
else()
set(REQ_URL "https://github.com/madler/zlib/archive/v1.2.11.tar.gz")
set(MD5 "0095d2d2d1f3442ce1318336637b695f")
endif()
mindspore_add_pkg(zlib
VER 1.2.11
LIBS z
URL ${REQ_URL}
MD5 ${MD5}
URL https://github.com/madler/zlib/archive/v1.2.11.tar.gz
MD5 0095d2d2d1f3442ce1318336637b695f
CMAKE_OPTION -DCMAKE_BUILD_TYPE:STRING=Release)
include_directories(${zlib_INC})

View File

@ -1,361 +0,0 @@
set(CMAKE_THREAD_LIBS_INIT "-lpthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}" CACHE STRING "Expose CMAKE_GENERATOR" FORCE)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.3")
set(MODERN_CMAKE YES)
message(STATUS "Merging integrated CMake 3.18.3+ iOS toolchain(s) with this toolchain!")
endif()
# Get the Xcode version
execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}")
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()
if(NOT DEFINED PLATFORM)
if(CMAKE_OSX_ARCHITECTURES)
if(CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*" AND CMAKE_OSX_SYSROOT MATCHES ".*iphoneos.*")
set(PLATFORM "OS")
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_SYSROOT MATCHES ".*iphonesimulator.*")
set(PLATFORM "SIMULATOR")
endif()
endif()
if(NOT PLATFORM)
set(PLATFORM "OS")
endif()
endif()
set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.")
if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
set(PLATFORM_INT "OS64")
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
set(PLATFORM_INT "SIMULATOR64")
message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
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)
else()
set(ARCHS arm64)
endif()
endif()
elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
set(SDK_NAME iphoneos)
if(MODERN_CMAKE)
if(NOT ARCHS)
if(XCODE_VERSION VERSION_GREATER 10.0)
set(ARCHS arm64 x86_64)
else()
set(ARCHS arm64 x86_64)
endif()
endif()
else()
message(FATAL_ERROR "Please make sure that you are running CMake 3.18.3+ to make the OS64COMBINED setting work")
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")
message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
endif()
execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path
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.")
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
"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)
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT} for platform: ${PLATFORM_INT}")
set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
endif()
if(USED_CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "")
endif()
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)
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})
# 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})
# 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)
if(NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT} PATH)
get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH)
if(NOT DEFINED CMAKE_DEVELOPER_ROOT)
message(FATAL_ERROR "Invalid CMAKE_DEVELOPER_ROOT: "
"${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)
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)
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)
message(STATUS "Using libtool: ${BUILD_LIBTOOL}")
set(CMAKE_C_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
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)
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)
if(MODERN_CMAKE)
if(SDK_NAME MATCHES "iphone")
set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
endif()
if(PLATFORM_INT MATCHES ".*COMBINED")
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO CACHE INTERNAL "" ${FORCE_CACHE})
set(CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${FORCE_CACHE})
message(STATUS "Will combine built (static) artifacts into FAT lib...")
endif()
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 "")
set(IOS TRUE CACHE BOOL "")
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")
set(CMAKE_SHARED_MODULE_SUFFIX ".so")
set(CMAKE_C_COMPILER_ABI ELF)
set(CMAKE_CXX_COMPILER_ABI ELF)
set(CMAKE_C_HAS_ISYSROOT 1)
set(CMAKE_CXX_HAS_ISYSROOT 1)
set(CMAKE_MODULE_EXISTS 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
set(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
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)
set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
set(CMAKE_SYSTEM_PROCESSOR "arm")
message(STATUS "Using a data_ptr size of 4")
endif()
message(STATUS "Building for minimum ${SDK_NAME} version: ${DEPLOYMENT_TARGET} (SDK version: ${SDK_VERSION})")
if(PLATFORM_INT STREQUAL "OS" OR PLATFORM_INT STREQUAL "OS64")
if(XCODE_VERSION VERSION_LESS 7.0)
set(SDK_NAME_VERSION_FLAGS "-mios-version-min=${DEPLOYMENT_TARGET}")
else()
set(SDK_NAME_VERSION_FLAGS "-m${SDK_NAME}-version-min=${DEPLOYMENT_TARGET}")
endif()
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})
if(ENABLE_BITCODE_INT)
set(BITCODE "-fembed-bitcode")
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE bitcode CACHE INTERNAL "")
message(STATUS "Enabling bitcode support.")
else()
set(BITCODE "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO CACHE INTERNAL "")
message(STATUS "Disabling bitcode support.")
endif()
if(ENABLE_ARC_INT)
set(FOBJC_ARC "-fobjc-arc")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES CACHE INTERNAL "")
message(STATUS "Enabling ARC support.")
else()
set(FOBJC_ARC "-fno-objc-arc")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC NO CACHE INTERNAL "")
message(STATUS "Disabling ARC support.")
endif()
if(NOT ENABLE_VISIBILITY_INT)
set(VISIBILITY "-fvisibility=hidden")
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES CACHE INTERNAL "")
message(STATUS "Hiding symbols (-fvisibility=hidden).")
else()
set(VISIBILITY "")
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN NO CACHE INTERNAL "")
endif()
if(USED_CMAKE_GENERATOR MATCHES "Xcode")
message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
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}
-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}")
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)
foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "")
endforeach()
endif()
set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
set(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
set(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
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")
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})
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()

View File

@ -1,14 +1,13 @@
set(SECURE_CXX_FLAGS "")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(WIN32)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (WIN32)
set(SECURE_CXX_FLAGS "-fstack-protector-all")
else()
set(SECURE_CXX_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
set(SECURE_CXX_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
endif()
endif()
set(_ms_tmp_CMAKE_CXX_FLAGS_F ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
set(TOP_DIR ${CMAKE_SOURCE_DIR})
include(cmake/utils.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/eigen.cmake)
@ -16,13 +15,18 @@ include(${CMAKE_SOURCE_DIR}/cmake/external_libs/json.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/dependency_securec.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/protobuf.cmake)
if(MS_BUILD_GRPC)
SET(MS_BUILD_GRPC 0)
if (ENABLE_DEBUGGER OR ENABLE_SERVING OR ENABLE_TESTCASES)
SET(MS_BUILD_GRPC 1)
endif()
if (ENABLE_MINDDATA AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(MS_BUILD_GRPC 1)
endif()
if ("${MS_BUILD_GRPC}")
# build dependencies of gRPC
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/openssl.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/absl.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/c-ares.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/zlib.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/re2.cmake)
# build gRPC
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/grpc.cmake)
# build event
@ -35,37 +39,40 @@ include(${CMAKE_SOURCE_DIR}/cmake/external_libs/flatbuffers.cmake)
if(USE_GLOG)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/glog.cmake)
endif()
if (ENABLE_CPU AND (ENABLE_D OR ENABLE_GPU))
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/zeromq.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/pslite.cmake)
endif()
find_package(Python3)
include_directories(${Python3_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/third_party)
if(ENABLE_MPI)
if (ENABLE_MPI)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/ompi.cmake)
endif()
if(ENABLE_CPU)
if (ENABLE_CPU)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/mkl_dnn.cmake)
endif()
if(ENABLE_GPU)
if(ENABLE_MPI)
if (ENABLE_GPU)
if (ENABLE_MPI)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/nccl.cmake)
endif()
endif()
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
if (ENABLE_GE)
include_directories(${CMAKE_SOURCE_DIR}/third_party/ge/include)
include_directories(${CMAKE_SOURCE_DIR}/third_party/ge/include/external)
include_directories(${CMAKE_SOURCE_DIR}/third_party/ge/include/external/graph)
elseif(ENABLE_D OR ENABLE_TESTCASES)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/ops)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/framework)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/aicpu)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/toolchain)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external/graph)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/external/graph)
endif()
if(ENABLE_MINDDATA)
if (ENABLE_MINDDATA)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/icu4c.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/libtiff.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/opencv.cmake)
@ -75,12 +82,10 @@ if(ENABLE_MINDDATA)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/sentencepiece.cmake)
endif()
if(ENABLE_MINDDATA)
if (ENABLE_MINDDATA OR ENABLE_SERVING)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/jpeg_turbo.cmake)
endif()
if(ENABLE_TESTCASES OR ENABLE_CPP_ST)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/gtest.cmake)
endif()
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/gtest.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/onnx.cmake)
set(CMAKE_CXX_FLAGS ${_ms_tmp_CMAKE_CXX_FLAGS_F})

View File

@ -1,169 +1,125 @@
option(ENABLE_D "Enable d" OFF)
option(ENABLE_GPU "Enable gpu" OFF)
option(ENABLE_CPU "Enable cpu" OFF)
option(ENABLE_GE "Enable graph engine as backend to execute" OFF)
option(ENABLE_MINDDATA "Enable minddata compile" OFF)
option(ENABLE_TRAIN "Enable ge train, default off(only infer)" OFF)
option(ENABLE_TESTCASES "Run testcases switch, default off" OFF)
option(ENABLE_CPP_ST "Run cpp st testcases switch, default off" OFF)
option(DEBUG_MODE "Debug mode, default off" OFF)
option(ENABLE_ASAN "Enable Google Sanitizer to find memory bugs")
option(ENABLE_LOAD_ANF_IR "Enable load ANF-IR as input of 'infer' stage of pipeline" OFF)
option(ENABLE_COVERAGE "Enable code coverage report" OFF)
option(USE_GLOG "Use glog to output log" OFF)
option(ENABLE_SECURITY "Enable security, maintenance function will be disabled, default off" OFF)
option(ENABLE_PROFILE "Enable pipeline profile, default off" OFF)
option(ENABLE_TIMELINE "Enable time line record" OFF)
option(ENABLE_DUMP_PROTO "Enable dump anf graph to file in ProtoBuffer format, default on" ON)
option(ENABLE_DUMP_IR "Enable dump function graph ir, default on" ON)
option(ENABLE_DUMP_E2E "Enable dump e2e file, default on" OFF)
option(ENABLE_DUMP_IR "Enable dump funciton graph ir, default on" ON)
option(ENABLE_MPI "enable mpi" OFF)
option(ENABLE_AKG "enable akg" OFF)
option(ENABLE_DEBUGGER "enable debugger" OFF)
option(ENABLE_IBVERBS "enable IBVERBS for parameter server" OFF)
option(ENABLE_PYTHON "Enable python" ON)
option(ENABLE_ACL "enable acl" OFF)
option(ENABLE_GLIBCXX "enable_glibcxx" OFF)
option(MODE_ASCEND_ALL "supports all ascend platform" OFF)
option(MODE_ASCEND_ACL "supports ascend acl mode only" OFF)
option(ENABLE_SYM_FILE "enable sym file" OFF)
option(BUILD_DEV_MODE "MindSpore build nightly dev mode" OFF)
option(ENABLE_FAST_HASH_TABLE "Enable use fast hash table instead of std ones" ON)
option(USE_LLVM "use llvm" OFF)
option(USE_MS_THREADPOOL_FOR_DNNL "use ms threadpool for onednn ops" ON)
if(NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
set(USE_MS_THREADPOOL_FOR_DNNL OFF)
endif()
if(NOT ENABLE_D AND NOT ENABLE_TESTCASES AND NOT ENABLE_ACL)
set(ENABLE_GLIBCXX ON)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (WIN32)
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fstack-protector-all")
else()
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -Wsign-compare")
endif()
if(ENABLE_COVERAGE)
if (ENABLE_COVERAGE)
set(COVERAGE_COMPILER_FLAGS "-g --coverage -fprofile-arcs -ftest-coverage")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
endif()
if(ENABLE_ASAN)
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer")
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -static-libsan")
if (ENABLE_ASAN)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fsanitize=undefined")
else()
set(OPTION_CXX_FLAGS "${OPTION_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libsan -fsanitize=undefined")
endif()
endif()
if(DEBUG_MODE)
if (DEBUG_MODE)
set(CMAKE_BUILD_TYPE "Debug")
add_compile_definitions(MEM_REUSE_DEBUG)
else()
set(CMAKE_BUILD_TYPE "Release")
endif()
if((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") OR (CMAKE_BUILD_TYPE STREQUAL Release))
if ((CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") OR (CMAKE_BUILD_TYPE STREQUAL Release))
set(PYBIND11_LTO_CXX_FLAGS FALSE)
endif()
if(NOT BUILD_PATH)
if (NOT BUILD_PATH)
set(BUILD_PATH "${CMAKE_SOURCE_DIR}/build")
endif()
if(ENABLE_D)
if (ENABLE_GE OR ENABLE_D)
set(ENABLE_TDTQUE ON)
endif()
if(ENABLE_GPU)
if (ENABLE_GPU)
set(ENABLE_GPUQUE ON)
add_compile_definitions(ENABLE_GPU_COLLECTIVE)
endif()
if(ENABLE_CPU)
if (ENABLE_CPU)
add_compile_definitions(ENABLE_CPU)
endif()
if(ENABLE_D)
add_compile_definitions(ENABLE_D)
if (ENABLE_GE)
add_compile_definitions(ENABLE_GE)
add_compile_definitions(CUSTOM_OP)
endif()
if(ENABLE_TRAIN)
add_compile_definitions(ENABLE_TRAIN=1)
else()
add_compile_definitions(ENABLE_TRAIN=0)
endif()
if(USE_GLOG)
add_compile_definitions(USE_GLOG)
endif()
if(ENABLE_PROFILE)
if (ENABLE_PROFILE)
add_compile_definitions(ENABLE_PROFILE)
endif()
if(ENABLE_SECURITY)
add_compile_definitions(ENABLE_SECURITY)
endif()
if(ENABLE_TIMELINE)
if (ENABLE_TIMELINE)
add_compile_definitions(ENABLE_TIMELINE)
endif()
if(ENABLE_LOAD_ANF_IR)
if (ENABLE_LOAD_ANF_IR)
add_compile_definitions(ENABLE_LOAD_ANF_IR)
endif()
if(ENABLE_TESTCASES)
add_compile_definitions(ENABLE_TEST)
endif()
if(ENABLE_TESTCASES OR (NOT ENABLE_D))
if (ENABLE_TESTCASES OR (NOT ENABLE_D AND NOT ENABLE_GE))
add_compile_definitions(NO_DLIB=1)
endif()
if(ENABLE_DUMP_IR)
add_compile_definitions(ENABLE_DUMP_IR)
endif()
endif(ENABLE_DUMP_IR)
if(ENABLE_MINDDATA)
add_compile_definitions(ENABLE_MINDDATA)
if(ENABLE_TDTQUE)
if (ENABLE_TDTQUE)
add_compile_definitions(ENABLE_TDTQUE)
endif()
endif()
if(ENABLE_DUMP_E2E)
add_compile_definitions(ENABLE_DUMP_E2E)
endif()
if(ENABLE_DEBUGGER)
add_compile_definitions(ENABLE_DEBUGGER)
endif()
if(ENABLE_DEBUGGER OR ENABLE_TESTCASES)
set(MS_BUILD_GRPC ON)
endif()
if(ENABLE_MINDDATA AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
set(MS_BUILD_GRPC ON)
endif()
if(ENABLE_D AND ENABLE_ACL)
set(MODE_ASCEND_ALL ON)
endif()
if(ENABLE_ACL AND NOT ENABLE_D)
set(MODE_ASCEND_ACL ON)
endif()
if(ENABLE_CPU AND NOT WIN32)
add_compile_definitions(ENABLE_ARMOUR)
endif()
if(ENABLE_AKG AND CMAKE_SYSTEM_NAME MATCHES "Linux")
add_compile_definitions(ENABLE_AKG)
endif()
if(USE_LLVM)
add_compile_definitions(USE_LLVM)
endif()
if(USE_MS_THREADPOOL_FOR_DNNL)
add_compile_definitions(USE_MS_THREADPOOL_FOR_DNNL)
endif()

View File

@ -5,69 +5,46 @@ include(GNUInstallDirs)
# set package information
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_GENERATOR "External")
set(CPACK_CMAKE_GENERATOR "Ninja")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT ${CMAKE_SOURCE_DIR}/cmake/package_script.cmake)
set(CPACK_EXTERNAL_ENABLE_STAGING true)
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME ${BUILD_PATH}/package/mindspore)
set(CPACK_TEMPORARY_INSTALL_DIRECTORY ${BUILD_PATH}/package/mindspore)
set(CPACK_PACK_ROOT_DIR ${BUILD_PATH}/package/)
set(CPACK_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(CPACK_ENABLE_SYM_FILE ${ENABLE_SYM_FILE})
set(CPACK_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
set(CPACK_PYTHON_EXE ${Python3_EXECUTABLE})
set(CPACK_PYTHON_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if(ENABLE_GPU)
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME ${CMAKE_SOURCE_DIR}/build/package/mindspore)
set(CPACK_TEMPORARY_INSTALL_DIRECTORY ${CMAKE_SOURCE_DIR}/build/package/mindspore)
if (ENABLE_GE)
set(CPACK_MS_BACKEND "ge")
set(CPACK_MS_PACKAGE_NAME "mindspore")
elseif (ENABLE_GPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "gpu or cpu")
if(BUILD_DEV_MODE)
# providing cuda11 version of dev package only
set(CPACK_MS_PACKAGE_NAME "mindspore-cuda11-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-gpu")
endif()
elseif(ENABLE_D)
set(CPACK_MS_PACKAGE_NAME "mindspore-gpu")
elseif (ENABLE_D)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "ascend or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend")
endif()
elseif(ENABLE_CPU)
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend")
elseif (ENABLE_CPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
elseif(ENABLE_ACL)
set(CPACK_MS_PACKAGE_NAME "mindspore")
else ()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore-ascend")
endif()
else()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
endif()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif ()
include(CPack)
# set install path
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
set(INSTALL_PY_DIR ".")
set(INSTALL_BASE_DIR ".")
set(INSTALL_BIN_DIR "bin")
set(INSTALL_CFG_DIR "config")
set(INSTALL_LIB_DIR "lib")
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
set(INSTALL_LIB_DIR ".")
set(onednn_LIBPATH ${onednn_LIBPATH}/../bin/)
set(glog_LIBPATH ${glog_LIBPATH}/../bin/)
set(opencv_LIBPATH ${opencv_LIBPATH}/../bin/)
set(jpeg_turbo_LIBPATH ${jpeg_turbo_LIBPATH}/../bin/)
set(sqlite_LIBPATH ${sqlite_LIBPATH}/../bin/)
set(tinyxml2_LIBPATH ${tinyxml2_LIBPATH}/../bin/)
set(sentencepiece_LIBPATH ${sentencepiece_LIBPATH}/../bin/)
else ()
set(INSTALL_LIB_DIR "lib")
endif ()
# set package files
install(
TARGETS _c_expression
@ -75,199 +52,160 @@ install(
COMPONENT mindspore
)
if(ENABLE_DEBUGGER)
install(
TARGETS mindspore_gvar
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if (USE_GLOG)
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libglog*)
install(
TARGETS _mindspore_offline_debug
DESTINATION ${INSTALL_BASE_DIR}
FILES ${GLOG_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif ()
install(
TARGETS mindspore_shared_lib
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mindspore_core mindspore_common mindspore_backend
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(USE_GLOG)
install(FILES ${glog_LIBPATH}/libmindspore_glog.so.0.4.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_glog.so.0 COMPONENT mindspore)
endif()
install(FILES ${libevent_LIBPATH}/libevent-2.1.so.7.0.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libevent-2.1.so.7 COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_core-2.1.so.7.0.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libevent_core-2.1.so.7 COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_extra-2.1.so.7.0.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libevent_extra-2.1.so.7 COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_openssl-2.1.so.7.0.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libevent_openssl-2.1.so.7 COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_pthreads-2.1.so.7.0.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libevent_pthreads-2.1.so.7 COMPONENT mindspore)
if(ENABLE_MINDDATA)
if (ENABLE_MINDDATA)
install(
TARGETS _c_dataengine _c_mindrecord
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
install(
TARGETS cache_admin cache_server
OPTIONAL
DESTINATION ${INSTALL_BIN_DIR}
COMPONENT mindspore
file(GLOB_RECURSE OPENCV_LIB_LIST
${opencv_LIBPATH}/libopencv_core*
${opencv_LIBPATH}/libopencv_imgcodecs*
${opencv_LIBPATH}/libopencv_imgproc*
)
install(
FILES ${OPENCV_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE TINYXML2_LIB_LIST
${tinyxml2_LIBPATH}/libtinyxml2*
)
install(
FILES ${TINYXML2_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE SENTENCEPIECE_LIB_LIST
${sentencepiece_LIBPATH}/libsentencepiece*
)
install(
FILES ${SENTENCEPIECE_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
message("icu4c does not support windows system temporarily")
else()
file(GLOB_RECURSE ICU4C_LIB_LIST
${icu4c_LIBPATH}/libicuuc*
${icu4c_LIBPATH}/libicudata*
${icu4c_LIBPATH}/libicui18n*
)
endif()
install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.2
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_core.so.4.5 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.2
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgcodecs.so.4.5 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.2
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgproc.so.4.5 COMPONENT mindspore)
install(FILES ${tinyxml2_LIBPATH}/libtinyxml2.so.8.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libtinyxml2.so.8 COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicuuc.so.69.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libicuuc.so.69 COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicudata.so.69.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libicudata.so.69 COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicui18n.so.69.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libicui18n.so.69 COMPONENT mindspore)
endif()
if(ENABLE_CPU)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
install(FILES ${onednn_LIBPATH}/libdnnl.so.2.2
DESTINATION ${INSTALL_LIB_DIR} RENAME libdnnl.so.2 COMPONENT mindspore)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl*${CMAKE_SHARED_LIBRARY_SUFFIX}*)
install(
FILES ${DNNL_LIB_LIST}
FILES ${ICU4C_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif ()
if (ENABLE_CPU)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl${CMAKE_SHARED_LIBRARY_SUFFIX}*)
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl*${CMAKE_SHARED_LIBRARY_SUFFIX}*)
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/dnnl.dll)
endif ()
install(
TARGETS nnacl
FILES ${DNNL_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif ()
if(ENABLE_MPI)
if(ENABLE_GPU)
if (ENABLE_MPI)
if (ENABLE_GPU)
install(
TARGETS _ms_mpi
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CPU)
endif ()
if (ENABLE_CPU)
install(
TARGETS mpi_adapter
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mpi_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_D)
install(
TARGETS _ascend_mpi
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
endif()
endif()
endif ()
endif ()
if(ENABLE_GPU)
if(ENABLE_MPI)
if (ENABLE_GPU)
if (ENABLE_MPI)
install(
TARGETS gpu_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS nvidia_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
install(FILES ${nccl_LIBPATH}/libnccl.so.2.7.6 DESTINATION ${INSTALL_LIB_DIR}
RENAME libnccl.so.2 COMPONENT mindspore)
endif()
endif()
endif ()
install(
TARGETS gpu_queue
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS cuda_ops
endif ()
if (ENABLE_SERVING OR ENABLE_TESTCASES)
file(GLOB_RECURSE LIBEVENT_LIB_LIST
${libevent_LIBPATH}/libevent*
${libevent_LIBPATH}/libevent_pthreads*
)
endif ()
if (NOT ENABLE_GE)
if (ENABLE_D)
if (DEFINED ENV{ASCEND_CUSTOM_PATH})
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
else ()
set(ASCEND_PATH /usr/local/Ascend)
endif ()
set(ASCEND_DRIVER_PATH ${ASCEND_PATH}/driver/lib64/common)
set(ASCEND_FWK_PATH ${ASCEND_PATH}/fwkacllib/lib64)
install(
FILES
${CMAKE_BINARY_DIR}/graphengine/src/common/graph/libgraph.so
${CMAKE_BINARY_DIR}/graphengine/src/ge/common/libge_common.so
${CMAKE_BINARY_DIR}/graphengine/src/ge/ge_runtime/libge_runtime.so
${ASCEND_DRIVER_PATH}/libslog.so
${ASCEND_DRIVER_PATH}/libc_sec.so
${ASCEND_FWK_PATH}/liberror_manager.so
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_D)
if(ENABLE_MPI)
install(
TARGETS ascend_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif()
if(ENABLE_CPU AND NOT WIN32)
install(
TARGETS ps_cache
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_D OR ENABLE_ACL)
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
set(ASCEND_PATH $ENV{ASCEND_CUSTOM_PATH})
else()
set(ASCEND_PATH /usr/local/Ascend)
endif()
set(ASCEND_DRIVER_PATH ${ASCEND_PATH}/driver/lib64/common)
if(ENABLE_D)
elseif (ENABLE_TESTCASES)
install(
TARGETS hccl_plugin
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
FILES
${CMAKE_BINARY_DIR}/graphengine/src/common/graph/libgraph.so
${CMAKE_SOURCE_DIR}/graphengine/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR}/libslog.so
${CMAKE_SOURCE_DIR}/graphengine/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR}/liberror_manager.so
${CMAKE_SOURCE_DIR}/build/graphengine/libc_sec.so
${LIBEVENT_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif()
endif ()
endif ()
if(MS_BUILD_GRPC)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc++.so.1.36.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc++.so.1 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_gpr.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_gpr.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_upb.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_upb.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_address_sorting.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_address_sorting.so.15 COMPONENT mindspore)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
file(GLOB CXX_LIB_LIST ${CXX_DIR}/*.dll)
@ -281,18 +219,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CLOUD_AND_LITE)
install(
TARGETS mindspore-lite mslite_converter_plugin
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif ()
# set python files
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py)
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/*.py)
install(
FILES ${MS_PY_LIST}
DESTINATION ${INSTALL_PY_DIR}
@ -301,92 +231,60 @@ install(
install(
DIRECTORY
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/nn
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/_extends
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/parallel
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/mindrecord
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/numpy
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/scipy
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/train
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/boost
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/common
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/ops
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/communication
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/profiler
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/compression
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/rewrite
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/run_check
${CMAKE_SOURCE_DIR}/mindspore/nn
${CMAKE_SOURCE_DIR}/mindspore/_extends
${CMAKE_SOURCE_DIR}/mindspore/parallel
${CMAKE_SOURCE_DIR}/mindspore/mindrecord
${CMAKE_SOURCE_DIR}/mindspore/train
${CMAKE_SOURCE_DIR}/mindspore/common
${CMAKE_SOURCE_DIR}/mindspore/ops
${CMAKE_SOURCE_DIR}/mindspore/communication
${CMAKE_SOURCE_DIR}/mindspore/profiler
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
if(ENABLE_AKG AND CMAKE_SYSTEM_NAME MATCHES "Linux")
set (AKG_PATH ${BUILD_PATH}/mindspore/akg)
file(REMOVE_RECURSE ${AKG_PATH}/_akg)
file(MAKE_DIRECTORY ${AKG_PATH}/_akg)
file(TOUCH ${AKG_PATH}/_akg/__init__.py)
install(DIRECTORY "${AKG_PATH}/akg" DESTINATION "${AKG_PATH}/_akg")
if ((ENABLE_D OR ENABLE_GPU) AND ENABLE_AKG)
set (AKG_PATH ${CMAKE_SOURCE_DIR}/build/mindspore/akg)
install(
DIRECTORY
${AKG_PATH}/_akg
DESTINATION ${INSTALL_PY_DIR}/
${AKG_PATH}/akg
DESTINATION ${INSTALL_PY_DIR}/..
COMPONENT mindspore
)
endif()
endif ()
if(EXISTS ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset)
if (EXISTS ${CMAKE_SOURCE_DIR}/mindspore/dataset)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/dataset
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
endif()
endif ()
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
message("offline debugger does not support windows system temporarily")
else()
if(EXISTS ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/offline_debug)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/offline_debug
DESTINATION ${INSTALL_PY_DIR}
if (ENABLE_SERVING)
install(
TARGETS ms_serving
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
install(
FILES ${CMAKE_SOURCE_DIR}/build/mindspore/serving/ms_service_pb2.py
${CMAKE_SOURCE_DIR}/build/mindspore/serving/ms_service_pb2_grpc.py
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
install(
TARGETS inference
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
FILES ${LIBEVENT_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif()
## Public header files
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
## Public header files for minddata
install(
FILES ${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/config.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/constants.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/execute.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/text.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/transforms.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_lite.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
DESTINATION ${INSTALL_BASE_DIR}/include/dataset
COMPONENT mindspore
)
install(
FILES
${CMAKE_SOURCE_DIR}/mindspore/core/mindapi/base/format.h
${CMAKE_SOURCE_DIR}/mindspore/core/mindapi/base/type_id.h
${CMAKE_SOURCE_DIR}/mindspore/core/mindapi/base/types.h
DESTINATION ${INSTALL_BASE_DIR}/include/mindapi/base
COMPONENT mindspore)
## config files
install(
FILES ${CMAKE_SOURCE_DIR}/config/op_info.config
DESTINATION ${INSTALL_CFG_DIR}
COMPONENT mindspore
)
)
endif ()

File diff suppressed because it is too large Load Diff

View File

@ -1,249 +0,0 @@
# include dependency
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
# set package information
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_GENERATOR "External")
set(CPACK_CMAKE_GENERATOR "Ninja")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT ${CMAKE_SOURCE_DIR}/cmake/package_script.cmake)
set(CPACK_EXTERNAL_ENABLE_STAGING true)
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME ${BUILD_PATH}/package/mindspore)
set(CPACK_TEMPORARY_INSTALL_DIRECTORY ${BUILD_PATH}/package/mindspore)
set(CPACK_PACK_ROOT_DIR ${BUILD_PATH}/package/)
set(CPACK_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(CPACK_ENABLE_SYM_FILE ${ENABLE_SYM_FILE})
set(CPACK_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
set(CPACK_PYTHON_EXE ${Python3_EXECUTABLE})
set(CPACK_PYTHON_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
set(CPACK_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
if(ENABLE_CPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
else()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore-dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
endif()
include(CPack)
# set install path
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
set(INSTALL_PY_DIR ".")
set(INSTALL_BASE_DIR ".")
set(INSTALL_BIN_DIR "bin")
set(INSTALL_CFG_DIR "config")
set(INSTALL_LIB_DIR "lib")
# set package files
install(
TARGETS _c_expression
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
if(ENABLE_DEBUGGER)
install(
TARGETS _mindspore_offline_debug
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
endif()
install(
TARGETS mindspore_shared_lib
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mindspore_core mindspore_common mindspore_backend
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(USE_GLOG)
install(FILES ${glog_LIBPATH}/libmindspore_glog.0.4.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_glog.0.dylib COMPONENT mindspore)
endif()
install(FILES ${libevent_LIBPATH}/libevent-2.1.7.dylib
DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_core-2.1.7.dylib
DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_extra-2.1.7.dylib
DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_openssl-2.1.7.dylib
DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore)
install(FILES ${libevent_LIBPATH}/libevent_pthreads-2.1.7.dylib
DESTINATION ${INSTALL_LIB_DIR} COMPONENT mindspore)
if(ENABLE_CPU AND NOT WIN32)
install(
TARGETS ps_cache
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(MS_BUILD_GRPC)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc++.1.36.1.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc++.1.dylib COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc.15.0.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc.15.dylib COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_gpr.15.0.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_gpr.15.dylib COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_upb.15.0.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_upb.15.dylib COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_address_sorting.15.0.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_address_sorting.15.dylib COMPONENT mindspore)
endif()
if(ENABLE_MINDDATA)
install(
TARGETS _c_dataengine _c_mindrecord
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
install(FILES ${opencv_LIBPATH}/libopencv_core.4.5.2.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_core.4.5.dylib COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.4.5.2.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgcodecs.4.5.dylib COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgproc.4.5.2.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgproc.4.5.dylib COMPONENT mindspore)
install(FILES ${tinyxml2_LIBPATH}/libtinyxml2.8.0.0.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libtinyxml2.8.dylib COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicuuc.69.1.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libicuuc.69.dylib COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicudata.69.1.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libicudata.69.dylib COMPONENT mindspore)
install(FILES ${icu4c_LIBPATH}/libicui18n.69.1.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libicui18n.69.dylib COMPONENT mindspore)
endif()
if(ENABLE_CPU)
install(FILES ${onednn_LIBPATH}/libdnnl.2.2.dylib
DESTINATION ${INSTALL_LIB_DIR} RENAME libdnnl.2.dylib COMPONENT mindspore)
install(
TARGETS nnacl
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_MPI)
if(ENABLE_GPU)
install(
TARGETS _ms_mpi
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CPU)
install(
TARGETS mpi_adapter
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif()
if(ENABLE_GPU)
if(ENABLE_MPI)
install(
TARGETS gpu_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
install(
TARGETS gpu_queue
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
# set python files
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py)
install(
FILES ${MS_PY_LIST}
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
install(
DIRECTORY
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/nn
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/_extends
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/parallel
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/mindrecord
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/numpy
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/scipy
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/train
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/boost
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/common
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/ops
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/communication
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/profiler
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/compression
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/rewrite
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/run_check
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
if(EXISTS ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
endif()
if(EXISTS ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/offline_debug)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/offline_debug
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
endif()
## Public header files
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
## Public header files for minddata
install(
FILES ${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/config.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/constants.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/execute.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/text.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/transforms.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_lite.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
DESTINATION ${INSTALL_BASE_DIR}/include/dataset
COMPONENT mindspore
)
## config files
install(
FILES ${CMAKE_SOURCE_DIR}/config/op_info.config
DESTINATION ${INSTALL_CFG_DIR}
COMPONENT mindspore
)

View File

@ -1,64 +1,55 @@
# find exec
find_package(Python3 3.7 COMPONENTS Interpreter Development)
if (NOT Python3_FOUND)
message(FATAL_ERROR "No python3 found.")
endif ()
set(PYTHON ${Python3_EXECUTABLE})
set(PYTHON_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if (NOT PYTHON_VERSION MATCHES "3.7")
message(FATAL_ERROR "FIND PYTHON VERSION ${PYTHON_VERSION} BUT CAN NOT MATCH PYTHON VERSION 3.7")
endif ()
find_package(Git)
if(NOT GIT_FOUND)
if (NOT GIT_FOUND)
message("No git found.")
return()
endif()
return ()
endif ()
set(GIT ${GIT_EXECUTABLE})
# set path
set(MS_ROOT_DIR ${CPACK_CMAKE_SOURCE_DIR})
set(MS_PACK_ROOT_DIR ${CPACK_PACK_ROOT_DIR})
set(PYTHON ${CPACK_PYTHON_EXE})
set(PYTHON_VERSION ${CPACK_PYTHON_VERSION})
if(NOT (PYTHON_VERSION MATCHES "3.9" OR PYTHON_VERSION MATCHES "3.8" OR PYTHON_VERSION MATCHES "3.7"))
message(FATAL_ERROR "FIND PYTHON VERSION ${PYTHON_VERSION} BUT CAN NOT MATCH PYTHON VERSION 3.9 OR 3.8 OR 3.7")
endif()
set(MS_ROOT_DIR ${CPACK_PACKAGE_DIRECTORY}/../../)
set(MS_PACK_ROOT_DIR ${MS_ROOT_DIR}/build/package)
# set package file name
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(PYTHON_VERSION MATCHES "3.9")
set(PY_TAGS "cp39-cp39")
elseif(PYTHON_VERSION MATCHES "3.8")
set(PY_TAGS "cp38-cp38")
elseif(PYTHON_VERSION MATCHES "3.7")
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
if (PYTHON_VERSION MATCHES "3.7")
set(PY_TAGS "cp37-cp37m")
else()
message("Could not find 'Python 3.9' OR 'Python 3.8' or 'Python 3.7'")
else ()
message("Could not find 'Python 3.7'")
return()
endif()
endif ()
string(TOLOWER linux_${CMAKE_HOST_SYSTEM_PROCESSOR} PLATFORM_TAG)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(PYTHON_VERSION MATCHES "3.9")
set(PY_TAGS "cp39-cp39")
elseif(PYTHON_VERSION MATCHES "3.8")
set(PY_TAGS "cp38-cp38")
elseif(PYTHON_VERSION MATCHES "3.7")
set(PY_TAGS "cp37-cp37m")
else()
message("Could not find 'Python 3.9' OR 'Python 3.8' or 'Python 3.7'")
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
if (PYTHON_VERSION MATCHES "3.7")
set(PY_TAGS "py37-none")
else ()
message("Could not find 'Python 3.7'")
return()
endif()
string(REGEX MATCH "[0-9]+.[0-9]+" MACOSX_SDK_VERSION "${CPACK_OSX_DEPLOYMENT_TARGET}")
string(REPLACE "." "_" MACOSX_PACKAGE_VERSION "${MACOSX_SDK_VERSION}")
string(TOLOWER macosx_${MACOSX_PACKAGE_VERSION}_${CMAKE_HOST_SYSTEM_PROCESSOR} PLATFORM_TAG)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
if(PYTHON_VERSION MATCHES "3.9")
set(PY_TAGS "cp39-cp39")
elseif(PYTHON_VERSION MATCHES "3.8")
set(PY_TAGS "cp38-cp38")
elseif(PYTHON_VERSION MATCHES "3.7")
endif ()
set(PLATFORM_TAG "any")
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
if (PYTHON_VERSION MATCHES "3.7")
set(PY_TAGS "cp37-cp37m")
else()
message("Could not find 'Python 3.9' OR 'Python 3.8' or 'Python 3.7'")
else ()
message("Could not find 'Python 3.7'")
return()
endif()
endif ()
set(PLATFORM_TAG "win_amd64")
else()
else ()
message(FATAL_ERROR "other platform: ${CMAKE_SYSTEM_NAME}")
endif()
endif ()
# get git commit id
set(GIT_COMMIT_ID "")
@ -70,58 +61,9 @@ execute_process(
string(REPLACE " " "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
set(ENV{BACKEND_POLICY} ${CPACK_MS_BACKEND})
set(ENV{BACKEND_TARGET} ${CPACK_MS_TARGET})
set(ENV{MS_PACKAGE_NAME} ${CPACK_MS_PACKAGE_NAME})
set(ENV{COMMIT_ID} ${GIT_COMMIT_ID})
file(GLOB DEBUG_SYM
${MS_PACK_ROOT_DIR}/mindspore/*.so
${MS_PACK_ROOT_DIR}/mindspore/lib/*.so
)
file(GLOB DEBUG_STRIP_SYM
${MS_PACK_ROOT_DIR}/mindspore/*.so
${MS_PACK_ROOT_DIR}/mindspore/lib/*.so*
)
list(REMOVE_ITEM DEBUG_STRIP_SYM ${MS_PACK_ROOT_DIR}/mindspore/lib/libmindspore_aicpu_kernels.so)
set(CMAKE_OBJCOPY $ENV{CROSS_COMPILE}objcopy)
set(CMAKE_STRIP $ENV{CROSS_COMPILE}strip)
if(CPACK_ENABLE_SYM_FILE)
foreach(schema ${DEBUG_SYM})
execute_process(
COMMAND ${CMAKE_OBJCOPY} "--only-keep-debug" ${schema} ${schema}.sym
WORKING_DIRECTORY ${MS_PACK_ROOT_DIR}
)
endforeach()
endif()
if("${CPACK_CMAKE_BUILD_TYPE}" STREQUAL "Release")
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_STRIP_ARGS "-x")
else()
set(CMAKE_STRIP_ARGS "")
endif()
foreach(schema ${DEBUG_STRIP_SYM})
execute_process(
COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_ARGS} ${schema}
WORKING_DIRECTORY ${MS_PACK_ROOT_DIR}
)
endforeach()
endif()
file(GLOB DEBUG_SYM_FILE
${MS_PACK_ROOT_DIR}/mindspore/*.sym
${MS_PACK_ROOT_DIR}/mindspore/lib/*.sym
)
if(CPACK_ENABLE_SYM_FILE)
file(MAKE_DIRECTORY ${MS_ROOT_DIR}/debug_info)
file(COPY ${DEBUG_SYM_FILE} DESTINATION ${MS_ROOT_DIR}/debug_info/)
file(REMOVE_RECURSE ${DEBUG_SYM_FILE})
endif()
execute_process(
COMMAND ${PYTHON} ${MS_ROOT_DIR}/setup.py "bdist_wheel"
WORKING_DIRECTORY ${MS_PACK_ROOT_DIR}
@ -129,13 +71,13 @@ execute_process(
# finally
set(PACKAGE_NAME ${CPACK_MS_PACKAGE_NAME})
if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
string(REPLACE "-" "_" PACKAGE_NAME ${PACKAGE_NAME})
execute_process(
COMMAND chmod -R 700 ${MS_PACK_ROOT_DIR}/mindspore/
COMMAND chmod -R 700 ${MS_PACK_ROOT_DIR}/${PACKAGE_NAME}.egg-info/
)
endif()
endif ()
file(GLOB WHL_FILE ${MS_PACK_ROOT_DIR}/dist/*.whl)
get_filename_component(ORIGIN_FILE_NAME ${WHL_FILE} NAME)
@ -149,16 +91,3 @@ file(COPY ${MS_PACK_ROOT_DIR}/${NEW_FILE_NAME} DESTINATION ${MS_ROOT_DIR}/output
file(SHA256 ${MS_ROOT_DIR}/output/${NEW_FILE_NAME} SHA256_VAR)
file(WRITE ${MS_ROOT_DIR}/output/${NEW_FILE_NAME}.sha256 ${SHA256_VAR} " " ${NEW_FILE_NAME})
set(CMAKE_TAR $ENV{CROSS_COMPILE}tar)
if(CPACK_ENABLE_SYM_FILE)
file(MAKE_DIRECTORY ${MS_ROOT_DIR}/output/${PACKAGE_NAME}-${VERSION}-${PY_TAGS}-${PLATFORM_TAG})
file(COPY ${MS_ROOT_DIR}/debug_info/ DESTINATION
${MS_ROOT_DIR}/output/${PACKAGE_NAME}-${VERSION}-${PY_TAGS}-${PLATFORM_TAG}/)
execute_process(COMMAND
${CMAKE_COMMAND} -E ${CMAKE_TAR} cfv
${MS_ROOT_DIR}/output/${PACKAGE_NAME}-${VERSION}-${PY_TAGS}-${PLATFORM_TAG}.zip
${MS_ROOT_DIR}/output/${PACKAGE_NAME}-${VERSION}-${PY_TAGS}-${PLATFORM_TAG}/ --format=zip
WORKING_DIRECTORY ${MS_ROOT_DIR})
file(REMOVE_RECURSE ${MS_ROOT_DIR}/debug_info)
file(REMOVE_RECURSE ${MS_ROOT_DIR}/output/${PACKAGE_NAME}-${VERSION}-${PY_TAGS}-${PLATFORM_TAG})
endif()

View File

@ -1,173 +0,0 @@
# include dependency
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
# prepare output directory
file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/output)
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/output)
# cpack variables
string(TOLOWER linux_${CMAKE_HOST_SYSTEM_PROCESSOR} PLATFORM_NAME)
set(CPACK_PACKAGE_FILE_NAME mindspore_ascend-${VERSION_NUMBER}-${PLATFORM_NAME})
set(CPACK_GENERATOR "TGZ")
set(CPACK_PACKAGE_CHECKSUM SHA256)
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_SOURCE_DIR}/output)
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
set(INSTALL_BASE_DIR ".")
set(INSTALL_BIN_DIR "bin")
set(INSTALL_CFG_DIR "config")
set(INSTALL_LIB_DIR "lib")
# set package files
install(
TARGETS mindspore_shared_lib
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mindspore_core mindspore_common mindspore_backend
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(USE_GLOG)
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libmindspore_glog*)
install(
FILES ${GLOG_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
file(GLOB_RECURSE LIBEVENT_LIB_LIST
${libevent_LIBPATH}/libevent*${CMAKE_SHARED_LIBRARY_SUFFIX}*
${libevent_LIBPATH}/libevent_pthreads*${CMAKE_SHARED_LIBRARY_SUFFIX}*
)
install(
FILES ${LIBEVENT_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(ENABLE_MINDDATA)
install(
TARGETS _c_dataengine _c_mindrecord
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
install(
TARGETS cache_admin cache_server
OPTIONAL
DESTINATION ${INSTALL_BIN_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE OPENCV_LIB_LIST
${opencv_LIBPATH}/libopencv_core*
${opencv_LIBPATH}/libopencv_imgcodecs*
${opencv_LIBPATH}/libopencv_imgproc*
)
install(
FILES ${OPENCV_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/libtinyxml2*)
install(
FILES ${TINYXML2_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE ICU4C_LIB_LIST
${icu4c_LIBPATH}/libicuuc*
${icu4c_LIBPATH}/libicudata*
${icu4c_LIBPATH}/libicui18n*
)
install(
FILES ${ICU4C_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
# CPU mode
if(ENABLE_CPU AND NOT WIN32)
install(
TARGETS ps_cache
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CPU)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl${CMAKE_SHARED_LIBRARY_SUFFIX}*)
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/libdnnl*${CMAKE_SHARED_LIBRARY_SUFFIX}*)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/dnnl.dll)
endif()
install(
FILES ${DNNL_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS nnacl
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(MS_BUILD_GRPC)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc++.so.1.36.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc++.so.1 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_grpc.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_grpc.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_gpr.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_gpr.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_upb.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_upb.so.15 COMPONENT mindspore)
install(FILES ${grpc_LIBPATH}/libmindspore_address_sorting.so.15.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libmindspore_address_sorting.so.15 COMPONENT mindspore)
endif()
## Public header files
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
## Public header files for mindapi
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/core/mindapi/base
${CMAKE_SOURCE_DIR}/mindspore/core/mindapi/ir
DESTINATION ${INSTALL_BASE_DIR}/include/mindapi
COMPONENT mindspore
)
## Public header files for minddata
install(
FILES ${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/config.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/constants.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/execute.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/text.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/transforms.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_lite.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
DESTINATION ${INSTALL_BASE_DIR}/include/dataset
COMPONENT mindspore
)
## config files
install(
FILES ${CMAKE_SOURCE_DIR}/config/op_info.config
DESTINATION ${INSTALL_CFG_DIR}
COMPONENT mindspore
)
include(CPack)

View File

@ -1,248 +0,0 @@
# include dependency
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
# set package information
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_GENERATOR "External")
set(CPACK_CMAKE_GENERATOR "Ninja")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT ${CMAKE_SOURCE_DIR}/cmake/package_script.cmake)
set(CPACK_EXTERNAL_ENABLE_STAGING true)
set(CPACK_TEMPORARY_PACKAGE_FILE_NAME ${CMAKE_SOURCE_DIR}/build/package/mindspore)
set(CPACK_TEMPORARY_INSTALL_DIRECTORY ${CMAKE_SOURCE_DIR}/build/package/mindspore)
set(CPACK_PACK_ROOT_DIR ${BUILD_PATH}/package/)
set(CPACK_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(CPACK_PYTHON_EXE ${Python3_EXECUTABLE})
set(CPACK_PYTHON_VERSION ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR})
if(ENABLE_GPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "gpu or cpu")
if(BUILD_DEV_MODE)
# providing cuda11 version of dev package only
set(CPACK_MS_PACKAGE_NAME "mindspore_cuda11_dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore_gpu")
endif()
elseif(ENABLE_CPU)
set(CPACK_MS_BACKEND "ms")
set(CPACK_MS_TARGET "cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore_dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
else()
set(CPACK_MS_BACKEND "debug")
set(CPACK_MS_TARGET "ascend or gpu or cpu")
if(BUILD_DEV_MODE)
set(CPACK_MS_PACKAGE_NAME "mindspore_dev")
else()
set(CPACK_MS_PACKAGE_NAME "mindspore")
endif()
endif()
include(CPack)
# set install path
set(INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries")
set(INSTALL_PY_DIR ".")
set(INSTALL_BASE_DIR ".")
set(INSTALL_BIN_DIR "bin")
set(INSTALL_CFG_DIR "config")
set(INSTALL_LIB_DIR ".")
set(onednn_LIBPATH ${onednn_LIBPATH}/../bin/)
set(glog_LIBPATH ${glog_LIBPATH}/../bin/)
set(opencv_LIBPATH ${opencv_LIBPATH}/../bin/)
set(jpeg_turbo_LIBPATH ${jpeg_turbo_LIBPATH}/../bin/)
set(sqlite_LIBPATH ${sqlite_LIBPATH}/../bin/)
set(tinyxml2_LIBPATH ${tinyxml2_LIBPATH}/../bin/)
message("offline debugger does not support windows system temporarily")
# set package files
install(
TARGETS _c_expression
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
install(
TARGETS mindspore_shared_lib
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mindspore_core mindspore_common mindspore_backend
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
if(USE_GLOG)
file(GLOB_RECURSE GLOG_LIB_LIST ${glog_LIBPATH}/libmindspore_glog.dll)
install(
FILES ${GLOG_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_MINDDATA)
message("icu4c does not support windows system temporarily")
install(
TARGETS _c_dataengine _c_mindrecord
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE OPENCV_LIB_LIST
${opencv_LIBPATH}/libopencv_core*
${opencv_LIBPATH}/libopencv_imgcodecs*
${opencv_LIBPATH}/libopencv_imgproc*
)
install(
FILES ${OPENCV_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
file(GLOB_RECURSE TINYXML2_LIB_LIST ${tinyxml2_LIBPATH}/libtinyxml2.dll)
install(
FILES ${TINYXML2_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CPU)
file(GLOB_RECURSE DNNL_LIB_LIST ${onednn_LIBPATH}/dnnl.dll)
install(
FILES ${DNNL_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS nnacl
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_MPI)
if(ENABLE_GPU)
install(
TARGETS _ms_mpi
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
endif()
if(ENABLE_CPU)
install(
TARGETS mpi_adapter
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS mpi_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
endif()
if(ENABLE_GPU)
if(ENABLE_MPI)
install(
TARGETS gpu_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
install(
TARGETS nvidia_collective
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
install(
TARGETS gpu_queue
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
endif()
get_filename_component(CXX_DIR ${CMAKE_CXX_COMPILER} PATH)
file(GLOB CXX_LIB_LIST ${CXX_DIR}/*.dll)
string(REPLACE "\\" "/" SystemRoot $ENV{SystemRoot})
file(GLOB VC_LIB_LIST ${SystemRoot}/System32/msvcp140.dll ${SystemRoot}/System32/vcomp140.dll)
file(GLOB JPEG_LIB_LIST ${jpeg_turbo_LIBPATH}/*.dll)
file(GLOB SQLITE_LIB_LIST ${sqlite_LIBPATH}/*.dll)
install(
FILES ${CXX_LIB_LIST} ${JPEG_LIB_LIST} ${SQLITE_LIB_LIST} ${VC_LIB_LIST}
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)
# set python files
file(GLOB MS_PY_LIST ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/*.py)
install(
FILES ${MS_PY_LIST}
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
install(
DIRECTORY
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/nn
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/_extends
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/parallel
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/mindrecord
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/numpy
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/train
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/boost
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/common
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/ops
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/communication
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/profiler
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/compression
${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/run_check
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
if(EXISTS ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/mindspore/python/mindspore/dataset
DESTINATION ${INSTALL_PY_DIR}
COMPONENT mindspore
)
endif()
## Public header files
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include
DESTINATION ${INSTALL_BASE_DIR}
COMPONENT mindspore
)
## Public header files for minddata
install(
FILES ${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/config.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/constants.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/execute.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/text.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/transforms.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_lite.h
${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset/include/dataset/vision_ascend.h
DESTINATION ${INSTALL_BASE_DIR}/include/dataset
COMPONENT mindspore
)
## config files
install(
FILES ${CMAKE_SOURCE_DIR}/config/op_info.config
DESTINATION ${INSTALL_CFG_DIR}
COMPONENT mindspore
)

View File

@ -1,9 +1,9 @@
include(FetchContent)
set(FETCHCONTENT_QUIET OFF)
if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17.0)
if (CMAKE_SYSTEM_NAME MATCHES "Windows" AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17.0)
set(CMAKE_FIND_LIBRARY_SUFFIXES .dll ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
endif ()
function(mindspore_add_submodule_obj des_submodule_objs sub_dir submodule_name_obj)
@ -20,45 +20,45 @@ function(mindspore_add_submodule_obj des_submodule_objs sub_dir submodule_name_o
endfunction()
if(DEFINED ENV{MSLIBS_CACHE_PATH})
if (DEFINED ENV{MSLIBS_CACHE_PATH})
set(_MS_LIB_CACHE $ENV{MSLIBS_CACHE_PATH})
else()
set(_MS_LIB_CACHE ${CMAKE_BINARY_DIR}/.mslib)
endif()
endif ()
message("MS LIBS CACHE PATH: ${_MS_LIB_CACHE}")
if(NOT EXISTS ${_MS_LIB_CACHE})
if (NOT EXISTS ${_MS_LIB_CACHE})
file(MAKE_DIRECTORY ${_MS_LIB_CACHE})
endif()
endif ()
if(DEFINED ENV{MSLIBS_SERVER} AND NOT ENABLE_GITEE)
if (DEFINED ENV{MSLIBS_SERVER})
set(LOCAL_LIBS_SERVER $ENV{MSLIBS_SERVER})
message("LOCAL_LIBS_SERVER: ${LOCAL_LIBS_SERVER}")
endif()
endif ()
include(ProcessorCount)
ProcessorCount(N)
if(JOBS)
if (JOBS)
set(THNUM ${JOBS})
else()
set(JOBS 8)
if(${JOBS} GREATER ${N})
if (${JOBS} GREATER ${N})
set(THNUM ${N})
else()
set(THNUM ${JOBS})
endif()
endif()
endif ()
message("set make thread num: ${THNUM}")
if(LOCAL_LIBS_SERVER)
if(NOT ENV{no_proxy})
if (NOT ENV{no_proxy})
set(ENV{no_proxy} "${LOCAL_LIBS_SERVER}")
else()
string(FIND $ENV{no_proxy} ${LOCAL_LIBS_SERVER} IP_POS)
if(${IP_POS} EQUAL -1)
if (${IP_POS} EQUAL -1)
set(ENV{no_proxy} "$ENV{no_proxy},${LOCAL_LIBS_SERVER}")
endif()
endif()
endif ()
endif ()
endif()
function(__download_pkg pkg_name pkg_url pkg_md5)
@ -92,10 +92,10 @@ function(__download_pkg_with_git pkg_name pkg_url pkg_git_commit pkg_md5)
URL_HASH MD5=${pkg_md5}
)
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}")
@ -128,49 +128,44 @@ function(__find_pkg_then_add_target pkg_name pkg_exe lib_path)
foreach(_LIB_NAME ${ARGN})
set(_LIB_SEARCH_NAME ${_LIB_NAME})
set(_LIB_TYPE SHARED)
if(${pkg_name}_USE_STATIC_LIBS)
if (${pkg_name}_USE_STATIC_LIBS)
set(_LIB_SEARCH_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}${_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(_LIB_TYPE STATIC)
endif()
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}
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
else()
find_library(${_LIB_NAME}_LIB ${_LIB_SEARCH_NAME} PATHS ${${pkg_name}_BASE_DIR}/${lib_path}
NO_DEFAULT_PATH)
endif()
find_library(${_LIB_NAME}_LIB ${_LIB_SEARCH_NAME} PATHS ${${pkg_name}_BASE_DIR}/${lib_path} NO_DEFAULT_PATH)
if(NOT ${_LIB_NAME}_LIB)
return()
endif()
add_library(${pkg_name}::${_LIB_NAME} ${_LIB_TYPE} IMPORTED GLOBAL)
if(WIN32 AND ${_LIB_TYPE} STREQUAL "SHARED")
if (WIN32 AND ${_LIB_TYPE} STREQUAL "SHARED")
set_target_properties(${pkg_name}::${_LIB_NAME} PROPERTIES IMPORTED_IMPLIB_RELEASE ${${_LIB_NAME}_LIB})
else()
set_target_properties(${pkg_name}::${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${${_LIB_NAME}_LIB})
endif()
if(EXISTS ${${pkg_name}_BASE_DIR}/include)
set_target_properties(${pkg_name}::${_LIB_NAME} PROPERTIES
if (EXISTS ${${pkg_name}_BASE_DIR}/include)
set_target_properties(${pkg_name}::${_LIB_NAME} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${${pkg_name}_BASE_DIR}/include")
endif()
endif ()
list(APPEND ${pkg_name}_LIBS ${pkg_name}::${_LIB_NAME})
message("found ${${_LIB_NAME}_LIB}")
STRING(REGEX REPLACE "(.+)/(.+)" "\\1" LIBPATH ${${_LIB_NAME}_LIB})
STRING( REGEX REPLACE "(.+)/(.+)" "\\1" LIBPATH ${${_LIB_NAME}_LIB})
set(${pkg_name}_LIBPATH ${LIBPATH} CACHE STRING INTERNAL)
endforeach()
endforeach(_LIB_NAME)
set(${pkg_name}_LIBS ${${pkg_name}_LIBS} PARENT_SCOPE)
endfunction()
function(__exec_cmd)
set(options)
set(options )
set(oneValueArgs WORKING_DIRECTORY)
set(multiValueArgs COMMAND)
cmake_parse_arguments(EXEC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
cmake_parse_arguments(EXEC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
execute_process(COMMAND ${EXEC_COMMAND}
WORKING_DIRECTORY ${EXEC_WORKING_DIRECTORY}
@ -182,43 +177,41 @@ endfunction()
function(__check_patches pkg_patches)
# check patches
if(PKG_PATCHES)
if (PKG_PATCHES)
file(TOUCH ${_MS_LIB_CACHE}/${pkg_name}_patch.md5)
file(READ ${_MS_LIB_CACHE}/${pkg_name}_patch.md5 ${pkg_name}_PATCHES_MD5)
message("patches md5:${${pkg_name}_PATCHES_MD5}")
set(${pkg_name}_PATCHES_NEW_MD5)
set(${pkg_name}_PATCHES_NEW_MD5 )
foreach(_PATCH ${PKG_PATCHES})
file(MD5 ${_PATCH} _PF_MD5)
set(${pkg_name}_PATCHES_NEW_MD5 "${${pkg_name}_PATCHES_NEW_MD5},${_PF_MD5}")
endforeach()
endforeach(_PATCH)
if(NOT ${pkg_name}_PATCHES_MD5 STREQUAL ${pkg_name}_PATCHES_NEW_MD5)
if (NOT ${pkg_name}_PATCHES_MD5 STREQUAL ${pkg_name}_PATCHES_NEW_MD5)
set(${pkg_name}_PATCHES ${PKG_PATCHES})
file(REMOVE_RECURSE "${_MS_LIB_CACHE}/${pkg_name}-subbuild")
file(WRITE ${_MS_LIB_CACHE}/${pkg_name}_patch.md5 ${${pkg_name}_PATCHES_NEW_MD5})
message("patches changed : ${${pkg_name}_PATCHES_NEW_MD5}")
endif()
endif()
endif ()
endif ()
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)
set(MS_FIND_NO_DEFAULT_PATH ${MS_FIND_NO_DEFAULT_PATH} PARENT_SCOPE)
function(mindspore_add_pkg pkg_name)
function(mindspore_add_pkg pkg_name )
set(options)
set(options )
set(oneValueArgs URL MD5 GIT_REPOSITORY GIT_TAG VER EXE DIR HEAD_ONLY CMAKE_PATH RELEASE LIB_PATH CUSTOM_CMAKE)
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)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
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)
cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT PKG_LIB_PATH)
if (NOT PKG_LIB_PATH)
set(PKG_LIB_PATH lib)
endif()
endif ()
if(NOT PKG_EXE)
set(PKG_EXE 0)
@ -228,11 +221,11 @@ function(mindspore_add_pkg pkg_name)
string(TOLOWER ${pkg_name} pkg_name)
message("pkg name:${__FIND_PKG_NAME},${pkg_name}")
set(${pkg_name}_PATCHES_HASH)
set(${pkg_name}_PATCHES_HASH )
foreach(_PATCH ${PKG_PATCHES})
file(MD5 ${_PATCH} _PF_MD5)
set(${pkg_name}_PATCHES_HASH "${${pkg_name}_PATCHES_HASH},${_PF_MD5}")
endforeach()
endforeach(_PATCH)
# check options
set(${pkg_name}_CONFIG_TXT
@ -244,23 +237,23 @@ function(mindspore_add_pkg pkg_name)
message("${pkg_name} config hash: ${${pkg_name}_CONFIG_HASH}")
set(${pkg_name}_BASE_DIR ${_MS_LIB_CACHE}/${pkg_name}_${PKG_VER}_${${pkg_name}_CONFIG_HASH})
set(${pkg_name}_BASE_DIR ${_MS_LIB_CACHE}/${pkg_name}_${${pkg_name}_CONFIG_HASH})
set(${pkg_name}_DIRPATH ${${pkg_name}_BASE_DIR} CACHE STRING INTERNAL)
if(EXISTS ${${pkg_name}_BASE_DIR}/options.txt AND PKG_HEAD_ONLY)
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})
if (${PKG_RELEASE})
__find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} ${PKG_LIBS})
endif()
endif ()
return()
endif()
endif ()
set(${__FIND_PKG_NAME}_ROOT ${${pkg_name}_BASE_DIR})
set(${__FIND_PKG_NAME}_ROOT ${${pkg_name}_BASE_DIR} PARENT_SCOPE)
if(PKG_LIBS)
if (PKG_LIBS)
__find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} ${PKG_LIBS})
if(${pkg_name}_LIBS)
set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE)
@ -269,28 +262,28 @@ function(mindspore_add_pkg pkg_name)
endif()
elseif(NOT PKG_HEAD_ONLY)
find_package(${__FIND_PKG_NAME} ${PKG_VER} ${MS_FIND_NO_DEFAULT_PATH})
if(${__FIND_PKG_NAME}_FOUND)
if (${__FIND_PKG_NAME}_FOUND)
set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE)
message("Found pkg: ${__FIND_PKG_NAME}")
return()
endif()
endif()
endif ()
endif ()
if(NOT PKG_DIR)
if(PKG_GIT_REPOSITORY)
if (NOT PKG_DIR)
if (PKG_GIT_REPOSITORY)
__download_pkg_with_git(${pkg_name} ${PKG_GIT_REPOSITORY} ${PKG_GIT_TAG} ${PKG_MD5})
else()
__download_pkg(${pkg_name} ${PKG_URL} ${PKG_MD5})
endif()
foreach(_SUBMODULE_FILE ${PKG_SUBMODULES})
STRING(REGEX REPLACE "(.+)_(.+)" "\\1" _SUBMODEPATH ${_SUBMODULE_FILE})
STRING(REGEX REPLACE "(.+)/(.+)" "\\2" _SUBMODENAME ${_SUBMODEPATH})
STRING( REGEX REPLACE "(.+)_(.+)" "\\1" _SUBMODEPATH ${_SUBMODULE_FILE})
STRING( REGEX REPLACE "(.+)/(.+)" "\\2" _SUBMODENAME ${_SUBMODEPATH})
file(GLOB ${pkg_name}_INSTALL_SUBMODULE ${_SUBMODULE_FILE}/*)
file(COPY ${${pkg_name}_INSTALL_SUBMODULE} DESTINATION ${${pkg_name}_SOURCE_DIR}/3rdparty/${_SUBMODENAME})
endforeach()
endforeach (_SUBMODULE_FILE)
else()
set(${pkg_name}_SOURCE_DIR ${PKG_DIR})
endif()
endif ()
file(WRITE ${${pkg_name}_BASE_DIR}/options.txt ${${pkg_name}_CONFIG_TXT})
message("${pkg_name}_SOURCE_DIR : ${${pkg_name}_SOURCE_DIR}")
@ -306,32 +299,32 @@ function(mindspore_add_pkg pkg_name)
if(NOT Result EQUAL "0")
message(FATAL_ERROR "Failed patch: ${_LF_PATCH_FILE}")
endif()
endforeach()
endforeach(_PATCH_FILE)
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()
endforeach (_SUBMODULE_FILE)
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()
if(PKG_CUSTOM_CMAKE)
if (PKG_CUSTOM_CMAKE)
file(GLOB ${pkg_name}_cmake ${PKG_CUSTOM_CMAKE}/CMakeLists.txt)
file(COPY ${${pkg_name}_cmake} DESTINATION ${${pkg_name}_SOURCE_DIR})
endif()
endif ()
if(${pkg_name}_SOURCE_DIR)
if(PKG_HEAD_ONLY)
if (PKG_HEAD_ONLY)
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)
if (NOT PKG_RELEASE)
add_library(${pkg_name} INTERFACE)
target_include_directories(${pkg_name} INTERFACE ${${pkg_name}_INC})
endif()
endif ()
elseif(PKG_ONLY_MAKE)
elseif (PKG_ONLY_MAKE)
__exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_CXXFLAGS} -j${THNUM}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR})
set(PKG_INSTALL_INCS ${PKG_ONLY_MAKE_INCS})
@ -341,86 +334,75 @@ function(mindspore_add_pkg pkg_name)
file(COPY ${${pkg_name}_INSTALL_INCS} DESTINATION ${${pkg_name}_BASE_DIR}/include)
file(COPY ${${pkg_name}_INSTALL_LIBS} DESTINATION ${${pkg_name}_BASE_DIR}/lib)
elseif(PKG_CMAKE_OPTION)
elseif (PKG_CMAKE_OPTION)
# in cmake
file(MAKE_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build)
if(${pkg_name}_CFLAGS)
if (${pkg_name}_CFLAGS)
set(${pkg_name}_CMAKE_CFLAGS "-DCMAKE_C_FLAGS=${${pkg_name}_CFLAGS}")
endif()
if(${pkg_name}_CXXFLAGS)
endif ()
if (${pkg_name}_CXXFLAGS)
set(${pkg_name}_CMAKE_CXXFLAGS "-DCMAKE_CXX_FLAGS=${${pkg_name}_CXXFLAGS}")
endif()
endif ()
if(${pkg_name}_LDFLAGS)
if(${pkg_name}_USE_STATIC_LIBS)
if (${pkg_name}_LDFLAGS)
if (${pkg_name}_USE_STATIC_LIBS)
#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} ${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)
else()
__exec_cmd(COMMAND ${CMAKE_COMMAND} ${PKG_CMAKE_OPTION} -G ${CMAKE_GENERATOR}
endif ()
endif ()
__exec_cmd(COMMAND ${CMAKE_COMMAND} ${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)
__exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --target install -- -j${THNUM}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build)
endif()
__exec_cmd(COMMAND ${CMAKE_COMMAND} --build . --target install -- -j${THNUM}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}/_build)
else()
if(${pkg_name}_CFLAGS)
if (${pkg_name}_CFLAGS)
set(${pkg_name}_MAKE_CFLAGS "CFLAGS=${${pkg_name}_CFLAGS}")
endif()
if(${pkg_name}_CXXFLAGS)
endif ()
if (${pkg_name}_CXXFLAGS)
set(${pkg_name}_MAKE_CXXFLAGS "CXXFLAGS=${${pkg_name}_CXXFLAGS}")
endif()
if(${pkg_name}_LDFLAGS)
endif ()
if (${pkg_name}_LDFLAGS)
set(${pkg_name}_MAKE_LDFLAGS "LDFLAGS=${${pkg_name}_LDFLAGS}")
endif()
endif ()
# in configure && make
if(PKG_PRE_CONFIGURE_COMMAND)
if (PKG_PRE_CONFIGURE_COMMAND)
__exec_cmd(COMMAND ${PKG_PRE_CONFIGURE_COMMAND}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR})
endif()
endif ()
if(PKG_CONFIGURE_COMMAND)
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})
endif()
endif ()
set(${pkg_name}_BUILD_OPTION ${PKG_BUILD_OPTION})
if(NOT PKG_CONFIGURE_COMMAND)
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})
endif()
endif ()
# build
if(APPLE)
__exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_BUILD_OPTION}
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})
endif()
__exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} ${${pkg_name}_BUILD_OPTION} -j${THNUM}
WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR})
if(PKG_INSTALL_INCS OR PKG_INSTALL_LIBS)
if (PKG_INSTALL_INCS OR PKG_INSTALL_LIBS)
file(GLOB ${pkg_name}_INSTALL_INCS ${${pkg_name}_SOURCE_DIR}/${PKG_INSTALL_INCS})
file(GLOB ${pkg_name}_INSTALL_LIBS ${${pkg_name}_SOURCE_DIR}/${PKG_INSTALL_LIBS})
file(COPY ${${pkg_name}_INSTALL_INCS} DESTINATION ${${pkg_name}_BASE_DIR}/include)
file(COPY ${${pkg_name}_INSTALL_LIBS} DESTINATION ${${pkg_name}_BASE_DIR}/lib)
else()
__exec_cmd(COMMAND ${CMAKE_MAKE_PROGRAM} install WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR})
endif()
endif()
endif ()
endif ()
endif()
if(PKG_LIBS)
if (PKG_LIBS)
__find_pkg_then_add_target(${pkg_name} ${PKG_EXE} ${PKG_LIB_PATH} ${PKG_LIBS})
set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE)
if(NOT ${pkg_name}_LIBS)
@ -428,10 +410,10 @@ function(mindspore_add_pkg pkg_name)
endif()
else()
find_package(${__FIND_PKG_NAME} ${PKG_VER} QUIET ${MS_FIND_NO_DEFAULT_PATH})
if(${__FIND_PKG_NAME}_FOUND)
if (${__FIND_PKG_NAME}_FOUND)
set(${pkg_name}_INC ${${pkg_name}_BASE_DIR}/include PARENT_SCOPE)
message("Found pkg: ${${__FIND_PKG_NAME}_LIBRARIES}")
return()
endif()
endif()
endif ()
endif ()
endfunction()

View File

@ -1,12 +1,17 @@
{
"common_dump_settings": {
"dump_mode": 0,
"path": "/test",
"DumpSettings": {
"net_name": "ResNet50",
"iteration": "0",
"input_output": 2,
"kernels": ["Default/Conv-op12"],
"support_device": [0,1,2,3,4,5,6,7],
"op_debug_mode": 0
"dump_mode": 1,
"op_debug_mode": 3,
"iteration": 0,
"kernels": ["Default/Conv2D-op2", "Default/TensorAdd-op10"]
},
"DumpSettingsSpec": {
"net_name": "net name eg:ResNet50",
"dump_mode": "0: dump all kernels, 1: dump kernels in kernels list",
"op_debug_mode": "0: close debug, 1: debug ai-core overflow, 2: debug atomic overflow, 3: debug all overflow",
"iteration": "specified iteration ",
"kernels": "op's full scope name which need to be dump"
}
}

View File

@ -0,0 +1,14 @@
{
"DebuggerSettings": {
"ssl_certificate": true,
"certificate_path": "/home/maning/sslcertificates/client.pfx",
"certificate_passphrase": "12345678"
},
"DebuggerSettingsSpec": {
"ssl_certificate": "true, secure_mode enable, default is true",
"certificate_path": "path to the certificate file",
"certificate_passphrase": "passphrase of the certificate"
},
"other": {}
}

View File

@ -0,0 +1,22 @@
{
"DumpSettings": {
"enable": false,
"trans_flag": false,
"path": "/tmp/net/",
"net_name": "ResNet50",
"mode": 0,
"iteration": 0,
"kernels": ["Default/Conv2D-op2", "Default/TensorAdd-op10"]
},
"DumpSettingsSpec": {
"enable": "true: dump enable, false: dump disable",
"trans_flag": "true: trans to host format, false: not trans format",
"path": "the dump file folder",
"net_name": "net name eg:ResNet50",
"mode": "0: dump all kernels, 1: dump kernels in kernels list",
"iteration": "0: all iteration, others: specified iteration ",
"kernels": "op's full scope name which need to be dump"
},
"other": {}
}

View File

@ -0,0 +1,22 @@
{
"DumpSettings": {
"enable": false,
"trans_flag": false,
"path": "/tmp/hccllog/0",
"net_name": "ResNet50",
"mode": 0,
"iteration": 0,
"kernels": ["Default/Conv2D-op2", "Default/TensorAdd-op10"]
},
"DumpSettingsSpec": {
"enable": "true: dump enable, false: dump disable",
"trans_flag": "true: trans to host format, false: not trans format",
"path": "the dump file folder",
"net_name": "net name eg:ResNet50",
"mode": "0: dump all kernels, 1: dump kernels in kernels list",
"iteration": "0: all iteration, others: specified iteration ",
"kernels": "op's full scope name which need to be dump"
},
"other": {}
}

View File

@ -0,0 +1,22 @@
{
"DumpSettings": {
"enable": false,
"trans_flag": false,
"path": "/tmp/hccllog/1",
"net_name": "ResNet50",
"mode": 0,
"iteration": 0,
"kernels": ["Default/Conv2D-op2", "Default/TensorAdd-op10"]
},
"DumpSettingsSpec": {
"enable": "true: dump enable, false: dump disable",
"trans_flag": "true: trans to host format, false: not trans format",
"path": "the dump file folder",
"net_name": "net name eg:ResNet50",
"mode": "0: dump all kernels, 1: dump kernels in kernels list",
"iteration": "0: all iteration, others: specified iteration ",
"kernels": "op's full scope name which need to be dump"
},
"other": {}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,74 @@
FROM ubuntu:18.04
MAINTAINER leonwanghui <leon.wanghui@huawei.com>
# Set env
ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
ENV CMAKE_ROOT_PATH /usr/local/cmake-3.14.1
ENV PATH ${PYTHON_ROOT_PATH}/bin:${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH ${PYTHON_ROOT_PATH}/lib
# Install base tools
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y \
vim \
wget \
curl \
xz-utils \
net-tools \
openssh-client \
git \
ntpdate \
tzdata \
tcl \
sudo \
bash-completion
# Install compile tools
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
gcc \
g++ \
zlibc \
make \
libgmp-dev \
patch \
autoconf \
libtool \
automake \
flex
# Set bash
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# Install python (v3.7.5)
RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
&& cd /tmp \
&& wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
&& tar -xvf v3.7.5.tar.gz \
&& cd /tmp/cpython-3.7.5 \
&& mkdir -p ${PYTHON_ROOT_PATH} \
&& ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \
&& make -j4 \
&& make install -j4 \
&& rm -f /usr/local/bin/python \
&& rm -f /usr/local/bin/pip \
&& ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
&& ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
&& rm -rf /tmp/cpython-3.7.5 \
&& rm -f /tmp/v3.7.5.tar.gz
# Set pip source
RUN mkdir -pv /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
&& echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \
&& pip install --no-cache-dir wheel
# Install cmake (v3.14.1)
RUN cd /tmp \
&& wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
&& mkdir -p ${CMAKE_ROOT_PATH} \
&& bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
&& rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh

View File

@ -0,0 +1,64 @@
FROM ubuntu:18.04
MAINTAINER leonwanghui <leon.wanghui@huawei.com>
# Set env
ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
ENV PATH /usr/local/bin:$PATH
# Install base tools
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y \
vim \
wget \
curl \
xz-utils \
net-tools \
openssh-client \
git \
ntpdate \
tzdata \
tcl \
sudo \
bash-completion
# Install compile tools
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
gcc \
g++ \
zlibc \
make \
libgmp-dev \
patch \
autoconf \
libtool \
automake \
flex
# Set bash
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# Install python (v3.7.5)
RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
&& cd /tmp \
&& wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
&& tar -xvf v3.7.5.tar.gz \
&& cd /tmp/cpython-3.7.5 \
&& mkdir -p ${PYTHON_ROOT_PATH} \
&& ./configure --prefix=${PYTHON_ROOT_PATH} \
&& make -j4 \
&& make install -j4 \
&& rm -f /usr/local/bin/python \
&& rm -f /usr/local/bin/pip \
&& ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
&& ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
&& rm -rf /tmp/cpython-3.7.5 \
&& rm -f /tmp/v3.7.5.tar.gz
# Set pip source
RUN mkdir -pv /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
&& echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf

View File

@ -0,0 +1,77 @@
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
MAINTAINER leonwanghui <leon.wanghui@huawei.com>
# Set env
ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
ENV CMAKE_ROOT_PATH /usr/local/cmake-3.14.1
ENV PATH ${CMAKE_ROOT_PATH}/bin:/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH ${PYTHON_ROOT_PATH}/lib
# Install base tools
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y \
vim \
wget \
curl \
xz-utils \
net-tools \
openssh-client \
git \
ntpdate \
tzdata \
tcl \
sudo \
bash-completion
# Install compile tools
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
gcc \
g++ \
zlibc \
make \
libgmp-dev \
patch \
autoconf \
libtool \
automake \
flex
# Configure cuDNN (v7.6.5)
RUN ln -s /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5 /usr/local/cuda/lib64/libcudnn.so
# Set bash
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# Install python (v3.7.5)
RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
&& cd /tmp \
&& wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
&& tar -xvf v3.7.5.tar.gz \
&& cd /tmp/cpython-3.7.5 \
&& mkdir -p ${PYTHON_ROOT_PATH} \
&& ./configure --prefix=${PYTHON_ROOT_PATH} --enable-shared \
&& make -j4 \
&& make install -j4 \
&& rm -f /usr/local/bin/python \
&& rm -f /usr/local/bin/pip \
&& ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
&& ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
&& rm -rf /tmp/cpython-3.7.5 \
&& rm -f /tmp/v3.7.5.tar.gz
# Set pip source
RUN mkdir -pv /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
&& echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf \
&& pip install --no-cache-dir wheel
# Install cmake (v3.14.1)
RUN cd /tmp \
&& wget https://github.com/Kitware/CMake/releases/download/v3.14.1/cmake-3.14.1-Linux-x86_64.sh \
&& mkdir -p ${CMAKE_ROOT_PATH} \
&& bash ./cmake-3.14.1-Linux-x86_64.sh --prefix=${CMAKE_ROOT_PATH} --exclude-subdir --skip-license \
&& rm -f /tmp/cmake-3.14.1-Linux-x86_64.sh

View File

@ -0,0 +1,78 @@
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
MAINTAINER leonwanghui <leon.wanghui@huawei.com>
# Set env
ENV PYTHON_ROOT_PATH /usr/local/python-3.7.5
ENV OMPI_ROOT_PATH /usr/local/openmpi-3.1.5
ENV PATH ${OMPI_ROOT_PATH}/bin:/usr/local/bin:$PATH
ENV LD_LIBRARY_PATH ${OMPI_ROOT_PATH}/lib:$LD_LIBRARY_PATH
# Install base tools
RUN apt update \
&& DEBIAN_FRONTEND=noninteractive apt install -y \
vim \
wget \
curl \
xz-utils \
net-tools \
openssh-client \
git \
ntpdate \
tzdata \
tcl \
sudo \
bash-completion
# Install compile tools
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
gcc \
g++ \
zlibc \
make \
libgmp-dev \
patch \
autoconf \
libtool \
automake \
flex
# Set bash
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
# Install python (v3.7.5)
RUN apt install -y libffi-dev libssl-dev zlib1g-dev libbz2-dev libncurses5-dev \
libgdbm-dev libgdbm-compat-dev liblzma-dev libreadline-dev libsqlite3-dev \
&& cd /tmp \
&& wget https://github.com/python/cpython/archive/v3.7.5.tar.gz \
&& tar -xvf v3.7.5.tar.gz \
&& cd /tmp/cpython-3.7.5 \
&& mkdir -p ${PYTHON_ROOT_PATH} \
&& ./configure --prefix=${PYTHON_ROOT_PATH} \
&& make -j4 \
&& make install -j4 \
&& rm -f /usr/local/bin/python \
&& rm -f /usr/local/bin/pip \
&& ln -s ${PYTHON_ROOT_PATH}/bin/python3.7 /usr/local/bin/python \
&& ln -s ${PYTHON_ROOT_PATH}/bin/pip3.7 /usr/local/bin/pip \
&& rm -rf /tmp/cpython-3.7.5 \
&& rm -f /tmp/v3.7.5.tar.gz
# Set pip source
RUN mkdir -pv /root/.pip \
&& echo "[global]" > /root/.pip/pip.conf \
&& echo "trusted-host=mirrors.aliyun.com" >> /root/.pip/pip.conf \
&& echo "index-url=http://mirrors.aliyun.com/pypi/simple/" >> /root/.pip/pip.conf
# Install openmpi (v3.1.5)
RUN cd /tmp \
&& wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.5.tar.gz \
&& tar -xvf openmpi-3.1.5.tar.gz \
&& cd /tmp/openmpi-3.1.5 \
&& mkdir -p ${OMPI_ROOT_PATH} \
&& ./configure --prefix=${OMPI_ROOT_PATH} \
&& make -j4 \
&& make install -j4 \
&& rm -rf /tmp/openmpi-3.1.5 \
&& rm -f /tmp/openmpi-3.1.5.tar.gz

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -1,9 +0,0 @@
approvers:
- gemini524
- Hanshize
- rudy_tan
- jonyguo
- lvyufenghw
- zh_qh
- liangchenghui
- tiancixiao

Some files were not shown because too many files have changed in this diff Show More