Compare commits

...
822 Commits
Author SHA1 Message Date
huangyunlong 750d5d1266 !16304 update soc
Merge pull request !16304 from huangyunlong/2.1rc1soc
2024-11-28 12:46:46 +00:00
王超 ee82e49903 !13271 update security note
Merge pull request !13271 from 王超/v2.1.0-6.0.rc1_doc
2024-07-30 08:59:29 +00:00
郭光浩 7204abe508 update setup.py.
Signed-off-by: 郭光浩 <guoguanghao@huawei.com>
2024-05-22 13:09:42 +00:00
chuboning 4d165bae77 !11664 Fix writing file error in nslb
Merge pull request !11664 from chuboning/v2.1.0-6.0.rc1
2024-05-16 06:38:00 +00:00
sunjiayang feb60c2392 !11573 asd patch fix
Merge pull request !11573 from sunjiayang/asd-210-rc1
2024-05-08 03:33:47 +00:00
关龙锋 b723de3a6c !11444 update torchair commitid
Merge pull request !11444 from 关龙锋/v2.1.0-6.0.rc1
2024-04-28 06:33:26 +00:00
pta-robot 03a4f92fec !11453 Update op_plugin commit id
Merge pull request !11453 from pta-robot/v2.1.0-6.0.rc1
2024-04-28 04:47:52 +00:00
sunjiayang ac14c1825f !11418 fix pytorch process cant exit
Merge pull request !11418 from sunjiayang/oom-210-rc1
2024-04-26 09:41:02 +00:00
tangpeiqi96 e264902680 !11372 check base format
Merge pull request !11372 from tangpeiqi96/v2.1.0-6.0.rc1
2024-04-26 07:48:55 +00:00
pta-robot 0f3bf7a472 !11356 Update op_plugin commit id
Merge pull request !11356 from pta-robot/v2.1.0-6.0.rc1
2024-04-24 10:59:27 +00:00
wuhy df80c3646f !11260 Update README : version post3
Merge pull request !11260 from wuhy/version-post3-21060rc1
2024-04-24 01:14:41 +00:00
郭光浩 4ecd50b298 !11197 update license and open_source_software
Merge pull request !11197 from 郭光浩/v2.1.0-6.0.rc1
2024-04-18 09:12:07 +00:00
pta-robot 7c4136d8f7 !11122 Update op_plugin commit id
Merge pull request !11122 from pta-robot/v2.1.0-6.0.rc1
2024-04-11 10:48:23 +00:00
万俊伟 9d02644e64 !11090 update torchair commitid v2.1.0-6.0.rc1
Merge pull request !11090 from 万俊伟/v2.1.0-6.0.rc1_0411
2024-04-11 07:01:25 +00:00
陈志敏 ae2e23965b !10961 move test_addmm.py to op_plugin
Merge pull request !10961 from 陈志敏/v2.1.0-6.0.rc1
2024-04-10 06:48:51 +00:00
wangjie a10a34c06f !11036 [Prof] Add Call Stack info to trace_view
Merge pull request !11036 from wangjie/cherry-pick-1712625516
2024-04-09 11:03:25 +00:00
pta-robot 44f25cdd1b !11030 Update op_plugin commit id
Merge pull request !11030 from pta-robot/v2.1.0-6.0.rc1
2024-04-08 16:17:42 +00:00
郭光浩 98e8569091 update README.zh.md.
Signed-off-by: 郭光浩 <guoguanghao@huawei.com>
2024-04-08 12:14:46 +00:00
郭光浩 e1a2065168 update README.md.
Signed-off-by: 郭光浩 <guoguanghao@huawei.com>
2024-04-08 12:13:47 +00:00
鲁博洋 c948877962 !11019 update torchair commitid v2.1.0-6.0.rc1
Merge pull request !11019 from 鲁博洋/v2.1.0-6.0.rc1
2024-04-08 12:10:03 +00:00
cheng 5ef706f033 !11010 modify the process_number of Pool in online analyze scene
Merge pull request !11010 from cheng/cherry-pick-1712553142
2024-04-08 11:39:46 +00:00
stby 122abc2455 !10992 [PROF]bugfix: avoid ReDos risk
Merge pull request !10992 from stby/cherry-pick-1712475957
2024-04-08 03:27:37 +00:00
Mrtutu d7630f43ba !10989 【Bugfix】fix ReDos and div zero risk on branch v2.1.0-6.0.rc1
Merge pull request !10989 from Mrtutu/cherry-pick-1712474870
2024-04-08 03:27:09 +00:00
郭光浩 0c877e96aa !10940 Update Readme
Merge pull request !10940 from 郭光浩/v2.1.0-6.0.rc1
2024-04-07 08:16:26 +00:00
dannyAys 359b73ab16 !10969 FIA op enables PTA on commercial branch - Meta Infer & Onnx
Merge pull request !10969 from dannyAys/v2.1.0-6.0.rc1
2024-04-03 11:03:51 +00:00
pta-robot b715ae963c !10970 Update op_plugin commit id
Merge pull request !10970 from pta-robot/v2.1.0-6.0.rc1
2024-04-03 11:00:24 +00:00
pta-robot 7ce623627b !10964 Update op_plugin commit id
Merge pull request !10964 from pta-robot/v2.1.0-6.0.rc1
2024-04-03 04:57:51 +00:00
鲁博洋 65e1eb403b !10918 update torchair commitid v2.1.0-6.0.rc1
Merge pull request !10918 from 鲁博洋/v2.1.0-6.0.rc1
2024-04-02 12:51:34 +00:00
pta-robot f6c8901bfb !10949 Update op_plugin commit id
Merge pull request !10949 from pta-robot/v2.1.0-6.0.rc1
2024-04-02 12:39:05 +00:00
pta-robot 86e4a9777e !10909 Update op_plugin commit id
Merge pull request !10909 from pta-robot/v2.1.0-6.0.rc1
2024-04-01 16:17:17 +00:00
pta-robot 9959bc6012 !10873 Update op_plugin commit id
Merge pull request !10873 from pta-robot/v2.1.0-6.0.rc1
2024-03-31 04:47:24 +00:00
万俊伟 0d6679567e !10835 update torchair commitid v2.1.0-6.0.rc1
Merge pull request !10835 from 万俊伟/v2.1.0-6.0.rc1
2024-03-30 08:55:11 +00:00
sunjiayang 0d6c69f420 !10817 fix errcode bug
Merge pull request !10817 from sunjiayang/ec-210-6
2024-03-29 11:09:07 +00:00
pta-robot 7192b1988f !10787 Update op_plugin commit id
Merge pull request !10787 from pta-robot/v2.1.0-6.0.rc1
2024-03-28 16:23:57 +00:00
huangyunlong 955def62fe !10704 [Cleancode]fix the mix signed and unsigned numbers,explicit initialization of class member variables
Merge pull request !10704 from huangyunlong/2.1rch
2024-03-28 11:07:26 +00:00
xudaohong cf5e2e8851 !10744 [feat] npu_format_cast support int8 nd->nz
Merge pull request !10744 from xudaohong/cherry-pick-1711523913
2024-03-28 11:03:06 +00:00
pta-robot d6b27714fa !10751 Update op_plugin commit id
Merge pull request !10751 from pta-robot/v2.1.0-6.0.rc1
2024-03-28 01:47:45 +00:00
邵非凡 c7d8ef17e3 !10575 check whether event in TaskQueue in query
Merge pull request !10575 from 邵非凡/v2.1.0-6.0.rc1
2024-03-27 11:19:19 +00:00
jiangpengfei 9f29db7417 !10741 Add warning when hccl timeout less than watchdog timeout.
Merge pull request !10741 from jiangpengfei/v2.1.0-6.0.rc1
2024-03-27 10:55:32 +00:00
pta-robot d1fd727744 !10728 Update op_plugin commit id
Merge pull request !10728 from pta-robot/v2.1.0-6.0.rc1
2024-03-26 16:14:34 +00:00
姜怡文 8301485bc1 !10714 Update torchair commit id
Merge pull request !10714 from 姜怡文/v2.1.0.rc1_format
2024-03-26 14:58:01 +00:00
yuhaiyan a7b59f6f14 !10615 Delete the URL in code
Merge pull request !10615 from yuhaiyan/v2.1.0-6rc1-dev7
2024-03-26 11:48:37 +00:00
王佰如 4273a61584 !10564 Bugfix: fix copy_ not supported broadcast problem
Merge pull request !10564 from 王佰如/v2.1.0-6.0.rc1
2024-03-26 10:53:01 +00:00
姜怡文 05759212ab !10663 Fix get_npu_format
Merge pull request !10663 from 姜怡文/v2.1.0.rc1_format
2024-03-26 09:10:23 +00:00
梅飞要 ea671a9c49 !10690 [PROF] update profiler db table
Merge pull request !10690 from 梅飞要/2.1.0_rc1
2024-03-26 08:26:04 +00:00
pta-robot 3a79f7e5d0 !10695 Update op_plugin commit id
Merge pull request !10695 from pta-robot/v2.1.0-6.0.rc1
2024-03-26 07:51:32 +00:00
杜金航 af8a32f556 !10577 add public address declaration.
Merge pull request !10577 from 杜金航/v2.1_cleancode
2024-03-26 06:38:57 +00:00
louyujing 1263131e15 !10677 【transfer_to_npu】Fallback adapt to third-party libraries that already support NPU
Merge pull request !10677 from louyujing/v2.1.0-6.0.rc1
2024-03-26 06:23:51 +00:00
闫鹏全 03108b427c !10675 update tensorpipe commit id
Merge pull request !10675 from 闫鹏全/v2.1.0-6.0.rc1
2024-03-26 05:58:26 +00:00
fanxiaotong ec26771139 !10643 fix bug
Merge pull request !10643 from fanxiaotong/v2.1.0-6.0.rc1
2024-03-26 05:09:04 +00:00
pta-robot 5a3c2e38be !10650 Update op_plugin commit id
Merge pull request !10650 from pta-robot/v2.1.0-6.0.rc1
2024-03-25 16:12:30 +00:00
陈兴宇 a44bfb0eb4 !10631 [Feature] add pertoken_scale and modify output_dtype for npu_quant_matmul
Merge pull request !10631 from 陈兴宇/commit_id_v2.1.0-6.0.rc1
2024-03-25 15:45:55 +00:00
torchair_robot 69d0620997 !10635 Update torchair commit id
Merge pull request !10635 from torchair_robot/v2.1.0-6.0.rc1
2024-03-25 14:11:31 +00:00
闫鹏全 673665f367 !10559 The framework deconstructs the resources of each device individually
Merge pull request !10559 from 闫鹏全/v2.1.0-6.0.rc1
2024-03-25 11:16:26 +00:00
MooYeh 15f503e3b1 !10584 [bugfix] Patch torch.Generator for npu
Merge pull request !10584 from MooYeh/v2.1.0-6.0.rc1-transfer_dts
2024-03-25 09:15:45 +00:00
torchair_robot 59a37e49fe !10590 Update torchair commit id
Merge pull request !10590 from torchair_robot/v2.1.0-6.0.rc1
2024-03-25 04:51:49 +00:00
杜金航 d02358615f !10533 the expandable_segments function defaults to false.
Merge pull request !10533 from 杜金航/v2.1_cleancode
2024-03-25 01:33:34 +00:00
pta-robot 94e3028335 !10572 Update op_plugin commit id
Merge pull request !10572 from pta-robot/v2.1.0-6.0.rc1
2024-03-23 11:05:13 +00:00
huangyunlong d4bb416cc9 !10516 [cleancode]code check.
Merge pull request !10516 from huangyunlong/2.1drc1
2024-03-23 10:20:35 +00:00
torchair_robot 289cb47895 !10553 Update torchair commit id
Merge pull request !10553 from torchair_robot/v2.1.0-6.0.rc1
2024-03-22 14:24:51 +00:00
裘凯达 61219d083a !10356 [PROF]Adapt profiling code to get RANK in torchrun.
Merge pull request !10356 from 裘凯达/v2.1.0-6.0.rc1
2024-03-22 09:01:23 +00:00
pta-robot 2d3019a093 !10531 Update op_plugin commit id
Merge pull request !10531 from pta-robot/v2.1.0-6.0.rc1
2024-03-22 03:35:11 +00:00
torchair_robot 382050cc95 !10524 Update torchair commit id
Merge pull request !10524 from torchair_robot/v2.1.0-6.0.rc1
2024-03-21 14:44:45 +00:00
刘嘉巍 03a3bb12eb !10372 [Fix] Modify empty api and add check for complex type.
Merge pull request !10372 from 刘嘉巍/v2.1.0-6.0.rc1
2024-03-21 14:00:48 +00:00
pta-robot 36a71cf4d9 !10520 Update op_plugin commit id
Merge pull request !10520 from pta-robot/v2.1.0-6.0.rc1
2024-03-21 13:59:13 +00:00
pta-robot 5db3bb978e !10508 Update op_plugin commit id
Merge pull request !10508 from pta-robot/v2.1.0-6.0.rc1
2024-03-21 11:28:01 +00:00
pta-robot 98bfc6a673 !10508 Update op_plugin commit id
Merge pull request !10508 from pta-robot/v2.1.0-6.0.rc1
2024-03-21 11:27:57 +00:00
dongwenbo6 9974f816ad !10447 modify type of warning_str to char *
Merge pull request !10447 from dongwenbo6/v2.1.0-6.0.rc1
2024-03-21 11:19:34 +00:00
torchair_robot 9aae5cf471 !10506 Update torchair commit id
Merge pull request !10506 from torchair_robot/v2.1.0-6.0.rc1
2024-03-21 11:13:49 +00:00
pta-robot cd5857771f !10510 Update op_plugin commit id
Merge pull request !10510 from pta-robot/v2.1.0-6.0.rc1
2024-03-21 11:12:32 +00:00
pta-robot 4eb1074bbc !10490 Update op_plugin commit id
Merge pull request !10490 from pta-robot/v2.1.0-6.0.rc1
2024-03-21 09:26:10 +00:00
pta-robot a318233ed7 !10461 Update op_plugin commit id
Merge pull request !10461 from pta-robot/v2.1.0-6.0.rc1
2024-03-20 12:01:25 +00:00
pta-robot 1e1bf08e01 !10464 Update op_plugin commit id
Merge pull request !10464 from pta-robot/v2.1.0-6.0.rc1
2024-03-20 11:46:11 +00:00
torchair_robot abf8986a51 !10466 Update torchair commit id
Merge pull request !10466 from torchair_robot/v2.1.0-6.0.rc1
2024-03-20 11:16:13 +00:00
王广斌 9cf6f699ab !10390 Bugfix: fix copy_ not supported broadcast problem
Merge pull request !10390 from 王广斌/bugfix_6.0.rc1-210
2024-03-20 09:56:09 +00:00
郭光浩 ee7381aa17 update OWNERS.
Signed-off-by: 郭光浩 <guoguanghao@huawei.com>
2024-03-20 09:35:24 +00:00
louyujing a54bf3febb !10440 【transfer_to_npu】Resolve conflicts between tools and meta devices
Merge pull request !10440 from louyujing/v2.1.0-6.0.rc1
2024-03-20 08:36:39 +00:00
yuhaiyan e10fe016de !10324 Fixed the failed test cases.
Merge pull request !10324 from yuhaiyan/v210-6rc-dev1
2024-03-20 08:30:25 +00:00
louyujing 1ecfc61ce6 !10437 【transfer_to_npu】Adapt to third-party libraries that already support NPU
Merge pull request !10437 from louyujing/v2.1.0-6.0.rc1
2024-03-20 06:46:47 +00:00
Leon 8c53a1f72f !10362 [Bugfix] fix gather dispatched to hccl backend when another backend is initialized.
Merge pull request !10362 from Leon/21_rc1
2024-03-20 01:05:43 +00:00
dongwenbo6 3cca352bdd !10402 modify char to char *
Merge pull request !10402 from dongwenbo6/v2.1.0-6.0.rc1
2024-03-19 14:34:18 +00:00
torchair_robot 0a48feb975 !10406 Update torchair commit id
Merge pull request !10406 from torchair_robot/v2.1.0-6.0.rc1
2024-03-19 13:18:13 +00:00
pta-robot f708f5fc52 !10377 Update op_plugin commit id
Merge pull request !10377 from pta-robot/v2.1.0-6.0.rc1
2024-03-19 07:33:59 +00:00
sunjiayang 5e0dda4fa9 !10317 fix error code
Merge pull request !10317 from sunjiayang/err-fix-210-rc1
2024-03-18 09:30:12 +00:00
pta-robot c5f320b2c0 !10313 Update op_plugin commit id
Merge pull request !10313 from pta-robot/v2.1.0-6.0.rc1
2024-03-18 04:46:04 +00:00
郭光浩 09ab02a60d !10266 Update submodule
Merge pull request !10266 from 郭光浩/v2.1.0-6.0.rc1
2024-03-18 03:35:14 +00:00
pta-robot 49e2b93a70 !10301 Update op_plugin commit id
Merge pull request !10301 from pta-robot/v2.1.0-6.0.rc1
2024-03-16 09:12:48 +00:00
pta-robot f5ee551c9e !10263 Update op_plugin commit id
Merge pull request !10263 from pta-robot/v2.1.0
2024-03-14 15:51:46 +00:00
郭光浩 cda222fb4c !10203 [Refactoring] fix codecheck
Merge pull request !10203 from 郭光浩/v2.1.0
2024-03-14 13:10:27 +00:00
张伟康 d0cbb24a12 !10257 update torchair commitid for 2.1.0
Merge pull request !10257 from 张伟康/v2.1.0
2024-03-14 11:50:11 +00:00
huangyunlong 4a274d33f5 !10208 [Cleancode]
Merge pull request !10208 from huangyunlong/2.1cld
2024-03-14 11:37:02 +00:00
梅飞要 891a3a07b5 !10248 [PROF][BUGFIX] judge tables if exist before get data from tables
Merge pull request !10248 from 梅飞要/ma2.1.0
2024-03-14 11:34:15 +00:00
sunjiayang 4ff2d29fac !10234 Delete error code
Merge pull request !10234 from sunjiayang/errcode_fix_210
2024-03-14 11:01:49 +00:00
邵非凡 04492398ed !10213 take NPUGuardImpl's event into task queue
Merge pull request !10213 from 邵非凡/v2.1.0
2024-03-14 06:27:51 +00:00
pta-robot a7837f482b !10230 Update op_plugin commit id
Merge pull request !10230 from pta-robot/v2.1.0
2024-03-13 10:54:01 +00:00
pta-robot d0298e13b1 !10230 Update op_plugin commit id
Merge pull request !10230 from pta-robot/v2.1.0
2024-03-13 10:53:57 +00:00
张伟康 b4151d0be8 !10225 update torchair commitid for 2.1.0
Merge pull request !10225 from 张伟康/v2.1.0
2024-03-13 09:37:19 +00:00
yuhaiyan 33144de22b !10062 Skip the failed test cases.
Merge pull request !10062 from yuhaiyan/v2.1.0-dev1
2024-03-13 08:01:55 +00:00
Leon 641ede6fac !9969 Improve Alltoall_single Performance
Merge pull request !9969 from Leon/21_
2024-03-13 06:22:51 +00:00
薛鹏 de312660c7 !10048 仅在使用图模式能力时,抛出图后端导入时的异常
Merge pull request !10048 from 薛鹏/v2.1.0
2024-03-13 06:08:16 +00:00
pta-robot 584a1bb028 !10218 Update op_plugin commit id
Merge pull request !10218 from pta-robot/v2.1.0
2024-03-13 05:20:56 +00:00
wuhy 55391766e6 !9590 Compile torchair in default
Merge pull request !9590 from wuhy/compile_torchair_210
2024-03-13 01:30:13 +00:00
louyujing d34ff37174 !10107 【transfer_to_npu】Adapt the parameter of get_backend
Merge pull request !10107 from louyujing/v2.1.0
2024-03-13 01:19:43 +00:00
wangjie 4a046a061f !10128 profiler support export communication info in db
Merge pull request !10128 from wangjie/communication_export_db_210
2024-03-12 13:23:21 +00:00
huangyunlong 7cebd04414 !10163 [doc]add .whl path.
Merge pull request !10163 from huangyunlong/2.1read
2024-03-12 12:53:48 +00:00
郭光浩 a0b21d61b9 !10131 【feature】add enviroment of GE_INIT_DISABLE
Merge pull request !10131 from 郭光浩/v2.1.0
2024-03-12 09:00:45 +00:00
梅飞要 c60c2d989d !10193 fix err of export data in db
Merge pull request !10193 from 梅飞要/ma2.1.0
2024-03-12 08:06:05 +00:00
lilei zheng 049d5cdb8f !10199 quantconv2d update commit id
Merge pull request !10199 from lilei zheng/quantConv2D
2024-03-12 06:07:03 +00:00
pta-robot 9a5e543369 !10191 Update op_plugin commit id
Merge pull request !10191 from pta-robot/v2.1.0
2024-03-12 03:09:04 +00:00
renqilin 65f4661b73 !9855 QuantConv2D_pt2.1
Merge pull request !9855 from renqilin/pt21
2024-03-12 01:31:02 +00:00
pta-robot 8c4ff8dd6a !10179 Update op_plugin commit id
Merge pull request !10179 from pta-robot/v2.1.0
2024-03-11 13:48:04 +00:00
梅飞要 433d881478 !10164 fix err of export data in db
Merge pull request !10164 from 梅飞要/v2.1.0
2024-03-11 13:25:44 +00:00
RousZhang 829388ccab !9408 Add meta api and ut for GroupedMatmul
Merge pull request !9408 from RousZhang/v2r1
2024-03-11 09:25:13 +00:00
闫鹏全 c3976d42b4 !9559 fix the way to call aclinit and aclfinalize
Merge pull request !9559 from 闫鹏全/v2.1.0
2024-03-11 03:57:11 +00:00
chlme16 09b1dc8dd1 !9724 pytorch export onnx for npu_quantize
Merge pull request !9724 from chlme16/onnx0226
2024-03-11 01:24:59 +00:00
pta-robot 416d94a478 !10152 Update op_plugin commit id
Merge pull request !10152 from pta-robot/v2.1.0
2024-03-09 10:41:26 +00:00
姜怡文 1b7b0bd595 !10117 Add SECURITYNOTE.md
Merge pull request !10117 from 姜怡文/v2.1.0_security
2024-03-09 09:41:01 +00:00
pta-robot 1afd7d2e90 !10146 Update op_plugin commit id
Merge pull request !10146 from pta-robot/v2.1.0
2024-03-09 09:10:34 +00:00
pta-robot 7433807097 !10136 Update op_plugin commit id
Merge pull request !10136 from pta-robot/v2.1.0
2024-03-09 05:08:32 +00:00
YuHao 77a94eee6e !10094 upsample_scale_bicubic2d skip ut
Merge pull request !10094 from YuHao/v2.1.0
2024-03-08 11:56:43 +00:00
pta-robot 9e5a0fed79 !10123 Update op_plugin commit id
Merge pull request !10123 from pta-robot/v2.1.0
2024-03-08 11:00:51 +00:00
pta-robot 33594b884a !10110 Update op_plugin commit id
Merge pull request !10110 from pta-robot/v2.1.0
2024-03-08 09:44:48 +00:00
louyujing 92d25130f2 !10041 【transfer_to_npu】Adapt the parameter of torch_cuda_device
Merge pull request !10041 from louyujing/v2.1.0
2024-03-08 08:58:35 +00:00
王嘉诚 997b490d9f !10068 【PTA】MC2 A8W8 supports BF16
Merge pull request !10068 from 王嘉诚/v2.1.0
2024-03-08 08:13:04 +00:00
梅飞要 db78727356 !10023 profiler support export data in db
Merge pull request !10023 from 梅飞要/2.1.0
2024-03-08 07:12:15 +00:00
dytc 446b665f42 !10078 skip ut
Merge pull request !10078 from dytc/master_2.1.0
2024-03-08 05:16:26 +00:00
pta-robot 60e45196ad !10081 Update op_plugin commit id
Merge pull request !10081 from pta-robot/v2.1.0
2024-03-08 04:57:15 +00:00
sunjiayang 01ae91d800 !10060 PTA Error code
Merge pull request !10060 from sunjiayang/ptaerrcode_210
2024-03-08 03:15:55 +00:00
chuboning 056e97dbe9 !10027 Fix coredump error when exception occurs
Merge pull request !10027 from chuboning/v2.1.0
2024-03-08 02:00:49 +00:00
万俊伟 0e26ad2ae8 !10056 update torchair commitid v2.1.0
Merge pull request !10056 from 万俊伟/v2.1.0_0307
2024-03-08 01:35:48 +00:00
pta-robot 14bf45e106 !10072 Update op_plugin commit id
Merge pull request !10072 from pta-robot/v2.1.0
2024-03-07 16:20:55 +00:00
DaiFu 4b4cbe26b0 !9987 [2.1.0]fix is_scalar_wrapped_to_device
Merge pull request !9987 from DaiFu/v2.1.0
2024-03-07 14:55:58 +00:00
MooYeh 206af5b0e3 !9905 enable memory sanitizer
Merge pull request !9905 from MooYeh/v2.1.0-memory-sanitizer-v2
2024-03-07 14:35:27 +00:00
pta-robot 31e7b23917 !10053 Update op_plugin commit id
Merge pull request !10053 from pta-robot/v2.1.0
2024-03-07 11:33:24 +00:00
邵非凡 534baca20a !9915 delete patch of reducer
Merge pull request !9915 from 邵非凡/d_reducer21
2024-03-07 11:11:58 +00:00
张伟康 2a96c92ee6 !9985 add npu_rotary_mul_backward in meta_registrations and UT
Merge pull request !9985 from 张伟康/v2.1.0
2024-03-07 09:35:04 +00:00
pta-robot 2d71088a18 !10033 Update op_plugin commit id
Merge pull request !10033 from pta-robot/v2.1.0
2024-03-07 08:14:52 +00:00
wangjie 470951aeea !9789 Fix python tracer module_uid sort by call_idx
Merge pull request !9789 from wangjie/fix_module_uid_sort_210
2024-03-07 01:36:29 +00:00
pta-robot 218c8ad316 !10015 Update op_plugin commit id
Merge pull request !10015 from pta-robot/v2.1.0
2024-03-06 14:04:42 +00:00
fanxiaotong dbad4206ea !10012 pytorch code adaption for msprof output path changes
Merge pull request !10012 from fanxiaotong/v2.1.0
2024-03-06 12:55:14 +00:00
董鸿儒 9ae2a52183 !9397 add scatterndupdate
Merge pull request !9397 from 董鸿儒/modify1
2024-03-06 12:43:42 +00:00
pta-robot 401e51f506 !10004 Update op_plugin commit id
Merge pull request !10004 from pta-robot/v2.1.0
2024-03-06 12:02:51 +00:00
王广斌 ecc6249ab2 !9551 Add generate python_functions feature
Merge pull request !9551 from 王广斌/2.1_copy
2024-03-06 09:16:58 +00:00
闫鹏全 d9741c2cd7 !9953 Add NPUGuard for create npu tensor
Merge pull request !9953 from 闫鹏全/emptytensor
2024-03-06 08:10:38 +00:00
huangyunlong 4f6c1bce5d !9924 [Feature]add errcode.
Merge pull request !9924 from huangyunlong/2.1thr
2024-03-06 04:04:10 +00:00
张向龙3 822d5b9d8f !9758 Change EXEC_NPU_CMD of aclnnInplaceCopy
Merge pull request !9758 from 张向龙3/guard_0227
2024-03-06 03:59:12 +00:00
lidonglei3 a230e1a29d !9929 change profile type into "ASCEND_PROFILER"
Merge pull request !9929 from lidonglei3/v2.1.0_remove_e2e
2024-03-06 03:55:47 +00:00
詹隽 7de2578cb6 !9999 update submodule
Merge pull request !9999 from 詹隽/v2.1.0
2024-03-06 03:36:59 +00:00
pta-robot 55598a317c !9995 Update op_plugin commit id
Merge pull request !9995 from pta-robot/v2.1.0
2024-03-06 03:11:45 +00:00
pta-robot 34d6e576a9 !9983 Update op_plugin commit id
Merge pull request !9983 from pta-robot/v2.1.0
2024-03-05 15:36:02 +00:00
闫鹏全 77b467252a !9949 Add device guard for npu current stream get
Merge pull request !9949 from 闫鹏全/guard
2024-03-05 14:33:22 +00:00
鲁博洋 7705c9d82a !9977 update torchair commitid v2.1.0
Merge pull request !9977 from 鲁博洋/v2.1.0
2024-03-05 14:24:05 +00:00
xudaohong f9d36f7695 !9959 [feat] modify aclGetCannAttribute interface
Merge pull request !9959 from xudaohong/v2.1.0
2024-03-05 13:55:57 +00:00
DaiFu f8328fe651 !9955 fix apply_tensor_use_empty
Merge pull request !9955 from DaiFu/v2.1.0
2024-03-05 12:50:11 +00:00
邵非凡 ee0ae1964e !9947 skip op which shouldn't register to NPU
Merge pull request !9947 from 邵非凡/skip_gen21
2024-03-05 12:25:22 +00:00
yuhaiyan bbad3f46e6 !9962 Skip the failed test cases
Merge pull request !9962 from yuhaiyan/v2.1.0-dev2
2024-03-05 11:03:23 +00:00
杜金航 0ec8a8c29f !9838 [2/N][memory_snapshot][feat]introduce trace tracker callback in cacheallocator.
Merge pull request !9838 from 杜金航/v2.1.0_snapshot
2024-03-05 09:15:32 +00:00
闫鹏全 14d491ab2c !9715 Supported d2d copy for OpApi
Merge pull request !9715 from 闫鹏全/opApicopy
2024-03-05 02:41:50 +00:00
yuhaiyan bf4479b04a !9896 skip the failed test cases.
Merge pull request !9896 from yuhaiyan/v2.1.0-dev1
2024-03-05 01:50:58 +00:00
chuboning 2c988ce2bc !9938 Skip error ut
Merge pull request !9938 from chuboning/v2.1.0
2024-03-05 01:46:55 +00:00
sunjiayang 831d5e39de !9881 asd fix
Merge pull request !9881 from sunjiayang/asd_210
2024-03-05 01:44:49 +00:00
郭光浩 17c9d8276c !9884 [Feature] Add ErrCode
Merge pull request !9884 from 郭光浩/v2.1.0-errcode
2024-03-05 01:21:49 +00:00
Leon d0058bdc80 !9858 support NSLB2.0
Merge pull request !9858 from Leon/21_final
2024-03-04 14:10:01 +00:00
pta-robot e6caab0d72 !9944 Update op_plugin commit id
Merge pull request !9944 from pta-robot/v2.1.0
2024-03-04 14:09:41 +00:00
DaiFu 316d82d325 !9916 [2.1.0]Modify PrivateUse1 in apply_tensor_use_empty
Merge pull request !9916 from DaiFu/v2.1.0
2024-03-04 12:59:44 +00:00
邵非凡 dbc388b3af !9913 skip op which shouldn't register to NPU
Merge pull request !9913 from 邵非凡/skip_gen21
2024-03-04 12:05:42 +00:00
pta-robot 38de3754f7 !9932 Update op_plugin commit id
Merge pull request !9932 from pta-robot/v2.1.0
2024-03-04 10:52:30 +00:00
pta-robot fe34ddf8a3 !9923 Update op_plugin commit id
Merge pull request !9923 from pta-robot/v2.1.0
2024-03-04 08:51:09 +00:00
DaiFu 9835ca809d !9872 [2.1.0]Skip UT
Merge pull request !9872 from DaiFu/v2.1.0
2024-03-04 06:39:36 +00:00
xudaohong e09dc72376 !9759 [feat] check infnan is supported by aclGetCannAttribute
Merge pull request !9759 from xudaohong/v2.1.0
2024-03-04 06:31:31 +00:00
lidonglei3 332098551c !9867 remove CANN Profiling and E2E Profiling
Merge pull request !9867 from lidonglei3/v2.1.0_remove_e2e
2024-03-04 01:21:15 +00:00
pta-robot bd833fa19f !9902 Update op_plugin commit id
Merge pull request !9902 from pta-robot/v2.1.0
2024-03-02 14:01:40 +00:00
huangyunlong 4f9eb9fb5b !9793 [feature]add errcode for dist.
Merge pull request !9793 from huangyunlong/2.1diserr
2024-03-02 10:42:22 +00:00
pta-robot 486c70f17c !9889 Update op_plugin commit id
Merge pull request !9889 from pta-robot/v2.1.0
2024-03-02 09:29:08 +00:00
邵非凡 eda7ddd402 !9865 skip fake crossref ut
Merge pull request !9865 from 邵非凡/skip21
2024-03-02 02:12:04 +00:00
詹昊 dd18736c72 !9812 add ut
Merge pull request !9812 from 詹昊/2.1ut
2024-03-02 02:11:22 +00:00
DaiFu 6008b703aa !9811 Modify PrivateUse1 in scalar_tensor
Merge pull request !9811 from DaiFu/v2.1.0
2024-03-01 09:21:27 +00:00
huangyunlong 0d9c675ed6 !9588 [Feature]add error code.
Merge pull request !9588 from huangyunlong/2.1err
2024-03-01 08:49:47 +00:00
pta-robot b988b1acb4 !9848 Update op_plugin commit id
Merge pull request !9848 from pta-robot/v2.1.0
2024-03-01 05:46:16 +00:00
sunjiayang b44c991d5c !9825 silent fault check
Merge pull request !9825 from sunjiayang/rh_210
2024-02-29 14:58:02 +00:00
pta-robot 4c18986e63 !9839 Update op_plugin commit id
Merge pull request !9839 from pta-robot/v2.1.0
2024-02-29 14:08:19 +00:00
xudaohong 217914985e !9836 [feat] update torchair commitid
Merge pull request !9836 from xudaohong/commitid
2024-02-29 13:46:00 +00:00
LuckyCM cc26c99654 !9637 【AR20240130909095】ifa support kvPaddingSize pytorch v2.1.0
Merge pull request !9637 from LuckyCM/br_kvpaddingsize
2024-02-29 12:18:01 +00:00
吴奕 800845a7cf !9818 add quant_matmul bf16 check
Merge pull request !9818 from 吴奕/cherry-pick-1709179539
2024-02-29 12:14:38 +00:00
杜金航 97251638ea !9762 [1/N][memory_snapshot][feat] add a facility to gather stack traces.
Merge pull request !9762 from 杜金航/v2.1.0_snapshot
2024-02-29 12:03:57 +00:00
huangyunlong 22885fd968 !9600 [Feature]add errorcode.
Merge pull request !9600 from huangyunlong/2.1pyerr
2024-02-29 10:04:40 +00:00
闫鹏全 80fece3559 !9657 Add p2p enable
Merge pull request !9657 from 闫鹏全/dp_copy
2024-02-29 09:27:37 +00:00
huiyingC 65d21f1ed8 !9540 FFN torch add optional params output_dtype
Merge pull request !9540 from huiyingC/v2.1.0
2024-02-29 08:36:33 +00:00
王夏夏 e53e90dbab !9548 The test cases of fx supports NPU.
Merge pull request !9548 from 王夏夏/v2.1.0
2024-02-29 04:26:52 +00:00
张伟康 92be04fe4e !9205 [UT] adapt official testcases for export module of pytorch2.1
Merge pull request !9205 from 张伟康/v2.1.0
2024-02-29 03:49:02 +00:00
chuboning c8f3162a7b !9571 Add distributed checkpoint support
Merge pull request !9571 from chuboning/v2.1.0-dcp
2024-02-29 02:27:56 +00:00
pta-robot 1db706eb95 !9803 Update op_plugin commit id
Merge pull request !9803 from pta-robot/v2.1.0
2024-02-28 17:27:24 +00:00
郭光浩 3787b0c313 !9797 [Feature] Add ErrCode
Merge pull request !9797 from 郭光浩/v2.1.0-guzhang
2024-02-28 15:30:52 +00:00
188******92 6aecd65ba2 !9685 modify op name format
Merge pull request !9685 from 188******92/vv2.1.0
2024-02-28 10:29:32 +00:00
pta-robot b88f10214b !9765 Update op_plugin commit id
Merge pull request !9765 from pta-robot/v2.1.0
2024-02-27 17:54:05 +00:00
pta-robot 024095f7f8 !9765 Update op_plugin commit id
Merge pull request !9765 from pta-robot/v2.1.0
2024-02-27 17:54:02 +00:00
董鸿儒 d27ecada98 !9390 add ApplyRotaryPosEmb for meta
Merge pull request !9390 from 董鸿儒/cherry-pick-1707011831
2024-02-27 14:58:56 +00:00
王强 804455ab38 !9783 update torchair commitid
Merge pull request !9783 from 王强/v2.1.0
2024-02-27 14:01:53 +00:00
陈泽仁 5bc25f138b !9781 临时规避仿真运行场景下初始化问题
Merge pull request !9781 from 陈泽仁/cherry-pick-1709036237
2024-02-27 13:51:39 +00:00
dongwenbo6 dba8413e20 !9730 add device synchronize for finalize_dump
Merge pull request !9730 from dongwenbo6/v2.1.0
2024-02-27 12:11:07 +00:00
huangyunlong 8bd5fca096 !9639 [Feature]add errorcode.
Merge pull request !9639 from huangyunlong/2.1pyerr2
2024-02-27 12:08:44 +00:00
桂若愚 30dad14ead !9756 QuantMatmul dtype check function update
Merge pull request !9756 from 桂若愚/cherry-pick-1709016291
2024-02-27 12:06:56 +00:00
邵非凡 1bcb239bdc !9768 update information of unsupported op
Merge pull request !9768 from 邵非凡/u_op_21
2024-02-27 11:40:40 +00:00
yangxiaorun 2d0364681a !9740 update submodule torchair
Merge pull request !9740 from yangxiaorun/v2.1.0
2024-02-27 08:12:44 +00:00
yuhaiyan 1693589ed3 !9616 Keep the test files synchronized with the official.
Merge pull request !9616 from yuhaiyan/v2.1.0-dev2
2024-02-27 06:15:26 +00:00
yuhaiyan d37d2baf91 !9607 Fixed for the public API.
Merge pull request !9607 from yuhaiyan/v2.1.0-dev1
2024-02-27 06:15:03 +00:00
yuhaiyan e792eb4911 !9741 Set enable_timing=True for test_npu_event_elapsed_time.
Merge pull request !9741 from yuhaiyan/v2.1.0-dev3
2024-02-27 06:01:32 +00:00
王强 ff4f484e6b !9739 update torchair commitid
Merge pull request !9739 from 王强/v2.1.0
2024-02-26 14:58:09 +00:00
pta-robot 0b6a11df78 !9738 Update op_plugin commit id
Merge pull request !9738 from pta-robot/v2.1.0
2024-02-26 13:59:56 +00:00
huangyunlong 325c68ca08 !9396 [fix]Serialization nd desc.
Merge pull request !9396 from huangyunlong/2.1ser
2024-02-26 07:03:44 +00:00
pta-robot 6636d9ad95 !9705 Update op_plugin commit id
Merge pull request !9705 from pta-robot/v2.1.0
2024-02-24 08:59:49 +00:00
zihan007 39ce62c1fc !9658 fix trans_quant_param bug
Merge pull request !9658 from zihan007/v2.1.0
2024-02-24 07:59:02 +00:00
卫朋 439c9d4768 !9433 add npu_quant_scatter
Merge pull request !9433 from 卫朋/v2.1.0
2024-02-24 07:40:12 +00:00
王强 dc89ca928a !9701 update torchair commit id
Merge pull request !9701 from 王强/v2.1.0
2024-02-24 07:12:22 +00:00
Mrtutu cf9a3d2ace !9534 Modify profiler not public API (v2.1.0)
Merge pull request !9534 from Mrtutu/v2.1.0
2024-02-24 06:45:52 +00:00
pta-robot 97c51368c2 !9696 Update op_plugin commit id
Merge pull request !9696 from pta-robot/v2.1.0
2024-02-24 04:57:37 +00:00
DaiFu 2f59a1a52c !9619 Add NPUGuard for copy_scalar_to_device
Merge pull request !9619 from DaiFu/v2.1.0
2024-02-24 03:38:46 +00:00
邵非凡 3f546052af !9439 use codegen to generate code which registered to pytorch
Merge pull request !9439 from 邵非凡/sparse_gen21
2024-02-24 02:59:18 +00:00
pta-robot afb1971fa7 !9689 Update op_plugin commit id
Merge pull request !9689 from pta-robot/v2.1.0
2024-02-23 13:50:13 +00:00
pta-robot 157ceda1d5 !9662 Update op_plugin commit id
Merge pull request !9662 from pta-robot/v2.1.0
2024-02-23 06:16:06 +00:00
pta-robot 08441fad37 !9662 Update op_plugin commit id
Merge pull request !9662 from pta-robot/v2.1.0
2024-02-23 06:16:02 +00:00
pta-robot b860750cbc !9643 Update op_plugin commit id
Merge pull request !9643 from pta-robot/v2.1.0
2024-02-22 13:59:06 +00:00
dongwenbo6 92bffbe15b !9622 Do not grow the scale past fp32 bounds to inf
Merge pull request !9622 from dongwenbo6/v2.1.0
2024-02-22 11:32:09 +00:00
sunjiayang 0c207b021d !8826 add timestamp and pid
Merge pull request !8826 from sunjiayang/errcode_210
2024-02-22 03:44:18 +00:00
zihan007 a30eba9ea8 !9629 trans_quant_params support scale shape (1, n)
Merge pull request !9629 from zihan007/v2.1.0
2024-02-22 02:30:15 +00:00
鲁博洋 07be99217a !9628 update torchair commitid v2.1.0
Merge pull request !9628 from 鲁博洋/v2.1.0
2024-02-21 09:45:51 +00:00
pta-robot 046613446f !9615 Update op_plugin commit id
Merge pull request !9615 from pta-robot/v2.1.0
2024-02-21 02:48:56 +00:00
pta-robot 73323dad06 !9603 Update op_plugin commit id
Merge pull request !9603 from pta-robot/v2.1.0
2024-02-20 10:55:30 +00:00
徐柯南 7a3f28eccb !9585 transquantparam support 2 dim number + quantmatmul bias batch check
Merge pull request !9585 from 徐柯南/shapecheckfix
2024-02-20 09:20:41 +00:00
yuhaiyan 828aa4f903 !9502 The test cases support NPU.
Merge pull request !9502 from yuhaiyan/v2.1.0-dev6
2024-02-20 09:20:09 +00:00
dongwenbo6 fee61752fa !9578 fix the problem of the same log printed repeatedly
Merge pull request !9578 from dongwenbo6/v2.1.0
2024-02-19 12:15:12 +00:00
xudaohong 2b021d2aa4 !9573 [feat] update torchair commit id
Merge pull request !9573 from xudaohong/v2.1.0
2024-02-19 06:16:55 +00:00
周先琪 6f1cfabd56 !9567 Bug Fix For Max Process Number
Merge pull request !9567 from 周先琪/v2.1.0
2024-02-19 01:31:18 +00:00
姜怡文 84c9fefbcb !9535 Close some temporary open interfaces
Merge pull request !9535 from 姜怡文/v2.1.0_event
2024-02-18 06:33:19 +00:00
闫鹏全 4bcb55ef91 !9536 update tensorpipe commitid
Merge pull request !9536 from 闫鹏全/tensorpipe
2024-02-18 06:31:16 +00:00
闫鹏全 de33c8ffe7 !9417 Modifiy the issuance process of OpCommand
Merge pull request !9417 from 闫鹏全/v2.1.0
2024-02-17 07:24:58 +00:00
姜怡文 cf68632d8e !9480 Fix GetDescForSerialization
Merge pull request !9480 from 姜怡文/v2.1.0_srial
2024-02-17 07:11:06 +00:00
pta-robot 13ed28171c !9542 Update op_plugin commit id
Merge pull request !9542 from pta-robot/v2.1.0
2024-02-17 05:01:01 +00:00
wangyunhang 34d812ae45 !9425 Provide interface such as getDeviceStatus, resetPeakStats for NPUPluggableAllocator
Merge pull request !9425 from wangyunhang/v2.1.0
2024-02-17 02:31:16 +00:00
yangxiaorun 0d3bd7d3d5 !9520 bugfix: report frist error in cann
Merge pull request !9520 from yangxiaorun/fix_error
2024-02-17 02:27:53 +00:00
weili10 e90d263182 !9525 [DFX] add timestamp\pid\device\rank info for error code message
Merge pull request !9525 from weili10/v2.1.0
2024-02-08 07:57:19 +00:00
鲁博洋 9226dea1a9 !9529 update torchair commitid v2.1.0
Merge pull request !9529 from 鲁博洋/v2.1.0
2024-02-08 07:16:38 +00:00
王夏夏 fb5dafdc87 !9319 [UT] Add official test cases for fx modules.
Merge pull request !9319 from 王夏夏/v2.1.0
2024-02-08 02:33:28 +00:00
王夏夏 18392222ee !9368 The test files support NPU.
Merge pull request !9368 from 王夏夏/v2.1.0
2024-02-08 02:32:53 +00:00
xudaohong a8f32bd3ab !9356 [fix] fix autograd.profiler recursive call MakeSureQueueEmpty
Merge pull request !9356 from xudaohong/cherry-pick-1706840252
2024-02-08 01:50:33 +00:00
桓永犇 030b3ae595 !9383 update FA ut
Merge pull request !9383 from 桓永犇/update_fa_ut_v2.1
2024-02-08 01:09:25 +00:00
pta-robot 70d599c4a6 !9516 Update op_plugin commit id
Merge pull request !9516 from pta-robot/v2.1.0
2024-02-07 09:49:16 +00:00
shaoyf adc7212ba1 !9505 Add test cases and fix possible problems with cp in some environments
Merge pull request !9505 from shaoyf/doc/210
2024-02-07 07:21:07 +00:00
王嘉诚 b0cce6f315 !9512 【PTA】support weight quant matmul_all_reduce
Merge pull request !9512 from 王嘉诚/v2.1.0
2024-02-07 06:05:35 +00:00
huangyunlong f444644be1 !9475 [Feature]add torch.npu.BFloat16Tensor interface.
Merge pull request !9475 from huangyunlong/2.1type16
2024-02-07 01:43:45 +00:00
pta-robot 90f97c9b76 !9488 Update op_plugin commit id
Merge pull request !9488 from pta-robot/v2.1.0
2024-02-06 19:48:15 +00:00
王嘉诚 d9c7f8b619 !9509 【PTA】revert quant matmul_all_reduce
Merge pull request !9509 from 王嘉诚/v2.1.0
2024-02-06 15:33:04 +00:00
huangyunlong b62d2b9cbb !9442 [fix]add parameter for libtorch ut.
Merge pull request !9442 from huangyunlong/2.1libut
2024-02-06 09:45:14 +00:00
yuhaiyan 620bcf1555 !9369 Add official source code for test_testing.py and test_utils.py.
Merge pull request !9369 from yuhaiyan/v2.1.0-dev3
2024-02-06 07:50:50 +00:00
yuhaiyan 4588337732 !9418 Fix a bug.
Merge pull request !9418 from yuhaiyan/v2.1.0-dev1
2024-02-06 07:49:54 +00:00
王嘉诚 2856523168 !8418 【PTA】support weight quant matmul_all_reduce
Merge pull request !8418 from 王嘉诚/v2.1.0
2024-02-06 07:46:50 +00:00
Leon 3217794ab2 !9304 support gather
Merge pull request !9304 from Leon/21_gather
2024-02-06 06:43:46 +00:00
pta-robot b2bbead88d !9459 Update op_plugin commit id
Merge pull request !9459 from pta-robot/v2.1.0
2024-02-05 17:13:25 +00:00
pta-robot 252a3755a3 !9459 Update op_plugin commit id
Merge pull request !9459 from pta-robot/v2.1.0
2024-02-05 17:13:22 +00:00
提军伟 00855fe789 !9474 update torchair and op-plugin commit id
Merge pull request !9474 from 提军伟/v2.1.0
2024-02-05 14:45:24 +00:00
shaoyf d17a531d60 !9465 Add _torch_npu_docs for torch_npu
Merge pull request !9465 from shaoyf/doc/210
2024-02-05 13:16:16 +00:00
王姜奔 92c4954a93 !9456 Use raise instead of exit to ensure that errors can be captured.
Merge pull request !9456 from 王姜奔/v2.1.0
2024-02-05 13:02:52 +00:00
提军伟 002f1f6d9d !9363 ifa support a8w8 in 2.1.0
Merge pull request !9363 from 提军伟/v2.1.0
2024-02-05 13:00:31 +00:00
周先琪 742257c745 !9295 Analyse Add max_process_number Parameter
Merge pull request !9295 from 周先琪/v2.1.0
2024-02-05 12:29:03 +00:00
188******92 464e3fcbac !9443 simplify communication matrix
Merge pull request !9443 from 188******92/v2.1.0
2024-02-05 11:52:40 +00:00
wuhy 4258ecd361 !9450 Standardize op name for test_ops
Merge pull request !9450 from wuhy/op_name_standardization-210
2024-02-05 07:42:33 +00:00
yangxiaorun 4f53dec57e !9438 update submodule torchair
Merge pull request !9438 from yangxiaorun/111
2024-02-05 01:29:29 +00:00
徐柯南 7fcd009089 !9412 fix bug in full graph mode
Merge pull request !9412 from 徐柯南/scalecheck
2024-02-05 01:19:11 +00:00
王强 ea4eea2f5b !9431 update torchair commit id
Merge pull request !9431 from 王强/v2.1.0
2024-02-04 13:06:41 +00:00
pta-robot 93dd1a8361 !9426 Update op_plugin commit id
Merge pull request !9426 from pta-robot/v2.1.0
2024-02-04 10:48:21 +00:00
杨彬榕 2129351803 !9407 pta adapt for pfa v3 interface ut
Merge pull request !9407 from 杨彬榕/v2.1.0
2024-02-04 09:13:53 +00:00
pta-robot a8ece37fda !9419 Update op_plugin commit id
Merge pull request !9419 from pta-robot/v2.1.0
2024-02-04 08:46:46 +00:00
pta-robot 42099ec4f3 !9395 Update op_plugin commit id
Merge pull request !9395 from pta-robot/v2.1.0
2024-02-04 05:29:55 +00:00
i-robot 0f223c5c38 !9186 Fix the public APIs.
Merge pull request !9186 from yuhaiyan/v2.1.0-dev1
2024-02-04 02:11:57 +00:00
yuhaiyan 42502303cb !9187 Add error_type.json for UT
Merge pull request !9187 from yuhaiyan/v2.1.0-dev2
2024-02-04 02:10:55 +00:00
杨彬榕 c8d1cb5a50 !9223 pta adapt for pfa v3 interface
Merge pull request !9223 from 杨彬榕/v2.1.0
2024-02-04 01:51:51 +00:00
pta-robot dec4d3dd95 !9386 Update op_plugin commit id
Merge pull request !9386 from pta-robot/v2.1.0
2024-02-02 13:56:26 +00:00
pta-robot 7299d6d9b7 !9373 Update op_plugin commit id
Merge pull request !9373 from pta-robot/v2.1.0
2024-02-02 08:53:23 +00:00
闫鹏全 9a369b0ddc !9352 Add testcase for single process multiple-devices
Merge pull request !9352 from 闫鹏全/v2.1.0
2024-02-02 08:52:33 +00:00
张伟康 9c176bc557 !8921 add some UT cases for npu dynamo export
Merge pull request !8921 from 张伟康/v2.1.0_export
2024-02-02 08:06:54 +00:00
王夏夏 63b4421f9e !9137 [UT] add official testcase files for fx.
Merge pull request !9137 from 王夏夏/v2.1.0
2024-02-02 02:39:17 +00:00
王夏夏 06a908463a !9120 [UT] add official testcase files for functionalization and functionalization of rng ops.
Merge pull request !9120 from 王夏夏/v2.1.0
2024-02-02 02:38:54 +00:00
chuboning 4f5a172421 !9284 Hiding functions that should not be exposed
Merge pull request !9284 from chuboning/v2.1.0
2024-02-02 02:14:52 +00:00
weili10 2a89a16c4e update OWNERS.
Signed-off-by: weili10 <liwei386@huawei.com>
2024-02-02 02:02:42 +00:00
pta-robot c26a0c6562 !9344 Update op_plugin commit id
Merge pull request !9344 from pta-robot/v2.1.0
2024-02-01 15:43:17 +00:00
huangyunlong c1f96a6cf9 !9180 [Feature]add lazy_init for make_npu_storage_impl.
Merge pull request !9180 from huangyunlong/2.1init
2024-02-01 11:14:39 +00:00
pta-robot c438c912a3 !9336 Update op_plugin commit id
Merge pull request !9336 from pta-robot/v2.1.0
2024-02-01 10:40:09 +00:00
pta-robot 3f8fcaa39d !9336 Update op_plugin commit id
Merge pull request !9336 from pta-robot/v2.1.0
2024-02-01 10:40:06 +00:00
徐柯南 c1a4b148be !9329 add ut converage
Merge pull request !9329 from 徐柯南/addUT
2024-02-01 08:25:31 +00:00
徐柯南 4d9fd391da !9318 add quant matmul fake tensor ut
Merge pull request !9318 from 徐柯南/addquantmatmulUT
2024-02-01 03:37:10 +00:00
pta-robot f21eb9a52c !9321 Update op_plugin commit id
Merge pull request !9321 from pta-robot/v2.1.0
2024-01-31 11:11:49 +00:00
徐柯南 7a45abf447 !9311 添加scale参数对bf16数据类型的支持
Merge pull request !9311 from 徐柯南/addBF16
2024-01-31 08:37:12 +00:00
pta-robot cd62eeaeca !9309 Update op_plugin commit id
Merge pull request !9309 from pta-robot/v2.1.0
2024-01-31 05:07:53 +00:00
徐柯南 e4a6b2b00a !9302 fix bug linear quant
Merge pull request !9302 from 徐柯南/fixbug
2024-01-31 02:29:39 +00:00
徐柯南 4d4bdcd907 !9283 add quant matmul shape and dtype check
Merge pull request !9283 from 徐柯南/addShapeCheck
2024-01-30 13:45:24 +00:00
yuhaiyan 084a93313a !9191 Add official source code for test_dispatch.py.
Merge pull request !9191 from yuhaiyan/v2.1.0-dev3
2024-01-30 12:48:41 +00:00
文俊 71fdf345f2 !9184 delete skip
Merge pull request !9184 from 文俊/v2.1.0
2024-01-30 12:45:15 +00:00
Leon d525dd60cd !9172 [refactor public API] Rename npu_testing_utils.
Merge pull request !9172 from Leon/21_
2024-01-30 11:58:00 +00:00
裘凯达 a032837e3f !9278 Add Stream Ptr entry in memory_record.csv
Merge pull request !9278 from 裘凯达/pta210_bugfix
2024-01-30 11:43:03 +00:00
yuhaiyan cdffd15058 Merge branch 'v2.1.0' of gitee.com:ascend/pytorch into v2.1.0-dev1
Signed-off-by: yuhaiyan <yuhaiyan8@huawei.com>
2024-01-30 11:33:07 +00:00
pta-robot cb5474bc65 !9289 Update op_plugin commit id
Merge pull request !9289 from pta-robot/v2.1.0
2024-01-30 11:13:10 +00:00
zihan007 7afe384eee !9281 add module LinearWeightQuant
Merge pull request !9281 from zihan007/v2.1.0
2024-01-30 09:22:40 +00:00
pta-robot f3595f20a9 !9276 Update op_plugin commit id
Merge pull request !9276 from pta-robot/v2.1.0
2024-01-30 04:53:34 +00:00
yangxiaorun c4e2e2c690 !9261 update torchair submodule 2.1
Merge pull request !9261 from yangxiaorun/cherry-pick-1706534336
2024-01-30 01:16:51 +00:00
pta-robot 55900e80c5 !9267 Update op_plugin commit id
Merge pull request !9267 from pta-robot/v2.1.0
2024-01-29 18:17:37 +00:00
pta-robot 2e7851faa7 !9249 Update op_plugin commit id
Merge pull request !9249 from pta-robot/v2.1.0
2024-01-29 08:41:42 +00:00
pta-robot ca89019cb7 !9244 Update op_plugin commit id
Merge pull request !9244 from pta-robot/v2.1.0
2024-01-29 03:08:19 +00:00
dongwenbo6 0139318344 !9229 Delete the public URL
Merge pull request !9229 from dongwenbo6/v2.1.0
2024-01-29 02:05:26 +00:00
pta-robot db4c1e0095 !9236 Update op_plugin commit id
Merge pull request !9236 from pta-robot/v2.1.0
2024-01-27 10:48:35 +00:00
pta-robot 4cf34d3a91 !9236 Update op_plugin commit id
Merge pull request !9236 from pta-robot/v2.1.0
2024-01-27 10:48:32 +00:00
鲁博洋 04457a925f !9231 update torchair commitid v2.1.0
Merge pull request !9231 from 鲁博洋/v2.1.0
2024-01-27 09:30:25 +00:00
万俊伟 d791b36a07 !9218 update torchair commitid v2.1.0
Merge pull request !9218 from 万俊伟/v2.1.0_0126
2024-01-27 01:41:28 +00:00
yuhaiyan 9c4a3a6710 fixed for publicAPI
fixed

fixed

fixed
2024-01-26 17:48:52 +08:00
xudaohong d1c8df5681 !8898 [feat] event log
Merge pull request !8898 from xudaohong/v2.1.0
2024-01-26 07:15:45 +00:00
pta-robot ca7cb6e54e !9215 Update op_plugin commit id
Merge pull request !9215 from pta-robot/v2.1.0
2024-01-26 02:46:25 +00:00
郭光浩 7447049533 !9197 Modify the hyperlink of the document in the README
Merge pull request !9197 from 郭光浩/v2.1.0
2024-01-25 14:43:32 +00:00
pta-robot 9362400908 !9203 Update op_plugin commit id
Merge pull request !9203 from pta-robot/v2.1.0
2024-01-25 14:09:44 +00:00
王广斌 e4c61154f9 !9034 Add SupportedDevice decorator for UT framework
Merge pull request !9034 from 王广斌/2.1_copy
2024-01-25 12:11:30 +00:00
闫鹏全 2faaadff04 !9165 Safety rectification, hiding functions that should not be exposed
Merge pull request !9165 from 闫鹏全/v2.1.0
2024-01-25 11:45:46 +00:00
liuguoyue 2a77dac407 !9094 add onnx export function for antiQuant
Merge pull request !9094 from liuguoyue/AntiQuantOnnxV2.1.0
2024-01-25 07:00:11 +00:00
裘凯达 b88cd9c08f !9153 Bugfix for Ascend PyTorch Profiler.
Merge pull request !9153 from 裘凯达/pta210_bugfix
2024-01-25 06:16:53 +00:00
yayahello 4a5ad9a563 !9176 update commit id
Merge pull request !9176 from yayahello/v2.1.0
2024-01-25 06:15:19 +00:00
wangjie 4bb49b21c3 !9030 Add Pytorch nn.Module data collect and analysis
Merge pull request !9030 from wangjie/pta210_nnmodule
2024-01-25 02:34:25 +00:00
杜金航 c55913ec57 !9045 The expandable_segments function defaults to true.
Merge pull request !9045 from 杜金航/v2.1.0
2024-01-25 02:23:27 +00:00
pta-robot fa22cc00a3 !9171 Update op_plugin commit id
Merge pull request !9171 from pta-robot/v2.1.0
2024-01-24 10:41:43 +00:00
pta-robot f29960f1b6 !9161 Update op_plugin commit id
Merge pull request !9161 from pta-robot/v2.1.0
2024-01-24 09:10:37 +00:00
Leon fa1bc3c540 !9042 support zero1
Merge pull request !9042 from Leon/21_new
2024-01-24 08:14:30 +00:00
姜怡文 88809834a3 !9149 Skip failed UT
Merge pull request !9149 from 姜怡文/v2.1.0_skip
2024-01-24 08:09:49 +00:00
梅飞要 52ef5fc5d2 !9096 data simplification default on in cluster and non-cluster scene
Merge pull request !9096 from 梅飞要/2.1.0
2024-01-24 07:25:07 +00:00
zhangyc 0509deaf25 !8983 PTA adaption for IFA pse_shift
Merge pull request !8983 from zhangyc/v2.1.0
2024-01-24 06:02:33 +00:00
裘凯达 9b2759b6be !9119 Add stream_ptr and active data in Ascend PyTorch Profiler.
Merge pull request !9119 from 裘凯达/pta210_active
2024-01-24 04:38:21 +00:00
pta-robot 2dc58a3a0a !9140 Update op_plugin commit id
Merge pull request !9140 from pta-robot/v2.1.0
2024-01-24 02:51:33 +00:00
TYWZ22259 b465d94688 !9131 Update torchair commitid
Merge pull request !9131 from TYWZ22259/torchair_submodule_v2.1.0
2024-01-23 13:37:40 +00:00
关龙锋 e16cfb628b !9127 update torchair commitid v2.1.0
Merge pull request !9127 from 关龙锋/v2.1.0
2024-01-23 12:52:34 +00:00
chuboning 8d4347daae !9001 Update device management functions
Merge pull request !9001 from chuboning/v2.1.0
2024-01-23 11:30:20 +00:00
闫鹏全 70383c0bbb !8978 Extend the stream init flag so that it corresponds to default_stream array
Merge pull request !8978 from 闫鹏全/v2.1.0
2024-01-23 02:18:55 +00:00
Leon f30cbb019f !9008 support batch send recv
Merge pull request !9008 from Leon/21_pr
2024-01-23 01:20:36 +00:00
pta-robot be2e343ff0 !9109 Update op_plugin commit id
Merge pull request !9109 from pta-robot/v2.1.0
2024-01-22 10:46:33 +00:00
张伟康 ce19b0a334 !9043 Modify the access_control_test file to the dynamo module PR for PTA21
Merge pull request !9043 from 张伟康/v2.1.0_ci
2024-01-22 06:30:40 +00:00
liuguoyue c6d57da5a5 !9051 新增antiQuant算子meta registration
Merge pull request !9051 from liuguoyue/AntiQuantMetaV2.1.0
2024-01-22 06:28:50 +00:00
huangyunlong 71a156299d !8788 [feature]set_tensor_with_storage_format support multiple device.
Merge pull request !8788 from huangyunlong/2.1set
2024-01-22 02:08:11 +00:00
王夏夏 508f7effef !9000 remove skip for nn testcases.
Merge pull request !9000 from 王夏夏/v2.1.0
2024-01-22 01:40:43 +00:00
周先琪 09650ba299 !9007 Fix For Level0 Aic_metrics Conflict
Merge pull request !9007 from 周先琪/v2.1.0
2024-01-22 01:21:56 +00:00
TYWZ22259 20eb6492ad !9090 AddRmsNorm support onnx for v2.1.0
Merge pull request !9090 from TYWZ22259/add_rms_norm_onnx_v2.1.0
2024-01-20 11:58:47 +00:00
桂若愚 bd35275d48 !9085 Update torchair commitid
Merge pull request !9085 from 桂若愚/cherry-pick-1705739454
2024-01-20 09:26:42 +00:00
桂若愚 0884955315 !9058 Add and optional input in quant_batch_matmul
Merge pull request !9058 from 桂若愚/cherry-pick-1705658843
2024-01-20 07:06:19 +00:00
xudaohong 4acf6e9e51 !9062 [feat] MULTI_STREAM_MEMORY_REUSE add avoid recordStream mode
Merge pull request !9062 from xudaohong/v2.1.0-m
2024-01-20 06:45:03 +00:00
pta-robot e9bc6c5dd0 !9075 Update op_plugin commit id
Merge pull request !9075 from pta-robot/v2.1.0
2024-01-20 04:20:46 +00:00
pta-robot ed4a85df28 !9054 Update op_plugin commit id
Merge pull request !9054 from pta-robot/v2.1.0
2024-01-19 12:27:46 +00:00
王姜奔 c514ae7c0d update OWNERS.
Signed-off-by: 王姜奔 <wangjiangben@huawei.com>
2024-01-19 11:22:03 +00:00
杜金航 6d8dd25ee5 !8865 [feat] Add Pluggable NPU allocator backend.
Merge pull request !8865 from 杜金航/v2.1.0_pluggable
2024-01-19 09:36:03 +00:00
pta-robot 6b76e0922b !9039 Update op_plugin commit id
Merge pull request !9039 from pta-robot/v2.1.0
2024-01-19 02:52:37 +00:00
xudaohong 716e728f8c !9017 [feat] MakeSureQueueEmpty add RECORD_FUNCTION
Merge pull request !9017 from xudaohong/cherry-pick-1705541049
2024-01-19 02:30:02 +00:00
pta-robot 85c87f6a70 !9026 Update op_plugin commit id
Merge pull request !9026 from pta-robot/v2.1.0
2024-01-18 10:57:33 +00:00
万俊伟 96048095cb !8995 update torchair commitid v2.1.0
Merge pull request !8995 from 万俊伟/v2.1.0_0117
2024-01-17 06:16:17 +00:00
王夏夏 bbb817131e !8771 add testcase for FusedColorJitter.
Merge pull request !8771 from 王夏夏/v2.1.0
2024-01-17 06:13:51 +00:00
pta-robot 5947280f16 !8988 Update op_plugin commit id
Merge pull request !8988 from pta-robot/v2.1.0
2024-01-17 02:44:01 +00:00
chlme16 f32db1b3a7 !8525 add quantize fx graph converter config
Merge pull request !8525 from chlme16/quantize1221
2024-01-16 12:33:05 +00:00
徐柯南 18a76f2bee !8935 quant matmul infershape
Merge pull request !8935 from 徐柯南/fixinferv21
2024-01-16 09:31:19 +00:00
杜承昆 3e08b5fcfc !8861 Patch some func for recompute in dynamo
Merge pull request !8861 from 杜承昆/checkpoint
2024-01-16 06:51:20 +00:00
pta-robot 13086c2858 !8966 Update op_plugin commit id
Merge pull request !8966 from pta-robot/v2.1.0
2024-01-15 15:57:10 +00:00
pta-robot c1714ecffd !8966 Update op_plugin commit id
Merge pull request !8966 from pta-robot/v2.1.0
2024-01-15 15:57:08 +00:00
pta-robot 5bfd2f13b6 !8957 Update op_plugin commit id
Merge pull request !8957 from pta-robot/v2.1.0
2024-01-15 13:55:46 +00:00
闫鹏全 6b96a04430 !8839 Move device context management to c10_npu::SetDevice
Merge pull request !8839 from 闫鹏全/v2.1.0
2024-01-15 13:09:47 +00:00
lilei zheng f8e923ab55 !8946 Update torchair commit id
Merge pull request !8946 from lilei zheng/cherry-pick-1705319213
2024-01-15 12:36:25 +00:00
RousZhang a43b67943f !8910 Update torchair commit id
Merge pull request !8910 from RousZhang/v2r1
2024-01-15 11:10:59 +00:00
杨彬榕 be15110e19 !8923 fix pfa pading_mask submodle
Merge pull request !8923 from 杨彬榕/v2.1.0
2024-01-15 07:23:04 +00:00
杨彬榕 30e0b5f9d1 !8856 fix pfa pading_mask
Merge pull request !8856 from 杨彬榕/v2.1.0
2024-01-15 01:44:26 +00:00
鲁博洋 da629f6df7 !8907 update torchair commitid v2.1.0
Merge pull request !8907 from 鲁博洋/v2.1.0
2024-01-12 09:53:16 +00:00
pta-robot 3152cb8936 !8901 Update op_plugin commit id
Merge pull request !8901 from pta-robot/v2.1.0
2024-01-12 08:50:30 +00:00
yuhaiyan 3eff2dab30 !8822 The test files support NPU.
Merge pull request !8822 from yuhaiyan/v2.1.0-dev5
2024-01-12 07:13:34 +00:00
yuhaiyan bcd6b5c7fd !8876 Delete the skipping for the test case.
Merge pull request !8876 from yuhaiyan/v2.1.0-dev6
2024-01-12 07:01:05 +00:00
pta-robot 8aba3040c1 !8890 Update op_plugin commit id
Merge pull request !8890 from pta-robot/v2.1.0
2024-01-11 13:54:04 +00:00
pta-robot 7678b4f2ba !8887 Update op_plugin commit id
Merge pull request !8887 from pta-robot/v2.1.0
2024-01-11 12:53:15 +00:00
pta-robot b390de830d !8887 Update op_plugin commit id
Merge pull request !8887 from pta-robot/v2.1.0
2024-01-11 12:53:12 +00:00
xudaohong ef8695ab08 !8872 [feat] replace NPUGuardImpl event create interface
Merge pull request !8872 from xudaohong/cherry-pick-1704948673
2024-01-11 12:16:36 +00:00
徐柯南 9e188b60a0 !8879 update commit id
Merge pull request !8879 from 徐柯南/updatecommid21
2024-01-11 11:30:04 +00:00
姜怡文 4cb5cf1991 !8554 Fix storage.resize's bug
Merge pull request !8554 from 姜怡文/v2.1.0_resize
2024-01-11 11:05:03 +00:00
徐柯南 fa3b94899a !8874 linear quant module
Merge pull request !8874 from 徐柯南/ttt
2024-01-11 09:41:32 +00:00
赖长铃 2e8e9f1d8c !8698 add ops header files
Merge pull request !8698 from 赖长铃/v21_add_ops_head
2024-01-11 09:25:24 +00:00
chenjionghui 7a9c5be922 !8639 DeepNorm support onnx on v2.1.0
Merge pull request !8639 from chenjionghui/v2.1.0
2024-01-11 06:43:01 +00:00
louyujing b933689ed5 !8847 Transform cuda information of torch autocast to npu
Merge pull request !8847 from louyujing/v2.1.0
2024-01-11 06:08:03 +00:00
xudaohong 845a5b05fd !8859 [fix] eraseStream only get aclrtStream but not clear taskqueue
Merge pull request !8859 from xudaohong/cherry-pick-1704869587
2024-01-11 02:21:48 +00:00
邵非凡 7c09ae141d !8713 PTA support to create SparseCoo Tensor.
Merge pull request !8713 from 邵非凡/sparse21
2024-01-11 02:06:12 +00:00
yuhaiyan b0533aa892 !8723 Fixed the failed test cases.
Merge pull request !8723 from yuhaiyan/v2.1.0-dev2
2024-01-10 07:18:56 +00:00
lj_new 7b8519e7c1 !8835 Use global flag to fix destruction error of tensor on the second stream
Merge pull request !8835 from lj_new/v2.1.0
2024-01-10 06:41:03 +00:00
pta-robot dd4b4d7c95 !8851 Update op_plugin commit id
Merge pull request !8851 from pta-robot/v2.1.0
2024-01-10 02:39:18 +00:00
yuhaiyan d3e83926ff !8803 Test_dataloader.py and test_autocast.py support NPU.
Merge pull request !8803 from yuhaiyan/v2.1.0-dev3
2024-01-10 02:14:12 +00:00
shaoyf 87766d035f !8785 Fix test_npu_fused_attention_layernorm_qkv_fwd.py
Merge pull request !8785 from shaoyf/layernorm/210_fix_ut
2024-01-10 01:53:00 +00:00
万俊伟 dc747a0359 !8838 update torchair commitid v2.1.0
Merge pull request !8838 from 万俊伟/v2.1.0_0108
2024-01-09 15:17:59 +00:00
阮晨杰 042fa2c8a7 !8849 【WeightQuantBatchMamtulV2】 Changes Due to Interface Modification
Merge pull request !8849 from 阮晨杰/v2.1.0
2024-01-09 13:21:06 +00:00
RousZhang fb950244e3 !8834 Add selective processing for input and output data type of antiquant; synchronize newest PR of torchair
Merge pull request !8834 from RousZhang/dev
2024-01-09 06:17:23 +00:00
pta-robot 9bb8b8d77e !8841 Update op_plugin commit id
Merge pull request !8841 from pta-robot/v2.1.0
2024-01-09 04:55:08 +00:00
shaoyf 9919eee091 !8818 add patch for optim
Merge pull request !8818 from shaoyf/optim/210_patch
2024-01-08 12:57:23 +00:00
徐柯南 aaae4468d5 !8824 update torchair commit id
Merge pull request !8824 from 徐柯南/updateCommitIDV21
2024-01-08 11:08:47 +00:00
xudaohong 86440876b6 !8688 [fix] before synchronize Event make sure Event deque
Merge pull request !8688 from xudaohong/cherry-pick-1703662207
2024-01-08 07:54:17 +00:00
徐柯南 35000ff899 !8807 transquantparamv2 infershape
Merge pull request !8807 from 徐柯南/transqpv21
2024-01-08 07:52:11 +00:00
yuhaiyan c912d402be !8720 Add official source code for UT
Merge pull request !8720 from yuhaiyan/v2.1.0-dev1
2024-01-08 07:23:29 +00:00
pta-robot b0d9fb312d !8816 Update op_plugin commit id
Merge pull request !8816 from pta-robot/v2.1.0
2024-01-08 04:44:48 +00:00
pta-robot cdbb5ad81f !8816 Update op_plugin commit id
Merge pull request !8816 from pta-robot/v2.1.0
2024-01-08 04:44:45 +00:00
chuboning 2233c3b21f !8739 Fix "libgomp.so.1 cannot allocate memory in static TLS block" error
Merge pull request !8739 from chuboning/v2.1.0
2024-01-08 02:23:41 +00:00
chlme16 e18b6eaa57 !7044 Fix the problem of UT
Merge pull request !7044 from chlme16/multi21
2024-01-08 02:05:09 +00:00
姜怡文 1887c5a274 !8809 Change the way to get base nbytes
Merge pull request !8809 from 姜怡文/v2.1.0_storage
2024-01-06 07:34:44 +00:00
徐柯南 db883cedb8 !8658 quant matmul infershape
Merge pull request !8658 from 徐柯南/quantmatmul21infershape
2024-01-05 09:16:00 +00:00
zqh 5fc9111a0c !8801 FFN torch api add parameters for quant and antiquant
Merge pull request !8801 from zqh/0105_v2.1.0
2024-01-05 08:11:22 +00:00
huangyunlong b8350e5bc4 !8768 [Fix]fix the bug for lazy_init.
Merge pull request !8768 from huangyunlong/2.1lazy
2024-01-05 07:04:25 +00:00
鲁博洋 889198313e !8778 update torchair commitid v2.1.0
Merge pull request !8778 from 鲁博洋/v2.1.0
2024-01-05 01:25:12 +00:00
pta-robot b5fe032541 !8795 Update op_plugin commit id
Merge pull request !8795 from pta-robot/v2.1.0
2024-01-04 15:44:01 +00:00
pta-robot d806efcfed !8795 Update op_plugin commit id
Merge pull request !8795 from pta-robot/v2.1.0
2024-01-04 15:43:59 +00:00
pta-robot 6e5d3810cf !8790 Update op_plugin commit id
Merge pull request !8790 from pta-robot/v2.1.0
2024-01-04 13:42:50 +00:00
pta-robot 0491c043c9 !8790 Update op_plugin commit id
Merge pull request !8790 from pta-robot/v2.1.0
2024-01-04 13:42:48 +00:00
pta-robot a54bab63ba !8784 Update op_plugin commit id
Merge pull request !8784 from pta-robot/v2.1.0
2024-01-04 10:41:04 +00:00
pta-robot 39f29d5ea4 !8773 Update op_plugin commit id
Merge pull request !8773 from pta-robot/v2.1.0
2024-01-03 15:32:42 +00:00
闫鹏全 5f301650dd !8749 Remove resetdevice steps when exchange device.
Merge pull request !8749 from 闫鹏全/v2.1.0
2024-01-03 11:28:51 +00:00
姜怡文 575af7aaba !8726 Fix torch_npu.save
Merge pull request !8726 from 姜怡文/v2.1.0_storage
2024-01-03 10:29:17 +00:00
hebeishi22 2b07c5f7ac !8725 ONNX Export WeightQuantBatchMatmulV2
Merge pull request !8725 from hebeishi22/v2.1.0
2024-01-03 07:22:01 +00:00
pta-robot 54dc22785c !8752 Update op_plugin commit id
Merge pull request !8752 from pta-robot/v2.1.0
2024-01-03 04:42:36 +00:00
pta-robot 6dad2028e6 !8752 Update op_plugin commit id
Merge pull request !8752 from pta-robot/v2.1.0
2024-01-03 04:42:35 +00:00
MooYeh de32feff7e !8735 Add UTs for profiler prof_common_func
Merge pull request !8735 from MooYeh/v2.1.0_pta_ut_prof_common_func
2024-01-03 03:34:10 +00:00
MooYeh a05475f956 !8732 Add UTs for profiler prof_bean
Merge pull request !8732 from MooYeh/v2.1.0_pta_ut_prof_bean
2024-01-03 03:33:45 +00:00
MooYeh 4d894431bc !8729 Add UTs for Ascend PyTorch Profiler
Merge pull request !8729 from MooYeh/v2.1.0
2024-01-03 03:33:08 +00:00
wuhy 7aaaebe215 !8743 Use list slice when ignoring test_ops
Merge pull request !8743 from wuhy/slow-test-ignore-issue-210
2024-01-03 01:09:59 +00:00
pta-robot d8d0b3c635 !8746 Update op_plugin commit id
Merge pull request !8746 from pta-robot/v2.1.0
2024-01-02 16:36:56 +00:00
文俊 38d2039e6e !8666 Fix the failed UT.
Merge pull request !8666 from 文俊/v2.1.0
2024-01-02 12:22:18 +00:00
戢芳 e0dfc88969 !8588 Fix bug in testcase.
Merge pull request !8588 from 戢芳/ut2.1
2024-01-02 12:18:10 +00:00
王强 dc171b28fc !8738 update torchair
Merge pull request !8738 from 王强/v2.1.0
2023-12-29 10:01:57 +00:00
yuhaiyan 754e8fa8c7 !8606 Fixed the failed test cases.
Merge pull request !8606 from yuhaiyan/v2.1.0-dev4
2023-12-29 09:35:16 +00:00
yuhaiyan 68a9675ee0 !8644 Add official source code for test_dataload.py and test_autocast.py.
Merge pull request !8644 from yuhaiyan/v2.1.0-dev5
2023-12-29 09:34:42 +00:00
zhaolei156 a789300f64 !8516 Del skip and Run ut with aclnn v2.1.0
Merge pull request !8516 from zhaolei156/fix_ut_v2.1.0
2023-12-29 09:30:55 +00:00
张伟康 3bb35dabe3 !8714 [UT] add and adapt official source testcases for dynamo module for torch2.1
Merge pull request !8714 from 张伟康/v2.1.0-dev
2023-12-29 09:26:41 +00:00
王夏夏 457e62be57 !8719 remove skip for nn Module.
Merge pull request !8719 from 王夏夏/v2.1.0
2023-12-29 09:17:21 +00:00
王夏夏 f90de4f1bf !8712 test_npu.py and test_npu_multinpu.py support npu device.
Merge pull request !8712 from 王夏夏/v2.1.0
2023-12-29 09:14:49 +00:00
wuhy 6c23e4ebeb !8697 Only run test_ops when facing op_ut_files
Merge pull request !8697 from wuhy/opinfo-issue-210
2023-12-29 09:11:47 +00:00
Qing 91ba6117f0 !8645 Add ut test for dynamo: test_misc
Merge pull request !8645 from Qing/v2.1.0
2023-12-29 06:03:59 +00:00
i-robot 99cc1d17de !8705 update torchair commitid v2.1.0
Merge pull request !8705 from 鲁博洋/v2.1.0
2023-12-29 02:12:34 +00:00
王晓 215a10d9d6 !8618 Fix ut of npu_deformable_conv2d.
Merge pull request !8618 from 王晓/dcn_ut_2.1
2023-12-29 01:13:56 +00:00
l00800044 6cdbb18751 update torchair commitid v2.1.0 2023-12-28 20:11:19 +08:00
huangyunlong da978a060b !8696 Revert add lazy_init for load.
Merge pull request !8696 from huangyunlong/2.1ll
2023-12-28 11:58:53 +00:00
huangyunlong 6a65e09c70 !8522 [Fix]split distributed ut to avoid timeout.
Merge pull request !8522 from huangyunlong/2.1dis
2023-12-28 11:08:46 +00:00
陈睿敏 54b430a01b !8458 [BUGFIX] Fix bugs for GuessFormatWhenContiguous when input tensor is a FakeTensor without desc.
Merge pull request !8458 from 陈睿敏/v2.1.0
2023-12-28 09:40:47 +00:00
张伟康 7f4ebd9d46 !8577 [UT] add and adapt official source testcases for dynamo module
Merge pull request !8577 from 张伟康/v2.1.0-dev
2023-12-28 03:28:30 +00:00
pta-robot 7c3fa93a8d !8706 Update op_plugin commit id
Merge pull request !8706 from pta-robot/v2.1.0
2023-12-27 13:44:56 +00:00
pta-robot 569365591e !8706 Update op_plugin commit id
Merge pull request !8706 from pta-robot/v2.1.0
2023-12-27 13:44:54 +00:00
pta-robot 33328d54a7 !8702 Update op_plugin commit id
Merge pull request !8702 from pta-robot/v2.1.0
2023-12-27 10:57:27 +00:00
杜金航 046872bb10 !8608 [refactor] introduce the abstract class NPUAllocator.
Merge pull request !8608 from 杜金航/v2.1.0_pluggable
2023-12-27 10:05:12 +00:00
周先琪 d71ba0ea1b !8679 Bug Fix For Step Trace Time
Merge pull request !8679 from 周先琪/v2.1.0
2023-12-27 10:03:28 +00:00
闫鹏全 c6f6d6f41e !8631 Revert the PR 8073 and PR 8208
Merge pull request !8631 from 闫鹏全/revert
2023-12-27 10:00:58 +00:00
pta-robot 419ef7b9cb !8690 Update op_plugin commit id
Merge pull request !8690 from pta-robot/v2.1.0
2023-12-27 08:40:20 +00:00
feihujiang 95fd519423 !8530 Performance optimization: using view tensor for contiguous operations
Merge pull request !8530 from feihujiang/usingViewTensorForContiguousOperations-V2.1.0
2023-12-27 08:12:46 +00:00
pta-robot a05f03ba28 !8671 Update op_plugin commit id
Merge pull request !8671 from pta-robot/v2.1.0
2023-12-27 04:51:58 +00:00
关龙锋 f96ea38d40 !8624 npu allocator name
Merge pull request !8624 from 关龙锋/alloactor_21
2023-12-27 02:57:22 +00:00
louyujing 3d99081675 !8625 【transfer_to_npu】Adapt the map_location parameter of torch load
Merge pull request !8625 from louyujing/v2.1.0
2023-12-27 01:35:26 +00:00
张星星 c636c337fb !8542 add default value for MaskedSoftmaxWithRelPosBias
Merge pull request !8542 from 张星星/1222
2023-12-27 01:11:17 +00:00
裘凯达 de389f100c !8565 Bugfix for syscnt or monotonic in Ascend PyTorch Profiler.
Merge pull request !8565 from 裘凯达/pta210_syscnt
2023-12-27 01:08:09 +00:00
王强 451c50393d !8657 update torchair commit id
Merge pull request !8657 from 王强/v2.1.0
2023-12-26 16:45:49 +00:00
pta-robot 148076eb51 !8652 Update op_plugin commit id
Merge pull request !8652 from pta-robot/v2.1.0
2023-12-26 15:45:35 +00:00
pta-robot 13b067e6a0 !8648 Update op_plugin commit id
Merge pull request !8648 from pta-robot/v2.1.0
2023-12-26 13:44:14 +00:00
pta-robot 2c4ef1c800 !8648 Update op_plugin commit id
Merge pull request !8648 from pta-robot/v2.1.0
2023-12-26 13:44:12 +00:00
yuhaiyan 688d3d768c !8582 Skip the failed test case.
Merge pull request !8582 from yuhaiyan/v2.1.0-dev3
2023-12-26 11:23:16 +00:00
鲁博洋 18f88c482a !8616 update torchair commitid v2.1.0
Merge pull request !8616 from 鲁博洋/v2.1.0
2023-12-26 08:05:56 +00:00
王广斌 537b047937 !8401 Add operators related ut for npu
Merge pull request !8401 from 王广斌/mv_reduction
2023-12-26 06:51:06 +00:00
xudaohong 576a854a8f !8596 [fix] eraseStream bug in multi compute stream case
Merge pull request !8596 from xudaohong/cherry-pick-1703492224
2023-12-26 05:58:49 +00:00
xudaohong 2b2358c98e !8412 [feat] event reconfiguration 2
Merge pull request !8412 from xudaohong/event2
2023-12-26 05:57:29 +00:00
wuhy 0e69438291 !8557 Exclude slow test files when using run_test
Merge pull request !8557 from wuhy/no-pattern-match-210
2023-12-26 02:10:54 +00:00
王姜奔 57c3da3a59 !8614 fix torch.Tensor.type's bug in dynamo
Merge pull request !8614 from 王姜奔/v2.1.0_dynamo_type
2023-12-26 01:59:25 +00:00
闫鹏全 81cd228d17 !8611 Revert "!8460Move p2p enable from empty op to copy op."
Merge pull request !8611 from 闫鹏全/v2.1.0
2023-12-25 15:03:12 +00:00
yuhaiyan 966e733ab2 !8511 The test files for 'autograd' support NPU
Merge pull request !8511 from yuhaiyan/v2.1.0-dev2
2023-12-25 11:45:57 +00:00
pta-robot 64c27f2777 !8603 Update op_plugin commit id
Merge pull request !8603 from pta-robot/v2.1.0
2023-12-25 10:46:39 +00:00
pta-robot 8bb8f5606d !8603 Update op_plugin commit id
Merge pull request !8603 from pta-robot/v2.1.0
2023-12-25 10:46:37 +00:00
pta-robot efd6e76a1c !8593 Update op_plugin commit id
Merge pull request !8593 from pta-robot/v2.1.0
2023-12-25 08:45:24 +00:00
王姜奔 2a9fe8566f !8584 fix Tensor.type() bug whet dtype in ['torch.npu.FloatTensor', torch.npu.FloatTensor, ...]
Merge pull request !8584 from 王姜奔/v2.1.0-type
2023-12-25 08:04:08 +00:00
Li-Jian 328188b454 !8569 【PTA】meta_registration add mm_reduce_scatter & all_gather_mm
Merge pull request !8569 from Li-Jian/v2.1.0
2023-12-25 07:52:16 +00:00
文俊 9124040857 !8513 Fix the failed UT.
Merge pull request !8513 from 文俊/v2.1.0
2023-12-25 06:23:06 +00:00
shaoyf dff5928227 !8466 Update readme info
Merge pull request !8466 from shaoyf/doc/210_t800
2023-12-25 06:19:11 +00:00
王夏夏 ccd302487c !8487 Add official testcases for test_npu.py and test_npu_multinpu.py.
Merge pull request !8487 from 王夏夏/v2.1.0
2023-12-25 02:18:04 +00:00
王夏夏 9f6f697ad1 !8505 remove skip for test_amp.py.
Merge pull request !8505 from 王夏夏/v2.1.0
2023-12-25 02:17:38 +00:00
阮晨杰 133938030c !8568 【WeightQuantBatchMamtulV2】 infershape
Merge pull request !8568 from 阮晨杰/v2.1.0
2023-12-24 09:40:45 +00:00
pta-robot bb764080fb !8571 Update op_plugin commit id
Merge pull request !8571 from pta-robot/v2.1.0
2023-12-24 04:45:58 +00:00
pta-robot 36aedcc773 !8571 Update op_plugin commit id
Merge pull request !8571 from pta-robot/v2.1.0
2023-12-24 04:45:56 +00:00
鲁博洋 34ee1bfdee !8553 revert torchair commitid v2.1.0
Merge pull request !8553 from 鲁博洋/v2.1.0
2023-12-22 10:13:20 +00:00
weili10 8b9a5a3ece !8429 [DFX] add error code
Merge pull request !8429 from weili10/v2.1.0
2023-12-22 09:31:17 +00:00
闫鹏全 8ac47fd80b !8460 Move p2p enable from empty op to copy op.
Merge pull request !8460 from 闫鹏全/v2.1.0
2023-12-22 09:17:43 +00:00
pta-robot 95bfae88ec !8544 Update op_plugin commit id
Merge pull request !8544 from pta-robot/v2.1.0
2023-12-22 08:56:20 +00:00
chuboning 5108b17c87 !8534 Generate debug files and strip
Merge pull request !8534 from chuboning/v2.1.0-strip
2023-12-22 08:50:21 +00:00
鲁博洋 feb31b571b !8520 update torchair commitid v2.1.0
Merge pull request !8520 from 鲁博洋/v2.1.0
2023-12-21 13:31:04 +00:00
chuboning 3c72bedfe8 !8452 Fix "context is empty" error when start a new thread
Merge pull request !8452 from chuboning/v2.1.0
2023-12-21 09:24:04 +00:00
pta-robot 4233ccb15e !8508 Update op_plugin commit id
Merge pull request !8508 from pta-robot/v2.1.0
2023-12-21 09:00:18 +00:00
王强 d48d1efe4a !8496 Add a matching interface get_storage_sizes for get_npu_format
Merge pull request !8496 from 王强/v2.1.0
2023-12-21 08:31:23 +00:00
张伟康 4238ec41b1 !8233 [UT] add and adapt official source testcases for dynamo module
Merge pull request !8233 from 张伟康/v2.1.0-dev
2023-12-21 06:53:23 +00:00
yuhaiyan 48dd963343 !8438 Add official source code for test_autograd.py
Merge pull request !8438 from yuhaiyan/v2.1.0-dev1
2023-12-21 03:08:13 +00:00
pta-robot 7b8d9c440d !8499 Update op_plugin commit id
Merge pull request !8499 from pta-robot/v2.1.0
2023-12-21 02:41:35 +00:00
王姜奔 e50b4db005 !8495 fix new bugs with UserDefinedClassVariable and SkipFilesVariable
Merge pull request !8495 from 王姜奔/v2.1.0
2023-12-20 13:51:33 +00:00
pta-robot 73ad26955b !8493 Update op_plugin commit id
Merge pull request !8493 from pta-robot/v2.1.0
2023-12-20 10:49:29 +00:00
huangyunlong 941f71345a !8443 [Feature]Add warning for acl_op_select_impl_mode and acl_optypelist_for_implmod.
Merge pull request !8443 from huangyunlong/2.1option
2023-12-20 10:21:05 +00:00
sunjiayang 60ecda7d88 !8431 error to warning
Merge pull request !8431 from sunjiayang/dfx_210
2023-12-20 09:28:06 +00:00
pta-robot 7c57bbf5fd !8481 Update op_plugin commit id
Merge pull request !8481 from pta-robot/v2.1.0
2023-12-20 09:03:24 +00:00
王夏夏 e16e85a7b1 !8413 nn module test cases support npu.
Merge pull request !8413 from 王夏夏/v2.1.0
2023-12-20 06:32:01 +00:00
pta-robot c112438e5f !8475 Update op_plugin commit id
Merge pull request !8475 from pta-robot/v2.1.0
2023-12-20 05:01:08 +00:00
pta-robot a8d5e43b82 !8464 Update op_plugin commit id
Merge pull request !8464 from pta-robot/v2.1.0
2023-12-20 02:44:35 +00:00
pta-robot b19930be20 !8453 Update op_plugin commit id
Merge pull request !8453 from pta-robot/v2.1.0
2023-12-19 10:52:22 +00:00
pta-robot 26a6717f56 !8453 Update op_plugin commit id
Merge pull request !8453 from pta-robot/v2.1.0
2023-12-19 10:52:20 +00:00
徐柯南 6f0e61ad6a !8415 ffn infershape bug fix
Merge pull request !8415 from 徐柯南/ffn_debug_v2
2023-12-19 07:15:49 +00:00
jiangpengfei 5f2fa90c88 !8155 Inputs verification of scatter and new test cases.
Merge pull request !8155 from jiangpengfei/scatter_2.1
2023-12-19 02:45:53 +00:00
zhaolei156 7b0707561d !8146 Fix ut v2.1.0
Merge pull request !8146 from zhaolei156/fix_ut_v2.1.0
2023-12-19 02:34:37 +00:00
王姜奔 58441f4d9e !8359 fix torch_npu.npu.amp.autocast/torch.device/torch_npu.stream bug in dynamo
Merge pull request !8359 from 王姜奔/dynamo_npu_auto_cast
2023-12-19 02:06:28 +00:00
pta-robot 7f9a9c33ae !8424 Update op_plugin commit id
Merge pull request !8424 from pta-robot/v2.1.0
2023-12-18 13:11:25 +00:00
wuhy 9d1609823b !8317 Enable slow test cases handling
Merge pull request !8317 from wuhy/slow_cases_210
2023-12-18 11:10:42 +00:00
i-robot 484aabbf74 !8344 Delete the public URL in code
Merge pull request !8344 from yuhaiyan/v2.1.0-dev2
2023-12-18 09:30:37 +00:00
yuhaiyan b4f263207a !8343 Delete the public URL in code
Merge pull request !8343 from yuhaiyan/v2.1.0-dev1
2023-12-18 09:29:55 +00:00
文俊 a1db8b2069 !8142 Fix the failed UT.
Merge pull request !8142 from 文俊/v2.1.0
2023-12-18 09:28:17 +00:00
pta-robot bd3897824f !8402 Update op_plugin commit id
Merge pull request !8402 from pta-robot/v2.1.0
2023-12-15 11:05:34 +00:00
xudaohong b41881863e !8380 [feat] to support d2h non_blocking
Merge pull request !8380 from xudaohong/v2.1.0
2023-12-15 10:16:13 +00:00
王广斌 f990022740 !8334 Add test_matmul_cuda ut for npu
Merge pull request !8334 from 王广斌/mv_matmul_cuda
2023-12-15 09:40:49 +00:00
姜怡文 7196dd1e54 !8152 Modify torch_npu apis
Merge pull request !8152 from 姜怡文/v2.1.0_apis
2023-12-15 08:00:13 +00:00
yuhaiyan 27759c4bee Merge branch 'v2.1.0' of gitee.com:ascend/pytorch into v2.1.0-dev2
Signed-off-by: yuhaiyan <yuhaiyan8@huawei.com>
2023-12-15 06:18:08 +00:00
yuhaiyan 8a3acaf465 !8333 Delete the public URL in code
Merge pull request !8333 from yuhaiyan/v2.1.0-dev6

fixed

url fixed

fixed

fixed
2023-12-15 14:15:51 +08:00
huangyunlong d5ca7a810a !8173 [Fix]fix distributed ut.
Merge pull request !8173 from huangyunlong/2.1ut
2023-12-15 06:11:41 +00:00
pta-robot 7f043e0a95 !8395 Update op_plugin commit id
Merge pull request !8395 from pta-robot/v2.1.0
2023-12-15 04:47:11 +00:00
pta-robot 95ee94924e !8389 Update op_plugin commit id
Merge pull request !8389 from pta-robot/v2.1.0
2023-12-15 02:45:50 +00:00
王夏夏 a2f331362e !8274 nn module supports npu device.
Merge pull request !8274 from 王夏夏/v2.1.0
2023-12-15 01:33:53 +00:00
chuboning 4924a8d953 !8362 Add install_requires for torch version
Merge pull request !8362 from chuboning/v2.1.0
2023-12-14 12:48:35 +00:00
戢芳 75d239879d !8352 Fix bug in testcase.
Merge pull request !8352 from 戢芳/ut2.1
2023-12-14 12:48:16 +00:00
sunjiayang 7b22ca3a65 !8382 support BFloat16Storage
Merge pull request !8382 from sunjiayang/bfloat16_210
2023-12-14 12:20:55 +00:00
鲁博洋 5b0eb0277f !8387 update torchair commitid v2.1.0
Merge pull request !8387 from 鲁博洋/v2.1.0
2023-12-14 12:02:14 +00:00
邵非凡 2d37d16779 !8336 npu_change_data_ptr() supports bfloat16
Merge pull request !8336 from 邵非凡/bf16_21
2023-12-14 11:47:47 +00:00
feihujiang ffd1008775 !8118 Performance optimization: using cached contiguous opt
Merge pull request !8118 from feihujiang/usingCachedContiguousOpt-v2.1.0
2023-12-14 09:25:48 +00:00
dongwenbo6 5571f271ab !8370 [FIX] fix error [context is empty]
Merge pull request !8370 from dongwenbo6/v2.1.0
2023-12-14 09:23:32 +00:00
yuhaiyan 4b13db0591 !8375 Skip the failed test case
Merge pull request !8375 from yuhaiyan/v2.1.0-dev3
2023-12-14 07:35:53 +00:00
王广斌 365a9ca1db !8256 Add test_tensor_creation_ops ut
Merge pull request !8256 from 王广斌/mv_tensor
2023-12-14 06:12:59 +00:00
zhangshufan 5e2b6c1dcf !8248 performance optimization: Log switch using ASCEND_GLOBAL_LOG_LEVEL
Merge pull request !8248 from zhangshufan/v2.1.0-f05
2023-12-14 03:34:38 +00:00
zhangshufan 1e07339c83 !8247 performance optimization: CheckJitDisable cache
Merge pull request !8247 from zhangshufan/v2.1.0-f02
2023-12-14 03:34:18 +00:00
周先琪 4471e772d4 !8322 Bug Fix For Step Id
Merge pull request !8322 from 周先琪/v2.1.0
2023-12-14 01:56:43 +00:00
yangxiaorun 0d49c0b7bf !8339 update submodule torchair
Merge pull request !8339 from yangxiaorun/v2.1.0
2023-12-14 01:28:42 +00:00
MooYeh 8146a3c015 !8285 [fixbug] Remove temporary profiling data after calling export_chrome_trace & export_stacks.
Merge pull request !8285 from MooYeh/v2.1.0
2023-12-14 01:18:47 +00:00
毛晨 a37b47fb7b !8325 【bugfix】Catch and process errors occurred during the profiling parsing phase.
Merge pull request !8325 from 毛晨/v2.1.0_1212
2023-12-13 09:44:30 +00:00
zqh 2add033040 !8311 FFN算子原型修改适配 torchair commit id
Merge pull request !8311 from zqh/v2.1.0
2023-12-13 07:31:46 +00:00
pta-robot 875dd48d07 !8298 Update op_plugin commit id
Merge pull request !8298 from pta-robot/v2.1.0
2023-12-13 02:39:14 +00:00
huangyunlong 230aff99e0 !8341 [fix]add finalize_npu for libtorch_npu.
Merge pull request !8341 from huangyunlong/2.1lib
2023-12-13 01:58:12 +00:00
yuhaiyan 6aa06843fe !8333 Delete the public URL in code
Merge pull request !8333 from yuhaiyan/v2.1.0-dev6
2023-12-12 13:03:11 +00:00
sunjiayang 44880fbdd9 !8293 [DFx]throw Inner Error when aclnn error
Merge pull request !8293 from sunjiayang/err_210
2023-12-12 11:29:04 +00:00
闫鹏全 69115ab01d !8208 Device connectivity initialization is performed before the tensor is created
Merge pull request !8208 from 闫鹏全/v2.1.0_copy
2023-12-12 07:49:06 +00:00
王广斌 fbf6b0a33d !8098 Add test_type_promotion ut
Merge pull request !8098 from 王广斌/mv_type_promotion
2023-12-12 07:32:45 +00:00
王广斌 512aac82a9 !8093 Add test_view_ops ut
Merge pull request !8093 from 王广斌/mv_view_ops
2023-12-12 07:32:38 +00:00
chuboning 241ea0c353 !8278 Fix memory leak in NPUStream through unique_ptr
Merge pull request !8278 from chuboning/v2.1.0
2023-12-12 07:30:03 +00:00
yuhaiyan 7a78a72f27 !8312 Delete the public URL in code
Merge pull request !8312 from yuhaiyan/v2.1.0-dev5
2023-12-12 07:06:05 +00:00
jiangpengfei f82a64769a !8095 [BUGFIX] HCCL_BLOCKING_WAIT fails on master and 2.1
Merge pull request !8095 from jiangpengfei/blockingwait_2.1.0
2023-12-12 07:05:44 +00:00
huangyunlong 99ffa2a6bc !8225 Revert "[Feature]delete acl_op_select_impl_mode and acl_optypelist_for_implmode".
Merge pull request !8225 from huangyunlong/2.1aclr
2023-12-12 03:44:08 +00:00
i-robot f552e66c43 !8158 Test files support NPU
Merge pull request !8158 from yuhaiyan/v2.1.0-dev1
2023-12-12 02:22:10 +00:00
yuhaiyan a537711ac8 !8187 A test case is fixed
Merge pull request !8187 from yuhaiyan/v2.1.0-dev2
2023-12-12 02:20:27 +00:00
huangyunlong 68146bfff0 !7939 [fix]add lazy_init for load.
Merge pull request !7939 from huangyunlong/2.1load
2023-12-11 02:48:29 +00:00
王夏夏 d7df295582 !7942 test_nn.py supports npu.
Merge pull request !7942 from 王夏夏/v2.1.0
2023-12-11 01:21:13 +00:00
周先琪 8e81f0878a !8205 Bug Fix For Memory Match
Merge pull request !8205 from 周先琪/v2.1.0
2023-12-11 01:08:30 +00:00
pta-robot 9ba3be1db7 !8266 Update op_plugin commit id
Merge pull request !8266 from pta-robot/v2.1.0
2023-12-10 10:47:26 +00:00
邵非凡 017b337990 !8223 delete redundant code in ddp
Merge pull request !8223 from 邵非凡/red_reducer
2023-12-09 01:58:03 +00:00
pta-robot 61b23f2dda !8242 Update op_plugin commit id
Merge pull request !8242 from pta-robot/v2.1.0
2023-12-08 13:56:38 +00:00
pta-robot 5fb936ef50 !8242 Update op_plugin commit id
Merge pull request !8242 from pta-robot/v2.1.0
2023-12-08 13:56:36 +00:00
shaoyf 366621842f !8240 Remove optim patch.
Merge pull request !8240 from shaoyf/remove_foreach_21
2023-12-08 13:14:55 +00:00
chuboning 507b9018ef !8230 Set pointer to null after delete in NPUCachingAllocator.cpp
Merge pull request !8230 from chuboning/v2.1.0
2023-12-08 11:06:56 +00:00
王嘉诚 b6c38d836e !8144 【PTA】support mm_all_reduce add meta and onnx
Merge pull request !8144 from 王嘉诚/v2.1.0
2023-12-08 10:09:05 +00:00
dongwenbo6 67dfb6e5db !7579 [Feature]support new socversion Ascend310B4
Merge pull request !7579 from dongwenbo6/v2.1.0
2023-12-08 09:22:33 +00:00
pta-robot a22611b750 !8218 Update op_plugin commit id
Merge pull request !8218 from pta-robot/v2.1.0
2023-12-08 08:38:43 +00:00
毛晨 917a6c53b0 !8201 【bugfix】Change data type of reserved memory from int to float.
Merge pull request !8201 from 毛晨/v2.1.0_1208
2023-12-08 06:34:09 +00:00
pta-robot 72ab896781 !8211 Update op_plugin commit id
Merge pull request !8211 from pta-robot/v2.1.0
2023-12-08 05:07:08 +00:00
yuhaiyan a0ed9e7f25 Merge branch 'v2.1.0' of gitee.com:ascend/pytorch into v2.1.0-dev1
Signed-off-by: yuhaiyan <yuhaiyan8@huawei.com>
2023-12-08 02:27:27 +00:00
王夏夏 092d7e9bd7 !8116 add official source testcases for nn module.
Merge pull request !8116 from 王夏夏/v2.1.0
2023-12-08 01:51:27 +00:00
王夏夏 3c756a467e !8054 [UT] Official source testcases for nn module supports npu.
Merge pull request !8054 from 王夏夏/v2.1.0
2023-12-08 01:43:53 +00:00
关龙锋 82e047fbd5 !7703 update acl_json path by torch_npu whl
Merge pull request !7703 from 关龙锋/acl_json_gil_21
2023-12-08 01:30:46 +00:00
chuboning fe2ee67751 !8195 Add synchronize when init _MultiProcessingDataLoaderIter
Merge pull request !8195 from chuboning/v2.1.0
2023-12-07 14:08:53 +00:00
pta-robot b31e39fce7 !8192 Update op_plugin commit id
Merge pull request !8192 from pta-robot/v2.1.0
2023-12-07 13:59:43 +00:00
王广斌 99a7215b14 !8052 Add test_shape_ops ut
Merge pull request !8052 from 王广斌/mv_shape_ops
2023-12-07 11:40:51 +00:00
鲁博洋 6759b4a75f !8170 update torchair commitid v2.1.0
Merge pull request !8170 from 鲁博洋/v2.1.0
2023-12-07 11:03:05 +00:00
董鸿儒 2a1dd35187 !7970 add groupnormsilu for meta and onnx
Merge pull request !7970 from 董鸿儒/cherry-pick-1701419629
2023-12-07 11:01:23 +00:00
MooYeh 3d8226055c !8107 [fixbug] Change the save path of metadata
Merge pull request !8107 from MooYeh/v2.1.0
2023-12-07 10:52:46 +00:00
pta-robot 564b58f15b !8178 Update op_plugin commit id
Merge pull request !8178 from pta-robot/v2.1.0
2023-12-07 10:43:12 +00:00
pta-robot c8e827a920 !8178 Update op_plugin commit id
Merge pull request !8178 from pta-robot/v2.1.0
2023-12-07 10:43:10 +00:00
yuhaiyan 493e10ce9b support npu 2023-12-07 16:30:40 +08:00
pta-robot b73d07a788 !8137 Update op_plugin commit id
Merge pull request !8137 from pta-robot/v2.1.0
2023-12-07 03:24:35 +00:00
pta-robot 33a6b48d22 !8130 Update op_plugin commit id
Merge pull request !8130 from pta-robot/v2.1.0
2023-12-06 16:19:22 +00:00
pta-robot d3c19ad905 !8124 Update op_plugin commit id
Merge pull request !8124 from pta-robot/v2.1.0
2023-12-06 13:47:36 +00:00
pta-robot 420aca385f !8124 Update op_plugin commit id
Merge pull request !8124 from pta-robot/v2.1.0
2023-12-06 13:47:35 +00:00
pta-robot e2a5a6c4f0 !8120 Update op_plugin commit id
Merge pull request !8120 from pta-robot/v2.1.0
2023-12-06 11:15:41 +00:00
huangyunlong 30daf51088 !8083 [Feature]delete acl_op_select_impl_mode and acl_optypelist_for_implmode.
Merge pull request !8083 from huangyunlong/2.1acl
2023-12-05 14:10:08 +00:00
pta-robot dd5b6c0cde !8099 Update op_plugin commit id
Merge pull request !8099 from pta-robot/v2.1.0
2023-12-05 13:49:13 +00:00
提军伟 912ab3982f !8090 ifa add new params
Merge pull request !8090 from 提军伟/v2.1.0
2023-12-05 12:50:17 +00:00
闫鹏全 a1336cb23f !8073 Support 'to' operator to copied tensor to any npu device in a single process
Merge pull request !8073 from 闫鹏全/v2.1.0_copy
2023-12-05 12:06:15 +00:00
裘凯达 0aaaeb0c2d !8028 Bugfix for calling aclprofDestroyConfig.
Merge pull request !8028 from 裘凯达/pta210
2023-12-05 11:05:02 +00:00
pta-robot 008d86d6c5 !8089 Update op_plugin commit id
Merge pull request !8089 from pta-robot/v2.1.0
2023-12-05 10:47:13 +00:00
姜怡文 16cc3b1b89 !8075 Expose class OpCommand
Merge pull request !8075 from 姜怡文/v2.1.0_apis
2023-12-05 09:01:02 +00:00
xudaohong 09e9c7ade9 !8012 [feat] MULTI_STREAM_MEMORY_REUSE is enabled by default
Merge pull request !8012 from xudaohong/cherry-pick-1701653844
2023-12-05 08:55:33 +00:00
文俊 13461ae3b8 !7744 Fix the failed UT.
Merge pull request !7744 from 文俊/v2.1.0
2023-12-05 08:50:42 +00:00
王广斌 babf944680 !7968 Add test_sort_and_select ut
Merge pull request !7968 from 王广斌/mv_sort
2023-12-05 08:50:04 +00:00
pta-robot a38db16c9d !8079 Update op_plugin commit id
Merge pull request !8079 from pta-robot/v2.1.0
2023-12-05 08:46:09 +00:00
wuhy 44013f7a30 !8035 Handle UT subprocesses recursively when timeout
Merge pull request !8035 from wuhy/pkill_in_timeout-210
2023-12-05 08:39:26 +00:00
yuhaiyan 49fb5004b6 !8024 Fake train data and val data
Merge pull request !8024 from yuhaiyan/v2.1.0-dev1
2023-12-05 08:34:09 +00:00
zhaolei156 56b04b5e26 !8019 Fix 2.1 ut
Merge pull request !8019 from zhaolei156/fix_2.1_ut
2023-12-05 08:32:38 +00:00
杨彬榕 6a6e00bf55 !7211 fpa support actual_seq_kv and sparse v2.1.0
Merge pull request !7211 from 杨彬榕/v2.1.0
2023-12-05 07:32:45 +00:00
pta-robot 05e98fb7f2 !8065 Update op_plugin commit id
Merge pull request !8065 from pta-robot/v2.1.0
2023-12-05 04:58:44 +00:00
pta-robot 06092b6302 !8055 Update op_plugin commit id
Merge pull request !8055 from pta-robot/v2.1.0
2023-12-05 02:42:15 +00:00
王姜奔 964c128330 update OWNERS.
Signed-off-by: 王姜奔 <wangjiangben@huawei.com>
2023-12-05 01:34:07 +00:00
秦杨 2c71bf4863 !8045 update torchair commit id
Merge pull request !8045 from 秦杨/v2.1.0
2023-12-04 13:50:21 +00:00
提军伟 39f3c61540 !8047 update torchair commit id
Merge pull request !8047 from 提军伟/v2.1.0
2023-12-04 13:36:08 +00:00
郭光浩 27fe8b41ba !8022 [revert ]'Pull Request !7855 : Support 'to' operator to copied tensor to any npu device in a single process'
Merge pull request !8022 from 郭光浩/revert-merge-7811-v2.1.0
2023-12-04 11:19:57 +00:00
张超凡 e9a6d2bc87 !8009 RMSNorm meta函数修复 v2.1
Merge pull request !8009 from 张超凡/rms_norm_meta_r21_1202
2023-12-04 01:54:49 +00:00
jiangpengfei 95da33d54b !8010 Hcclscatter interface changed
Merge pull request !8010 from jiangpengfei/v2.1.0_scatter
2023-12-02 12:16:15 +00:00
pta-robot a32fea0b81 !8008 Update op_plugin commit id
Merge pull request !8008 from pta-robot/v2.1.0
2023-12-02 10:42:57 +00:00
pta-robot 1575660e2b !8008 Update op_plugin commit id
Merge pull request !8008 from pta-robot/v2.1.0
2023-12-02 10:42:55 +00:00
jiangpengfei 16a31bf646 !7978 Support Scatter
Merge pull request !7978 from jiangpengfei/v2.1.0_scatter
2023-12-02 10:32:28 +00:00
liuyi 57fc87c4f9 !7985 fix UT for torch.LSTM,torch.LSTMCell
Merge pull request !7985 from liuyi/test_v2.1.0
2023-12-02 09:47:52 +00:00
闫鹏全 f090dff049 !7811 Support 'to' operator to copied tensor to any npu device in a single process
Merge pull request !7811 from 闫鹏全/v2.1.0_copy
2023-12-02 09:24:11 +00:00
sunjiayang 0bd7df3760 !7969 Add C10_NPU_SHOW_ERR_MSG()
Merge pull request !7969 from sunjiayang/blocking_error_210
2023-12-02 09:05:30 +00:00
pta-robot 4ea697adfc !7996 Update op_plugin commit id
Merge pull request !7996 from pta-robot/v2.1.0
2023-12-02 08:41:34 +00:00
张伟康 1492465b8d !7825 [UT] add and adapt official source testcases for test_fake_tensor
Merge pull request !7825 from 张伟康/v2.1.0-dev
2023-12-02 02:25:04 +00:00
yuhaiyan 509c97f27a !7902 Add official source code for UT
Merge pull request !7902 from yuhaiyan/v2.1.0-dev2
2023-12-02 01:56:55 +00:00
pta-robot 50d0ce71f6 !7981 Update op_plugin commit id
Merge pull request !7981 from pta-robot/v2.1.0
2023-12-01 13:47:50 +00:00
pta-robot f7bb7c9d47 !7975 Update op_plugin commit id
Merge pull request !7975 from pta-robot/v2.1.0
2023-12-01 10:46:19 +00:00
TD_lihan 80a6fc448d !7831 add scatterlist for aclnn
Merge pull request !7831 from TD_lihan/s21
2023-12-01 07:54:28 +00:00
MooYeh 01e8abcd07 !7959 Modify duplicate code in Ascend PyTorch Profiler
Merge pull request !7959 from MooYeh/v2.1.0
2023-12-01 07:46:54 +00:00
秦杨 296292a091 !7958 add ffn infershape
Merge pull request !7958 from 秦杨/v2.1.0
2023-12-01 06:18:08 +00:00
pta-robot aebb459083 !7965 Update op_plugin commit id
Merge pull request !7965 from pta-robot/v2.1.0
2023-12-01 04:43:12 +00:00
周先琪 ee721736ba !7953 Improve FWK Analyse
Merge pull request !7953 from 周先琪/v2.1.0
2023-12-01 01:31:03 +00:00
杜金航 fb6b1aa509 !7858 Compatible with virtual memory related interfaces.
Merge pull request !7858 from 杜金航/v2.1.0
2023-11-30 12:37:55 +00:00
yuhaiyan 3d0edda80a !7606 Add UT files
Merge pull request !7606 from yuhaiyan/v2.1.0-dev1
2023-11-30 12:36:46 +00:00
提军伟 5225de81d0 !7938 update torchair commit id
Merge pull request !7938 from 提军伟/v2.1.0
2023-11-30 02:46:28 +00:00
王广斌 986dd35687 !7796 Add test indexing ut
Merge pull request !7796 from 王广斌/mv_indexing
2023-11-30 02:00:11 +00:00
邵非凡 24d2a90e7a !7892 add ut for torch.futures
Merge pull request !7892 from 邵非凡/futures_21
2023-11-30 01:09:33 +00:00
鲁博洋 cf6ddf1e7e !7936 update torchair commitid v2.1.0
Merge pull request !7936 from 鲁博洋/v2.1.0
2023-11-29 13:51:54 +00:00
pta-robot 396d18e76d !7933 Update op_plugin commit id
Merge pull request !7933 from pta-robot/v2.1.0
2023-11-29 13:40:34 +00:00
pta-robot f201901350 !7926 Update op_plugin commit id
Merge pull request !7926 from pta-robot/v2.1.0
2023-11-29 10:39:02 +00:00
pta-robot 9cbdd241a4 !7926 Update op_plugin commit id
Merge pull request !7926 from pta-robot/v2.1.0
2023-11-29 10:38:59 +00:00
LuQingyun e47bc01fef !7556 Modifying the test cases to dynamically adapt to the number of environment card
Merge pull request !7556 from LuQingyun/v2.1.0
2023-11-29 09:28:18 +00:00
pta-robot fe0b8b41c0 !7913 Update op_plugin commit id
Merge pull request !7913 from pta-robot/v2.1.0
2023-11-29 08:53:03 +00:00
裘凯达 0ab40a01cd !7708 Performance Optimization for Ascend PyTorch Profiler v2.
Merge pull request !7708 from 裘凯达/pta210_opt_v2
2023-11-29 08:32:51 +00:00
pta-robot 0a46bff7d6 !7909 Update op_plugin commit id
Merge pull request !7909 from pta-robot/v2.1.0
2023-11-29 04:35:27 +00:00
pta-robot ebb985bb54 !7909 Update op_plugin commit id
Merge pull request !7909 from pta-robot/v2.1.0
2023-11-29 04:35:25 +00:00
关龙锋 b40eb241b2 !7819 update set device
Merge pull request !7819 from 关龙锋/device_set_21
2023-11-29 03:28:19 +00:00
郭光浩 80da7fe278 !7794 【feature】add api torch_npu.npu.mem_get_info
Merge pull request !7794 from 郭光浩/v2.1.0
2023-11-29 03:15:13 +00:00
pta-robot 3e4073b161 !7900 Update op_plugin commit id
Merge pull request !7900 from pta-robot/v2.1.0
2023-11-29 02:48:52 +00:00
毛晨 68c1fdc214 !7869 【Bugfix】Solve the problem that the profiling is stuck in specific scenarios.
Merge pull request !7869 from 毛晨/v2.1.0_1128
2023-11-29 01:50:02 +00:00
liujie379908 83c65fdc28 !7857 Add RPC UT use case
Merge pull request !7857 from liujie379908/v2.1.0
2023-11-29 01:17:32 +00:00
pta-robot 6e9fb0e2f4 !7890 Update op_plugin commit id
Merge pull request !7890 from pta-robot/v2.1.0
2023-11-28 16:13:22 +00:00
pta-robot 3c7f5e02d5 !7890 Update op_plugin commit id
Merge pull request !7890 from pta-robot/v2.1.0
2023-11-28 16:13:21 +00:00
pta-robot adbc36add4 !7884 Update op_plugin commit id
Merge pull request !7884 from pta-robot/v2.1.0
2023-11-28 14:12:28 +00:00
sunjiayang 640c42c12e !7768 [DFx]Broken pipe error
Merge pull request !7768 from sunjiayang/runtime_210
2023-11-28 13:33:53 +00:00
sunjiayang 0ce7391039 !7879 fix test_save_async bug
Merge pull request !7879 from sunjiayang/test_save_async_210
2023-11-28 12:58:43 +00:00
pta-robot 7ccf571866 !7878 Update op_plugin commit id
Merge pull request !7878 from pta-robot/v2.1.0
2023-11-28 10:40:00 +00:00
xudaohong 9dc04638c0 !7763 [fix] fix subthread destroy event fail bug
Merge pull request !7763 from xudaohong/cherry-pick-1700875414
2023-11-28 06:21:29 +00:00
pta-robot 67d8716ea9 !7836 Update op_plugin commit id
Merge pull request !7836 from pta-robot/v2.1.0
2023-11-28 02:50:58 +00:00
pta-robot e2920a18f0 !7827 Update op_plugin commit id
Merge pull request !7827 from pta-robot/v2.1.0
2023-11-27 14:14:55 +00:00
李业丰 1db35d4d0a !7486 RmsNorm support onnx
Merge pull request !7486 from 李业丰/br_20231116_rmsnorm_2.1
2023-11-27 11:45:25 +00:00
pta-robot 7369f4932f !7813 Update op_plugin commit id
Merge pull request !7813 from pta-robot/v2.1.0
2023-11-27 10:43:03 +00:00
pta-robot c5aa51f1b6 !7813 Update op_plugin commit id
Merge pull request !7813 from pta-robot/v2.1.0
2023-11-27 10:43:01 +00:00
MooYeh 2c2f0bc099 !7677 [bugfix] fix the bug of schedule.
Merge pull request !7677 from MooYeh/v2.1.0
2023-11-27 06:48:39 +00:00
张伟康 696f6605a5 !7754 [UT] add official source testcase for test_out_dtype_op
Merge pull request !7754 from 张伟康/1122npu
2023-11-27 05:21:30 +00:00
pta-robot dc8c34c9b9 !7804 Update op_plugin commit id
Merge pull request !7804 from pta-robot/v2.1.0
2023-11-27 04:39:21 +00:00
王姜奔 0d143a1f19 update OWNERS.
Signed-off-by: 王姜奔 <wangjiangben@huawei.com>
2023-11-27 03:06:40 +00:00
张星星 f5afa9fc86 !7792 add MaskedSoftmaxWithRelPosBias onnx and meta
Merge pull request !7792 from 张星星/v2.1.0
2023-11-26 07:44:32 +00:00
pta-robot ed9fe6d1d0 !7790 Update op_plugin commit id
Merge pull request !7790 from pta-robot/v2.1.0
2023-11-25 10:50:21 +00:00
Leon 315f762dd6 !7704 [bugfix] fix asyncronize error between HCCL stream and computation stream
Merge pull request !7704 from Leon/210_stream
2023-11-25 10:50:13 +00:00
闫鹏全 ef91ca7ca1 !7558 add allgather test for different tensor shape
Merge pull request !7558 from 闫鹏全/v2.1.0
2023-11-25 10:09:45 +00:00
will-devil 8e0483399a !7746 [UT] np.bool to np.bool_.
Merge pull request !7746 from will-devil/21bool
2023-11-25 09:38:53 +00:00
yuhaiyan 3b0fec7d01 !7701 Add configuration files for skipped tests and UT file
Merge pull request !7701 from yuhaiyan/v2.1.0
2023-11-25 09:25:41 +00:00
pta-robot 01ba35ee2c !7773 Update op_plugin commit id
Merge pull request !7773 from pta-robot/v2.1.0
2023-11-25 04:46:52 +00:00
鲁博洋 f98c16e766 !7753 update torchair commitid v2.1.0
Merge pull request !7753 from 鲁博洋/v2.1.0
2023-11-25 03:34:01 +00:00
王姜奔 f42a51c910 !7725 fix grammar errors in raise
Merge pull request !7725 from 王姜奔/v2.1.0
2023-11-25 02:27:27 +00:00
shaoyf 07ef220605 !7689 Cleancode for torch_npu/utils
Merge pull request !7689 from shaoyf/cleancode/210_1123
2023-11-25 01:54:34 +00:00
王夏夏 37ca370a2e !7634 [testcase] add official source testcases for nn module.
Merge pull request !7634 from 王夏夏/v2.1.0
2023-11-25 01:39:41 +00:00
pta-robot 9bc636d767 !7759 Update op_plugin commit id
Merge pull request !7759 from pta-robot/v2.1.0
2023-11-24 16:15:39 +00:00
pta-robot fc6831f532 !7758 Update op_plugin commit id
Merge pull request !7758 from pta-robot/v2.1.0
2023-11-24 13:28:41 +00:00
pta-robot 812a264c45 !7758 Update op_plugin commit id
Merge pull request !7758 from pta-robot/v2.1.0
2023-11-24 13:28:39 +00:00
liujie379908 b45d546bd0 !7686 Add watchdog UT use case
Merge pull request !7686 from liujie379908/v2.1.0
2023-11-24 10:14:00 +00:00
chuboning 25e5dc6b2b !7739 Standardize the op_name
Merge pull request !7739 from chuboning/v2.1.0
2023-11-24 09:53:38 +00:00
邵非凡 c8f84d7c53 !7720 bugfix, modify aclnn route logic
Merge pull request !7720 from 邵非凡/base_format21
2023-11-24 09:47:10 +00:00
jiangpengfei 203985dbed !7718 Record startevents in collective when desyncdebug is on.
Merge pull request !7718 from jiangpengfei/v2.1.0
2023-11-24 07:38:32 +00:00
pta-robot f7609162ba !7733 Update op_plugin commit id
Merge pull request !7733 from pta-robot/v2.1.0
2023-11-24 05:09:38 +00:00
裘凯达 a5b9c007e9 !7679 Bugfix for Ascend PyTorch Profiler
Merge pull request !7679 from 裘凯达/pta210
2023-11-23 13:55:31 +00:00
pta-robot 65a6536b71 !7698 Update op_plugin commit id
Merge pull request !7698 from pta-robot/v2.1.0
2023-11-23 13:45:08 +00:00
i-robot 92e9fd4e52 !7573 【Feature】 Add file npu_module_mem.csv
Merge pull request !7573 from 毛晨/v2.1.0_1117
2023-11-23 12:28:18 +00:00
MooYeh d527b74952 !7670 Unify timestamp format in csv files.
Merge pull request !7670 from MooYeh/v2.1.0
2023-11-23 11:37:43 +00:00
yuhaiyan e609b2ddf0 !7655 Add file: .pytorch-disabled-tests.json
Merge pull request !7655 from yuhaiyan/v2.1.0-dev2
2023-11-23 11:20:20 +00:00
shaoyf 72ee30195f !7500 Avoid too many warnings and clean code
Merge pull request !7500 from shaoyf/fix_api/210
2023-11-23 11:19:03 +00:00
xudaohong f95af30ca8 !7596 [fix] change soc version that supports inf_nan mode
Merge pull request !7596 from xudaohong/v2.1.0
2023-11-23 09:22:29 +00:00
zhaolei156 abd8871d42 !7632 Fix ut
Merge pull request !7632 from zhaolei156/fix_ut_2.1
2023-11-23 08:43:23 +00:00
万俊伟 63812a3193 !7653 Update torchair commitid v2.1.0
Merge pull request !7653 from 万俊伟/commit_id
2023-11-23 08:33:50 +00:00
文俊 7ff2340870 !7597 Skip failed UT.
Merge pull request !7597 from 文俊/v2.1.0
2023-11-23 06:48:49 +00:00
毛晨 fae9f96bc2 Merge branch 'v2.1.0' of gitee.com:ascend/pytorch into v2.1.0_1117
Signed-off-by: 毛晨 <maochen7@huawei.com>
2023-11-23 06:15:45 +00:00
pta-robot 8559511aa5 !7660 Update op_plugin commit id
Merge pull request !7660 from pta-robot/v2.1.0
2023-11-23 05:10:54 +00:00
pta-robot 47c6ac56b5 !7650 Update op_plugin commit id
Merge pull request !7650 from pta-robot/v2.1.0
2023-11-23 01:30:23 +00:00
pta-robot 6be96fb6be !7650 Update op_plugin commit id
Merge pull request !7650 from pta-robot/v2.1.0
2023-11-23 01:30:19 +00:00
liujie379908 9dc9a78d98 !7563 Implement the workCleanupLoop interface in Watchdog
Merge pull request !7563 from liujie379908/v2.1.0
2023-11-23 01:24:37 +00:00
i-robot 9f75920404 !7626 Performance Optimization for Ascend PyTorch Profiler.
Merge pull request !7626 from 裘凯达/pta210_opt
2023-11-22 13:51:55 +00:00
MooYeh c494718ca1 !7643 [bugfix] fix the bug introduced while solving conflicts
Merge pull request !7643 from MooYeh/v2.1.0
2023-11-22 13:46:52 +00:00
谢鹏 90e25633d3 !7612 Improve Profiler Analyse Performance Part 2
Merge pull request !7612 from 谢鹏/v2.1.0
2023-11-22 10:21:30 +00:00
郭光浩 e7203c28f5 !7609 【bugfix】fix the way of adding synchronize when init ddp
Merge pull request !7609 from 郭光浩/v2.1.0
2023-11-22 09:38:15 +00:00
鲁博洋 e09ef1c244 !7614 update torchair commitid v2.1.0
Merge pull request !7614 from 鲁博洋/v2.1.0
2023-11-22 06:04:26 +00:00
裘凯达 7793616d77 Performance Optimization for Ascend PyTorch Profiler. 2023-11-22 09:37:50 +08:00
毛晨 24cc5139bc !7560 【Feature】Support collecting shapes in dynamic graph scenario.
Merge pull request !7560 from 毛晨/graph_v2.1.0
2023-11-21 12:35:24 +00:00
louyujing 1ec9290775 !7529 Support torch.compile transfer to npu
Merge pull request !7529 from louyujing/v2.1.0
2023-11-21 12:14:46 +00:00
maochen bda5459147 【Feature】 Add file npu_module_mem.csv 2023-11-21 19:17:11 +08:00
MooYeh 20c0ac3820 !7491 Switch timestamp computation to high precision
Merge pull request !7491 from MooYeh/v2.1.0
2023-11-21 08:48:24 +00:00
王广斌 902014834a !7524 Skip failed test case
Merge pull request !7524 from 王广斌/2.1_copy
2023-11-21 08:14:45 +00:00
姜怡文 4cb233d44c !7571 Fix bugs
Merge pull request !7571 from 姜怡文/v2.1.0_TORCH_API
2023-11-21 07:54:21 +00:00
zhaolei156 c2aa987393 !7264 Fix ut
Merge pull request !7264 from zhaolei156/fix_ut
2023-11-21 06:50:29 +00:00
chuboning 164c9ea108 !7439 Filter out test_ops.py in full ut
Merge pull request !7439 from chuboning/v2.1.0
2023-11-21 06:45:36 +00:00
zhaolei156 060efbf077 !7551 Fix kl_div ut
Merge pull request !7551 from zhaolei156/fix_2.1_ut
2023-11-21 06:44:42 +00:00
pta-robot 669947cb3d !7567 Update op_plugin commit id
Merge pull request !7567 from pta-robot/v2.1.0
2023-11-20 14:23:17 +00:00
pta-robot bb8c9c0733 !7567 Update op_plugin commit id
Merge pull request !7567 from pta-robot/v2.1.0
2023-11-20 14:23:15 +00:00
MooYeh 04313e522c !7343 Enable the start and stop interfaces to use the shedule mechanism
Merge pull request !7343 from MooYeh/v2.1.0
2023-11-20 12:08:42 +00:00
sunjiayang 120c252078 !7293 save_async bug fix
Merge pull request !7293 from sunjiayang/asave_210
2023-11-20 07:11:42 +00:00
鲁博洋 fb093c286a !7546 update torchair commitid v2.1.0
Merge pull request !7546 from 鲁博洋/v2.1.0
2023-11-20 01:09:01 +00:00
jiangpengfei d2cce041e3 !7280 Add new functions of watchdog
Merge pull request !7280 from jiangpengfei/watchdog_2.1
2023-11-18 07:57:50 +00:00
周先琪 0f22a5becd !7520 Improve Profiler Analyse Performance Part 1
Merge pull request !7520 from 周先琪/v2.1.0
2023-11-18 01:49:29 +00:00
pta-robot f74f7f1436 !7535 Update op_plugin commit id
Merge pull request !7535 from pta-robot/v2.1.0
2023-11-17 10:44:54 +00:00
louyujing 5d24b77951 !7511 Handling conflicts between tranfer_to_npu and dynamo
Merge pull request !7511 from louyujing/v2.1.0
2023-11-17 07:25:07 +00:00
MooYeh 318b6556bf !7509 【fix bug】root node has no event property
Merge pull request !7509 from MooYeh/v2.1.0
2023-11-17 07:23:51 +00:00
sunjiayang ef43be9ffc !7323 torch.version.cann
Merge pull request !7323 from sunjiayang/get_cann_version_210
2023-11-17 03:01:26 +00:00
毛晨 9e55e434a4 !7395 【Feature】Add concurrent task manager for profiling
Merge pull request !7395 from 毛晨/v2.1.0
2023-11-17 02:47:11 +00:00
关龙锋 57f8e00858 !7459 hostapi to set deterministic
Merge pull request !7459 from 关龙锋/cherry-pick-1700042897
2023-11-16 03:35:29 +00:00
戢芳 969837aa79 !7442 Skip the failed testcases about div.
Merge pull request !7442 from 戢芳/div_2.1
2023-11-16 03:13:01 +00:00
MooYeh f6f29f7d5a !7424 Ensure Chinese writing is displayed properly in json
Merge pull request !7424 from MooYeh/v2.1.0
2023-11-16 01:41:57 +00:00
周先琪 7118b311b9 !7400 Multiprocess Remove Or Maker Dir Error Fix
Merge pull request !7400 from 周先琪/v2.1.0
2023-11-16 01:40:06 +00:00
pta-robot 090f102c17 !7468 Update op_plugin commit id
Merge pull request !7468 from pta-robot/v2.1.0
2023-11-15 16:09:11 +00:00
pta-robot 7708e85456 !7468 Update op_plugin commit id
Merge pull request !7468 from pta-robot/v2.1.0
2023-11-15 16:09:10 +00:00
杜承昆 32d4924427 !7465 update torchair submodule
Merge pull request !7465 from 杜承昆/update_2.1
2023-11-15 13:10:21 +00:00
pta-robot edca878c85 !7457 Update op_plugin commit id
Merge pull request !7457 from pta-robot/v2.1.0
2023-11-15 11:21:30 +00:00
xudaohong 2932e2d45e !7433 [fix] skip eraseStream when use npu_change_data_ptr create tensor
Merge pull request !7433 from xudaohong/cherry-pick-1700029316
2023-11-15 09:39:43 +00:00
文俊 c604224452 !7419 Fix the failed UT.
Merge pull request !7419 from 文俊/v2.1.0
2023-11-15 09:22:23 +00:00
pta-robot 0243f3b0d6 !7429 Update op_plugin commit id
Merge pull request !7429 from pta-robot/v2.1.0
2023-11-15 04:32:09 +00:00
王广斌 a8e24bae62 !7391 Add filt exposed api feature
Merge pull request !7391 from 王广斌/2.1_copy
2023-11-15 01:59:19 +00:00
pta-robot a9b54a92b0 !7414 Update op_plugin commit id
Merge pull request !7414 from pta-robot/v2.1.0
2023-11-14 16:55:33 +00:00
闫鹏全 fdef9fe9e3 !7388 Support allgather to deal with different tensor shape in tensor_list.
Merge pull request !7388 from 闫鹏全/allgather_python
2023-11-14 14:16:54 +00:00
何侃 41ab817213 !7377 ut for lazyConv1d_empty with cann api
Merge pull request !7377 from 何侃/cherry-pick-1699929254
2023-11-14 14:16:18 +00:00
MooYeh 4763c797bc !7382 Memory reocrd match logic bug fix.
Merge pull request !7382 from MooYeh/v2.1.0
2023-11-14 11:36:04 +00:00
pta-robot 199467d160 !7404 Update op_plugin commit id
Merge pull request !7404 from pta-robot/v2.1.0
2023-11-14 10:52:28 +00:00
yangxiaorun e53b2870a8 !7390 update submodel torchair
Merge pull request !7390 from yangxiaorun/v2.1.0
2023-11-14 09:01:30 +00:00
humingxue ff571cf779 !7296 Skip dtensor testcase if multi devices not satisfied
Merge pull request !7296 from humingxue/v2.1.0
2023-11-14 06:24:43 +00:00
胡晓波 0273280d34 !7354 【需求】Profiling数据解析存盘数据量优化
Merge pull request !7354 from 胡晓波/v2.1.0
2023-11-14 02:15:51 +00:00
pta-robot 68e753dccd !7370 Update op_plugin commit id
Merge pull request !7370 from pta-robot/v2.1.0
2023-11-14 01:43:44 +00:00
鲁博洋 5d9dacea7f !7356 update torchair commitid v2.1.0
Merge pull request !7356 from 鲁博洋/v2.1.0
2023-11-13 13:05:42 +00:00
Leon aa5e748ae4 !7330 [bugfix] fix grad shape error when gradient_as_view_in is turned on.
Merge pull request !7330 from Leon/21
2023-11-13 12:25:29 +00:00
pta-robot b69188f755 !7359 Update op_plugin commit id
Merge pull request !7359 from pta-robot/v2.1.0
2023-11-13 10:41:53 +00:00
yuhaiyan 1c8ceb32a5 !7281 Skip the failed test cases
Merge pull request !7281 from yuhaiyan/v2.1.0-dev4
2023-11-13 09:04:21 +00:00
yuhaiyan ccc73856aa !7259 Skip the failed test cases
Merge pull request !7259 from yuhaiyan/v2.1.0-dev1
2023-11-13 09:04:07 +00:00
yuhaiyan 3753097216 !7258 Bugfix: tuple object has no attribute 'get'
Merge pull request !7258 from yuhaiyan/v2.1.0-dev3
2023-11-13 09:04:03 +00:00
will-devil 41399fe197 !7313 [Feature] Autocast suppports bf16.
Merge pull request !7313 from will-devil/21autocast
2023-11-13 04:50:22 +00:00
yuhaiyan 2abee8a4da !7164 Use np.bool_ instead of np.bool
Merge pull request !7164 from yuhaiyan/v2.1.0-dev2
2023-11-13 03:45:00 +00:00
chuboning f9a4667137 !7214 Add arguments for full ut
Merge pull request !7214 from chuboning/v2.1.0
2023-11-13 03:39:17 +00:00
pta-robot 123cfcf754 !7309 Update op_plugin commit id
Merge pull request !7309 from pta-robot/v2.1.0
2023-11-11 02:02:01 +00:00
pta-robot ed0a3df696 !7301 Update op_plugin commit id
Merge pull request !7301 from pta-robot/v2.1.0
2023-11-10 11:43:44 +00:00
jiangpengfei 79ec373a49 !7285 ProcessGroupHCCL.hpp Cleancode modification.
Merge pull request !7285 from jiangpengfei/v2.1.0
2023-11-10 09:28:37 +00:00
shaoyf 81c631a077 !7278 Use the yaml in op-plugin for testing
Merge pull request !7278 from shaoyf/del_op_info/210
2023-11-10 08:04:25 +00:00
MooYeh 07cda5e072 !7256 Remove duiplicate profiler_metadata.json file when add_metadata is not called.
Merge pull request !7256 from MooYeh/v2.1.0
2023-11-10 07:41:46 +00:00
DaiFu e8a8cd1284 !7248 [2.1.0]GroupNorm ut fix
Merge pull request !7248 from DaiFu/v2.1.0
2023-11-10 07:24:08 +00:00
jiangpengfei 0b85fc90aa !7168 Add new functions and parameters to support watchdog
Merge pull request !7168 from jiangpengfei/watchdog_2.1_2
2023-11-10 06:03:11 +00:00
pta-robot 601c4c0c67 !7273 Update op_plugin commit id
Merge pull request !7273 from pta-robot/v2.1.0
2023-11-10 05:25:37 +00:00
郭光浩 dd72de5322 !7239 [bugfix] delete redundant code
Merge pull request !7239 from 郭光浩/v2.1.0
2023-11-09 13:14:05 +00:00
will-devil 10d5080d4f !7095 [Feature] Add is_bf16_supported interface.
Merge pull request !7095 from will-devil/21bf16
2023-11-09 13:13:37 +00:00
杜金航 7cc6a55b9f !7091 [fix] fix problems introduced by cleancode.
Merge pull request !7091 from 杜金航/v2.1_cleancode
2023-11-09 13:11:25 +00:00
shaoyf 9add23946c !7236 Add unsupported info for addmm
Merge pull request !7236 from shaoyf/fix_ut_addmm_210
2023-11-09 11:31:50 +00:00
杜金航 7a59cb55fb !7229 [feat] Expandable blocks in allocator.
Merge pull request !7229 from 杜金航/v2.1.0
2023-11-09 11:16:00 +00:00
pta-robot e2179b4de6 !7223 Update op_plugin commit id
Merge pull request !7223 from pta-robot/v2.1.0
2023-11-09 09:28:04 +00:00
pta-robot 58563fb488 !7192 Update op_plugin commit id
Merge pull request !7192 from pta-robot/v2.1.0
2023-11-09 01:09:49 +00:00
sunjiayang d985c6c143 !7196 save_async
Merge pull request !7196 from sunjiayang/async_save_210
2023-11-08 14:26:14 +00:00
王姜奔 bab17cdb3b !7201 回退 'Pull Request !7151 : [feat] Expandable blocks in allocator.'
* 回退 'Pull Request !7151 : [feat] Expandable blocks in allocator.'
2023-11-08 13:46:56 +00:00
王守策 aa95a56ad1 !7183 add sequenceid flow
Merge pull request !7183 from 王守策/v2.1.0
2023-11-08 12:13:19 +00:00
yangxiaorun d0728e9731 !7184 update torchair submodel
Merge pull request !7184 from yangxiaorun/v2.1.0
2023-11-08 11:03:17 +00:00
文俊 cb637546f2 !6935 Fix the failed UT.
Merge pull request !6935 from 文俊/v2.1.0
2023-11-08 09:41:22 +00:00
杜金航 2e1b83d209 !7151 [feat] Expandable blocks in allocator.
Merge pull request !7151 from 杜金航/v2.1.0
2023-11-08 09:34:27 +00:00
郭光浩 1f0e7d3a4b !7173 [bugfix] Supplemented with init parameters
Merge pull request !7173 from 郭光浩/v2.1.0
2023-11-08 08:17:27 +00:00
裘凯达 a94640f229 !7109 Fix multi-repeat in Ascend PyTorch Profiler.
Merge pull request !7109 from 裘凯达/pta210_repeat
2023-11-08 06:37:52 +00:00
王广斌 42f7c6a22a !7161 Fix failed ut test case
Merge pull request !7161 from 王广斌/2.1_copy
2023-11-08 06:15:47 +00:00
chuboning 2e1ed4903c !7133 Update readme info
Merge pull request !7133 from chuboning/v2.1.0
2023-11-08 06:11:18 +00:00
郭光浩 3b4d6d24a2 !7144 [bugfix] add synchronize when init ddp
Merge pull request !7144 from 郭光浩/v2.1.0
2023-11-07 15:13:59 +00:00
pta-robot ce93862e7a !7143 Update op_plugin commit id
Merge pull request !7143 from pta-robot/v2.1.0
2023-11-07 14:28:50 +00:00
唐浩 30682a7b03 !7139 fix: PFA/IFA, fix existing failed ut
Merge pull request !7139 from 唐浩/v2.1.0
2023-11-07 13:36:47 +00:00
王诚昊 fd31b952ca !7124 enable the compiling process of RPC
Merge pull request !7124 from 王诚昊/v2.1.0
2023-11-07 13:01:37 +00:00
邵非凡 5187744647 !7002 add future_work in reducer and ProcessGroupHCCL
Merge pull request !7002 from 邵非凡/future_work21
2023-11-07 12:29:35 +00:00
邵非凡 add5afa9c4 !6978 transfer uint8 to int32 for allreduce and reduce in ProcessGroupHCCL.cpp
Merge pull request !6978 from 邵非凡/wrap_hccl
2023-11-07 11:26:57 +00:00
yuhaiyan 12c789d31e rename test_contrib/test_custom_ops/test_network_ops/test_trans_contiguous 2023-11-07 07:24:26 +00:00
yuhaiyan 3df86c29fd !7086 rename test_npu and update access_control_test.py
Merge pull request !7086 from yuhaiyan/v2.1.0-dev
2023-11-07 06:57:54 +00:00
lishuai183 05573b8730 !6924 Fix ut v2.1.0 failed.
Merge pull request !6924 from lishuai183/ut_v2.1.0_v1
2023-11-07 06:35:17 +00:00
pta-robot acb524e5e7 !7122 Update op_plugin commit id
Merge pull request !7122 from pta-robot/v2.1.0
2023-11-07 06:10:35 +00:00
jiangpengfei 09feb8b32d !7079 Add watchdog thread fuction
Merge pull request !7079 from jiangpengfei/watchdog_2.1
2023-11-06 13:47:19 +00:00
pta-robot a91fde9cf2 !7102 Update op_plugin commit id
Merge pull request !7102 from pta-robot/v2.1.0
2023-11-06 11:44:44 +00:00
zhangqian 215190e701 !7050 Change ST for RPC: remove calculation operation,change torch.add to echo
Merge pull request !7050 from zhangqian/test_single
2023-11-06 08:40:13 +00:00
MooYeh 0f4e6db3f9 !7016 Add _KinetoProfiler, add_metadata and export_stacks interfaces for PyTorch Profiler
Merge pull request !7016 from MooYeh/v2.1.0
2023-11-06 08:37:00 +00:00
jiangpengfei 31038e2c6d !7055 Skip dtensor testcase if multi devices not satisfied
Merge pull request !7055 from jiangpengfei/v2.1.0
2023-11-06 07:59:57 +00:00
邵非凡 5e151d2e35 !7082 add npu_lazy_init for maybe_initialize_npu
Merge pull request !7082 from 邵非凡/lazy_init21
2023-11-06 07:32:47 +00:00
鲁博洋 69e53f3655 !7049 update torchair commitid
Merge pull request !7049 from 鲁博洋/v2.1.0
2023-11-06 01:32:52 +00:00
pta-robot 61e1a4812a !7073 Update op_plugin commit id
Merge pull request !7073 from pta-robot/v2.1.0
2023-11-04 14:40:21 +00:00
shaoyf be875b7f3a !7075 Cleancode modification
Merge pull request !7075 from shaoyf/sc/210_cleancode_fix_ut
2023-11-04 13:51:43 +00:00
桓永犇 733c2958e3 !7006 FA/FAG add meta
Merge pull request !7006 from 桓永犇/add_meta
2023-11-04 10:07:50 +00:00
jiangpengfei 0e2f8154ff !6985 Support both hccl and gloo backend in dtensor test cases.
Merge pull request !6985 from jiangpengfei/v2.1.0
2023-11-04 08:21:31 +00:00
yuhaiyan b18256a4b7 !7011 Rename test_moudule/test_tensors.py
Merge pull request !7011 from yuhaiyan/pt2.1-dev
2023-11-04 01:33:22 +00:00
yuhaiyan 424b990382 !6998 Move files in test_utils to test_npu
Merge pull request !6998 from yuhaiyan/pt2.1-dev5
2023-11-04 01:32:50 +00:00
yuhaiyan 7515b2dd5c !6995 Move files in test_torch to test_npu
Merge pull request !6995 from yuhaiyan/pt2.1-dev4
2023-11-04 01:32:45 +00:00
chuboning 5113864267 !7032 Execute core ut when modify_files doesn't exist
Merge pull request !7032 from chuboning/v2.1.0
2023-11-04 01:31:46 +00:00
pta-robot 5f8cfd118c !7054 Update op_plugin commit id
Merge pull request !7054 from pta-robot/v2.1.0
2023-11-03 13:14:50 +00:00
王广斌 33aaa7fedf !7038 Filt expose api in torch_npu all
Merge pull request !7038 from 王广斌/2.1_copy
2023-11-03 10:05:35 +00:00
关龙锋 2ef2910b5e !7023 update hccl inc
Merge pull request !7023 from 关龙锋/hccl_inc_2.1
2023-11-03 08:14:44 +00:00
pta-robot b0a9597fb6 !7028 Update op_plugin commit id
Merge pull request !7028 from pta-robot/v2.1.0
2023-11-03 07:11:38 +00:00
chuboning a995aa77fa !6987 Update access_control_test
Merge pull request !6987 from chuboning/v2.1.0
2023-11-02 12:44:06 +00:00
shaoyf d9eb084d69 !6999 Fixed security issues, log includes sensitive information.
Merge pull request !6999 from shaoyf/sc/210_rpc_log
2023-11-02 11:49:58 +00:00
yuhaiyan 9c6ccb52ef !6983 Rename test files: test_optim/test_profiler/test_autograd.py/test_utils.py
Merge pull request !6983 from yuhaiyan/pt2.1-dev3
2023-11-02 11:39:00 +00:00
王广斌 efb56553fe !6988 Add build directory permission
Merge pull request !6988 from 王广斌/clean_code2.1
2023-11-02 11:37:45 +00:00
shaoyf f6e9509935 !6971 Add __all__ for torch_npu
Merge pull request !6971 from shaoyf/sc/210_init
2023-11-02 11:10:11 +00:00
shaoyf 10432d8abf !6975 Remove unused environment variables
Merge pull request !6975 from shaoyf/sc/210_env
2023-11-02 11:06:44 +00:00
shaoyf bdf094a262 !6959 Add links to some documents
Merge pull request !6959 from shaoyf/doc/210_readme
2023-11-02 11:05:53 +00:00
xudaohong c3d7f62341 !6934 [feat] allgather multi stream memory reuse tmp tensor
Merge pull request !6934 from xudaohong/cherry-pick-1698749305
2023-11-02 09:17:47 +00:00
yuhaiyan 492813cffc !6954 Rename test files: test_nn and test_nn_func
Merge pull request !6954 from yuhaiyan/pt2.1-dev2
2023-11-02 09:02:28 +00:00
yuhaiyan 8cb7f9d7a1 !6952 Rename test files: test_distributed/test_fsdp/test_rpc
Merge pull request !6952 from yuhaiyan/pt2.1-dev1
2023-11-02 09:02:23 +00:00
yuhaiyan c5a4f287b1 !6945 Rename test files: test_cpp_extension/test_jit/test_onnx/test_fx
Merge pull request !6945 from yuhaiyan/pt2.1-dev
2023-11-02 09:02:22 +00:00
pta-robot 25f053daa5 !6991 Update op_plugin commit id
Merge pull request !6991 from pta-robot/v2.1.0
2023-11-02 04:29:50 +00:00
jiangpengfei 5c06ac8896 !6951 Add new environment for watchdog in 2.1
Merge pull request !6951 from jiangpengfei/watchdog_2.1
2023-11-02 03:54:10 +00:00
pta-robot 0fc4668dea !6965 Update op_plugin commit id
Merge pull request !6965 from pta-robot/v2.1.0
2023-11-01 11:22:33 +00:00
huangyunlong e71e6ceccf !6956 [Feature]support new socversion.
Merge pull request !6956 from huangyunlong/2.1b2c
2023-11-01 10:34:21 +00:00
戢芳 99454afd66 !6823 Fix the failed UT.
Merge pull request !6823 from 戢芳/ut_2.1
2023-11-01 10:28:42 +00:00
yuhaiyan 9e50d78a25 !6942 0D Tensor cannot be indexed
Merge pull request !6942 from yuhaiyan/v2.1.0
2023-11-01 09:54:10 +00:00
刘嘉巍 9ede286cbe !6931 Support scalar.item() with bfloat16 data type.
Merge pull request !6931 from 刘嘉巍/master-opt
2023-11-01 09:47:19 +00:00
pta-robot ee951916f4 !6946 Update op_plugin commit id
Merge pull request !6946 from pta-robot/v2.1.0
2023-11-01 06:17:47 +00:00
王强 e5b541446e !6943 update torchair commit id
Merge pull request !6943 from 王强/v2.1.0
2023-11-01 03:11:54 +00:00
王广斌 37a8997355 !6940 Add filt expose api feature
Merge pull request !6940 from 王广斌/filt_python2.1
2023-10-31 14:16:09 +00:00
pta-robot 033e0a01a4 !6941 Update op_plugin commit id
Merge pull request !6941 from pta-robot/v2.1.0
2023-10-31 13:31:48 +00:00
1227 changed files with 205015 additions and 26226 deletions
+2
View File
@@ -2,12 +2,14 @@
path = third_party/op-plugin
url = https://gitee.com/ascend/op-plugin.git
ignore = dirty
branch = 6.0.rc1
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://gitee.com/mirrors/googletest.git
[submodule "third_party/torchair/torchair"]
path = third_party/torchair/torchair
url = https://gitee.com/ascend/torchair.git
branch = 6.0.rc1
[submodule "third_party/Tensorpipe"]
path = third_party/Tensorpipe
url = https://gitee.com/ascend/Tensorpipe.git
+8 -4
View File
@@ -133,9 +133,9 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_CXX_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie ${CMAKE_CXX_FLAGS}")
set(CXXFLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie ${CXXFLAGS}")
else()
set(CMAKE_C_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-s,-z,noexecstack -fPIE -pie ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-s,-z,noexecstack -fPIE -pie ${CMAKE_CXX_FLAGS}")
set(CXXFLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-s,-z,noexecstack -fPIE -pie ${CXXFLAGS}")
set(CMAKE_C_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie ${CMAKE_CXX_FLAGS}")
set(CXXFLAGS "-fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack -fPIE -pie ${CXXFLAGS}")
endif()
if (NOT DEFINED BUILD_LIBTORCH)
@@ -162,6 +162,7 @@ include_directories(${PROJECT_SOURCE_DIR}/torch_npu/csrc/aten)
include_directories(${PROJECT_SOURCE_DIR}/third_party/hccl/inc)
include_directories(${PROJECT_SOURCE_DIR}/third_party/acl/inc)
include_directories(${PROJECT_SOURCE_DIR}/third_party/Tensorpipe)
include_directories(${PROJECT_SOURCE_DIR}/third_party/profiler)
# Set installed PyTorch dir
if(DEFINED PYTORCH_INSTALL_DIR)
@@ -189,6 +190,7 @@ if (NOT DEFINED BUILD_LIBTORCH)
set(NPU_SRCS)
set(PROF_SRCS)
set(UTILS_SRCS)
set(SAN_SRCS)
endif()
if (DEFINED BUILD_LIBTORCH)
@@ -204,6 +206,7 @@ if (NOT DEFINED BUILD_LIBTORCH)
add_subdirectory(${TORCHNPU_ROOT}/npu)
add_subdirectory(${TORCHNPU_ROOT}/profiler)
add_subdirectory(${TORCHNPU_ROOT}/utils)
add_subdirectory(${TORCHNPU_ROOT}/sanitizer)
endif()
if (DEFINED BUILD_LIBTORCH)
@@ -211,6 +214,7 @@ if (DEFINED BUILD_LIBTORCH)
endif()
set(OPS_PLUGIN_SRCS)
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/profiler)
# Add subdirectory of op-plugin
include_directories(${PROJECT_SOURCE_DIR}/third_party/op-plugin)
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/op-plugin/op_plugin)
@@ -226,7 +230,7 @@ if (DEFINED BUILD_LIBTORCH)
set(CPP_SRCS ${ATEN_SRCS} ${CORE_SRCS} ${OPS_PLUGIN_SRCS} ${FRAMEWORK_SRCS} ${NPU_CPP_LIBS_SRCS})
else()
# Compile code with pybind11
set(CPP_SRCS ${ATEN_SRCS} ${CORE_SRCS} ${OPS_PLUGIN_SRCS} ${DIST_SRCS} ${FRAMEWORK_SRCS} ${NPU_SRCS} ${PROF_SRCS} ${UTILS_SRCS})
set(CPP_SRCS ${ATEN_SRCS} ${CORE_SRCS} ${OPS_PLUGIN_SRCS} ${DIST_SRCS} ${FRAMEWORK_SRCS} ${NPU_SRCS} ${PROF_SRCS} ${UTILS_SRCS} ${SAN_SRCS})
endif()
add_library(${PLUGIN_NAME} SHARED ${CPP_SRCS})
+66 -18
View File
@@ -1,30 +1,78 @@
BSD 3-Clause License
From PyTorch:
Copyright (c) 2020, Huawei Technologies Co., Ltd
Copyright (c) 2019, Facebook CORPORATION.
Copyright (c) 2016- Facebook, Inc (Adam Paszke)
Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
Copyright (c) 2011-2013 NYU (Clement Farabet)
Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
Copyright (c) 2006 Idiap Research Institute (Samy Bengio)
Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
From Caffe2:
Copyright (c) 2016-present, Facebook Inc. All rights reserved.
All contributions by Facebook:
Copyright (c) 2016 Facebook Inc.
All contributions by Google:
Copyright (c) 2015 Google Inc.
All rights reserved.
All contributions by Yangqing Jia:
Copyright (c) 2015 Yangqing Jia
All rights reserved.
All contributions by Kakao Brain:
Copyright 2019-2020 Kakao Brain
All contributions by Cruise LLC:
Copyright (c) 2022 Cruise LLC.
All rights reserved.
All contributions from Caffe:
Copyright(c) 2013, 2014, 2015, the respective contributors
All rights reserved.
All other contributions:
Copyright(c) 2015, 2016 the respective contributors
All rights reserved.
Caffe2 uses a copyright model similar to Caffe: each contributor holds
copyright over their contributions to Caffe2. The project versioning records
all such contribution and copyright details. If a contributor wants to further
mark their specific copyright on a particular contribution, they should
indicate their copyright solely in the commit message of the change when it is
committed.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
3. Neither the names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America
and IDIAP Research Institute nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+3 -3
View File
@@ -2,14 +2,13 @@ approvers:
- weili10
- li_jing_hw
- clinglai
- guang-jun-zhang2
- xuepenginnanjing
- yskhhh
- brightlyking
- wangjiangben_hw
- zhangzhongzt
- wangchao285
- atlasaccount
- chenhao_1209
- dilililiwhy
reviewers:
- xiaxia3
- ascendzyj
@@ -58,3 +57,4 @@ reviewers:
- li-xulong
- wang-guangbin
- chuboning
- chen-vvjob
+62 -268
View File
@@ -1,8 +1,8 @@
# PyTorch Ascend Adapter
# Ascend Extension for PyTorch
## Overview
This repository develops the **PyTorch Ascend Adapter** named **torch_npu** to adapt **Ascend NPU** to **PyTorch** so that developers who use the **PyTorch** can obtain powerful compute capabilities of **Ascend AI Processors**.
This repository develops the **PyTorch Extension** named **torch_npu** to adapt **Ascend NPU** to **PyTorch** so that developers who use the **PyTorch** can obtain powerful compute capabilities of **Ascend AI Processors**.
Ascend is a full-stack AI computing infrastructure for industry applications and services based on Huawei Ascend processors and software. For more information about Ascend, see [Ascend Community](https://www.hiascend.com/en/).
@@ -51,17 +51,17 @@ If the installation fails, use the download link or visit the [PyTorch official
3. **Install torch-npu**
```
pip3 install torch-npu==2.1.0rc1
pip3 install torch-npu==2.1.0.post3
```
### From Source
In some special scenarios, users may need to compile **torch-npu** by themselves.Select a branch in table [Ascend Auxiliary Software](#ascend-auxiliary-software) and a Python version in table [PyTorch and Python Version Matching Table](#pytorch-and-python-version-matching-table) first. The docker image is recommended for compiling torch-npu through the following steps:
In some special scenarios, users may need to compile **torch-npu** by themselves.Select a branch in table [Ascend Auxiliary Software](#ascend-auxiliary-software) and a Python version in table [PyTorch and Python Version Matching Table](#pytorch-and-python-version-matching-table) first. The docker image is recommended for compiling torch-npu through the following steps(It is recommended to mount the working path only and avoid the system path to reduce security risks), the generated .whl file path is ./dist/:
1. **Clone torch-npu**
```
git clone https://github.com/ascend/pytorch.git -b v2.1.0-5.0.rc3 --depth 1
git clone https://github.com/ascend/pytorch.git -b v2.1.0-6.0.rc1 --depth 1
```
2. **Build Docker Image**
@@ -115,264 +115,51 @@ print(z)
## User Manual
Refer to [API of PyTorch Ascend Adapter](docs/api/torch_npu_apis.md) for more detailed informations.
Refer to [API of Ascend Extension for Pytorch](docs/api/torch_npu_apis.md) for more detailed informations.
## PyTorch and Python Version Matching Table
| PyTorch Version | Python Version |
| ------------- | :----------------------------------------------------------- |
| PyTorch1.11.0 | Python3.7.x(>=3.7.5),Python3.8.x,Python3.9.x,Python3.10.x |
| PyTorch2.0.1 | Python3.8.x,Python3.9.x,Python3.10.x |
| PyTorch2.1.0 | Python3.8.x,Python3.9.x,Python3.10.x |
| PyTorch2.2.0 | Python3.8.x,Python3.9.x,Python3.10.x |
## Ascend Auxiliary Software
<table><thead align="left"><tr id="row721911327225"><th class="cellrowborder" valign="top" id="mcps1.2.6.1.1"><p id="p0878358152310"><a name="p0878358152310"></a><a name="p0878358152310"></a>CANN Version</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.2"><p id="p1833820270243"><a name="p1833820270243"></a><a name="p1833820270243"></a>Supported PyTorch Version</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.3"><p id="p7878175817236"><a name="p7878175817236"></a><a name="p7878175817236"></a>Supported Adapter Version</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.4"><p id="p58781058202311"><a name="p58781058202311"></a><a name="p58781058202311"></a>Github Branch</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.5"><p id="p1887865812234"><a name="p1887865812234"></a><a name="p1887865812234"></a>AscendHub Image Version/Name(<a href="https://ascendhub.huawei.com/#/detail/pytorch-modelzoo" target="_blank" rel="noopener noreferrer">Link</a>)</p>
</th>
</tr>
</thead>
<tbody><tr id="row1121913217224"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p387812581238"><a name="p387812581238"></a><a name="p387812581238"></a>7.0.RC1.alpha003</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p633892712241"><a name="p633892712241"></a><a name="p633892712241"></a>2.1.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p13878165862310"><a name="p13878165862310"></a><a name="p13878165862310"></a>2.1.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p5878658162312"><a name="p5878658162312"></a><a name="p5878658162312"></a>v2.1.0-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p1887895818234"><a name="p1887895818234"></a><a name="p1887895818234"></a>-</p>
</td>
</tr>
<tr id="row122191232122216"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1333872762420"><a name="p1333872762420"></a><a name="p1333872762420"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p08788581239"><a name="p08788581239"></a><a name="p08788581239"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p88793589233"><a name="p88793589233"></a><a name="p88793589233"></a>v2.0.1-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p18791958192318"><a name="p18791958192318"></a><a name="p18791958192318"></a>-</p>
</td>
</tr>
<tr id="row1220113211225"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p16339162718249"><a name="p16339162718249"></a><a name="p16339162718249"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p587919583231"><a name="p587919583231"></a><a name="p587919583231"></a>1.11.0.post4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1879185852316"><a name="p1879185852316"></a><a name="p1879185852316"></a>v1.11.0-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p987915814231"><a name="p987915814231"></a><a name="p987915814231"></a>-</p>
</td>
</tr>
<tr id="row92207321228"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p5879195862316"><a name="p5879195862316"></a><a name="p5879195862316"></a>CANN 6.3.RC3.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p13391127102419"><a name="p13391127102419"></a><a name="p13391127102419"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p987935812311"><a name="p987935812311"></a><a name="p987935812311"></a>1.11.0.post3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p178797587233"><a name="p178797587233"></a><a name="p178797587233"></a>v1.11.0-5.0.rc2.2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p16879458102316"><a name="p16879458102316"></a><a name="p16879458102316"></a>-</p>
</td>
</tr>
<tr id="row17220143220221"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p287917582235"><a name="p287917582235"></a><a name="p287917582235"></a>CANN 6.3.RC3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p933902762410"><a name="p933902762410"></a><a name="p933902762410"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p10879135819230"><a name="p10879135819230"></a><a name="p10879135819230"></a>1.11.0.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p17879125816231"><a name="p17879125816231"></a><a name="p17879125816231"></a>v1.11.0-5.0.rc2.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p10879155882310"><a name="p10879155882310"></a><a name="p10879155882310"></a>-</p>
</td>
</tr>
<tr id="row422116324224"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p13879165832316"><a name="p13879165832316"></a><a name="p13879165832316"></a>CANN 6.3.RC2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1191901662516"><a name="p1191901662516"></a><a name="p1191901662516"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p198791258142317"><a name="p198791258142317"></a><a name="p198791258142317"></a>2.0.1.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1587955816237"><a name="p1587955816237"></a><a name="p1587955816237"></a>v2.0.1-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p0879558192313"><a name="p0879558192313"></a><a name="p0879558192313"></a>-</p>
</td>
</tr>
<tr id="row1522123282216"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p19191169254"><a name="p19191169254"></a><a name="p19191169254"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p4879185815238"><a name="p4879185815238"></a><a name="p4879185815238"></a>1.8.1.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p887935810232"><a name="p887935810232"></a><a name="p887935810232"></a>v1.8.1-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p14879358172313"><a name="p14879358172313"></a><a name="p14879358172313"></a>23.0.RC1-1.8.1</p>
</td>
</tr>
<tr id="row19716641182317"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p691981615257"><a name="p691981615257"></a><a name="p691981615257"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p208791758142314"><a name="p208791758142314"></a><a name="p208791758142314"></a>1.11.0.post1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1987935852319"><a name="p1987935852319"></a><a name="p1987935852319"></a>v1.11.0-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1087918585237"><a name="p1087918585237"></a><a name="p1087918585237"></a>23.0.RC1-1.11.0</p>
</td>
</tr>
<tr id="row822143252217"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p108803589235"><a name="p108803589235"></a><a name="p108803589235"></a>CANN 6.3.RC1</p>
<p id="p129081558152312"><a name="p129081558152312"></a><a name="p129081558152312"></a></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p12346162018257"><a name="p12346162018257"></a><a name="p12346162018257"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p6880205814236"><a name="p6880205814236"></a><a name="p6880205814236"></a>1.8.1.post1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p6880258162313"><a name="p6880258162313"></a><a name="p6880258162313"></a>v1.8.1-5.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p08807589236"><a name="p08807589236"></a><a name="p08807589236"></a>-</p>
</td>
</tr>
<tr id="row13745135213239"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p183463202251"><a name="p183463202251"></a><a name="p183463202251"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1888019580230"><a name="p1888019580230"></a><a name="p1888019580230"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p15880105813236"><a name="p15880105813236"></a><a name="p15880105813236"></a>v1.11.0-5.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1588012586230"><a name="p1588012586230"></a><a name="p1588012586230"></a>-</p>
</td>
</tr>
<tr id="row1667135119236"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p188801958102315"><a name="p188801958102315"></a><a name="p188801958102315"></a>CANN 6.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p43395279244"><a name="p43395279244"></a><a name="p43395279244"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p118801658182310"><a name="p118801658182310"></a><a name="p118801658182310"></a>1.5.0.post8</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p4880125819233"><a name="p4880125819233"></a><a name="p4880125819233"></a>v1.5.0-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p8880858122319"><a name="p8880858122319"></a><a name="p8880858122319"></a>22.0.0</p>
</td>
</tr>
<tr id="row123884481236"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p0339162717244"><a name="p0339162717244"></a><a name="p0339162717244"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p15880115811236"><a name="p15880115811236"></a><a name="p15880115811236"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p68808584233"><a name="p68808584233"></a><a name="p68808584233"></a>v1.8.1-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1688035812238"><a name="p1688035812238"></a><a name="p1688035812238"></a>22.0.0-1.8.1</p>
</td>
</tr>
<tr id="row133914572237"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p10339102719241"><a name="p10339102719241"></a><a name="p10339102719241"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p9880205892318"><a name="p9880205892318"></a><a name="p9880205892318"></a>1.11.0.rc2(beta)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p888005822314"><a name="p888005822314"></a><a name="p888005822314"></a>v1.11.0-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p6880145812238"><a name="p6880145812238"></a><a name="p6880145812238"></a>-</p>
</td>
</tr>
<tr id="row127654514238"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p1288085862314"><a name="p1288085862314"></a><a name="p1288085862314"></a>CANN 6.0.RC1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p20327103216255"><a name="p20327103216255"></a><a name="p20327103216255"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p7880145811235"><a name="p7880145811235"></a><a name="p7880145811235"></a>1.5.0.post7</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1788095815239"><a name="p1788095815239"></a><a name="p1788095815239"></a>v1.5.0-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p6880115810237"><a name="p6880115810237"></a><a name="p6880115810237"></a>22.0.RC3</p>
</td>
</tr>
<tr id="row129461142152313"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p14327173292510"><a name="p14327173292510"></a><a name="p14327173292510"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1588035812311"><a name="p1588035812311"></a><a name="p1588035812311"></a>1.8.1.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p13880165816233"><a name="p13880165816233"></a><a name="p13880165816233"></a>v1.8.1-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p108806581238"><a name="p108806581238"></a><a name="p108806581238"></a>22.0.RC3-1.8.1</p>
</td>
</tr>
<tr id="row36411150122319"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1132743211257"><a name="p1132743211257"></a><a name="p1132743211257"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p168800589238"><a name="p168800589238"></a><a name="p168800589238"></a>1.11.0.rc1(beta)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p28816580233"><a name="p28816580233"></a><a name="p28816580233"></a>v1.11.0-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p198811588236"><a name="p198811588236"></a><a name="p198811588236"></a>-</p>
</td>
</tr>
<tr id="row12371144713235"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p11881558122317"><a name="p11881558122317"></a><a name="p11881558122317"></a>CANN 5.1.RC2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p629873412510"><a name="p629873412510"></a><a name="p629873412510"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p3881105818236"><a name="p3881105818236"></a><a name="p3881105818236"></a>1.5.0.post6</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1088125852319"><a name="p1088125852319"></a><a name="p1088125852319"></a>v1.5.0-3.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p20881258112316"><a name="p20881258112316"></a><a name="p20881258112316"></a>22.0.RC2</p>
</td>
</tr>
<tr id="row14956184342315"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p929893462515"><a name="p929893462515"></a><a name="p929893462515"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p688120581238"><a name="p688120581238"></a><a name="p688120581238"></a>1.8.1.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p198819587236"><a name="p198819587236"></a><a name="p198819587236"></a>v1.8.1-3.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1388175832319"><a name="p1388175832319"></a><a name="p1388175832319"></a>22.0.RC2-1.8.1</p>
</td>
</tr>
<tr id="row1522133210223"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p7881205813233"><a name="p7881205813233"></a><a name="p7881205813233"></a>CANN 5.1.RC1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1610094112517"><a name="p1610094112517"></a><a name="p1610094112517"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p12881165818235"><a name="p12881165818235"></a><a name="p12881165818235"></a>1.5.0.post5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p14881105892315"><a name="p14881105892315"></a><a name="p14881105892315"></a>v1.5.0-3.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p5881115812234"><a name="p5881115812234"></a><a name="p5881115812234"></a>22.0.RC1</p>
</td>
</tr>
<tr id="row182218327224"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p19100441202520"><a name="p19100441202520"></a><a name="p19100441202520"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p688165810235"><a name="p688165810235"></a><a name="p688165810235"></a>1.8.1.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p6881195818236"><a name="p6881195818236"></a><a name="p6881195818236"></a>v1.8.1-3.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p58817582239"><a name="p58817582239"></a><a name="p58817582239"></a>-</p>
</td>
</tr>
<tr id="row137028392234"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p208815585236"><a name="p208815585236"></a><a name="p208815585236"></a>CANN 5.0.4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1289474162511"><a name="p1289474162511"></a><a name="p1289474162511"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p68812058102318"><a name="p68812058102318"></a><a name="p68812058102318"></a>1.5.0.post4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p17881658122311"><a name="p17881658122311"></a><a name="p17881658122311"></a>2.0.4.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p1588119588233"><a name="p1588119588233"></a><a name="p1588119588233"></a>21.0.4</p>
</td>
</tr>
<tr id="row182227322224"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1188113584232"><a name="p1188113584232"></a><a name="p1188113584232"></a>CANN 5.0.3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1389417414253"><a name="p1389417414253"></a><a name="p1389417414253"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p14881358112314"><a name="p14881358112314"></a><a name="p14881358112314"></a>1.5.0.post3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p9881205862316"><a name="p9881205862316"></a><a name="p9881205862316"></a>2.0.3.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p68811858122317"><a name="p68811858122317"></a><a name="p68811858122317"></a>21.0.3</p>
</td>
</tr>
<tr id="row17222203202219"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p68814580234"><a name="p68814580234"></a><a name="p68814580234"></a>CANN 5.0.2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p610954522514"><a name="p610954522514"></a><a name="p610954522514"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1882758112318"><a name="p1882758112318"></a><a name="p1882758112318"></a>1.5.0.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p988215589234"><a name="p988215589234"></a><a name="p988215589234"></a>2.0.2.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p6882115811231"><a name="p6882115811231"></a><a name="p6882115811231"></a>21.0.2</p>
</td>
</tr>
</tbody>
</table>
**PyTorch Extension** versions follow the naming convention `{PyTorch version}-{Ascend version}`, where the former represents the PyTorch version compatible with the **PyTorch Extension**, and the latter is used to match the CANN version. The detailed matching is as follows:
| CANN Version | Supported PyTorch Version | Supported Extension Version | Github Branch | AscendHub Image Version/Name([Link](https://ascendhub.huawei.com/#/detail/pytorch-modelzoo)) |
|----------------|--------------|-------------------|-------------------|----------------------|
| CANN 8.0.RC1 | 2.2.0 | 2.2.0 | v2.2.0-6.0.rc1 | - |
| | 2.1.0 | 2.1.0.post3 | v2.1.0-6.0.rc1 | - |
| | 1.11.0 | 1.11.0.post11 | v1.11.0-6.0.rc1 | - |
| CANN 7.0.0 | 2.1.0 | 2.1.0 | v2.1.0-5.0.0 | - |
| | 2.0.1 | 2.0.1.post1 | v2.0.1-5.0.0 | - |
| | 1.11.0 | 1.11.0.post8 | v1.11.0-5.0.0 | - |
| CANN 7.0.RC1 | 2.1.0 | 2.1.0.rc1 | v2.1.0-5.0.rc3 | - |
| | 2.0.1 | 2.0.1 | v2.0.1-5.0.rc3 | - |
| | 1.11.0 | 1.11.0.post4 | v1.11.0-5.0.rc3 | - |
| CANN 6.3.RC3.1 | 1.11.0 | 1.11.0.post3 | v1.11.0-5.0.rc2.2 | - |
| CANN 6.3.RC3 | 1.11.0 | 1.11.0.post2 | v1.11.0-5.0.rc2.1 | - |
| CANN 6.3.RC2 | 2.0.1 | 2.0.1.rc1 | v2.0.1-5.0.rc2 | - |
| | 1.11.0 | 1.11.0.post1 | v1.11.0-5.0.rc2 | 23.0.RC1-1.11.0 |
| | 1.8.1 | 1.8.1.post2 | v1.8.1-5.0.rc2 | 23.0.RC1-1.8.1 |
| CANN 6.3.RC1 | 1.11.0 | 1.11.0 | v1.11.0-5.0.rc1 | - |
| | 1.8.1 | 1.8.1.post1 | v1.8.1-5.0.rc1 | - |
| CANN 6.0.1 | 1.5.0 | 1.5.0.post8 | v1.5.0-3.0.0 | 22.0.0 |
| | 1.8.1 | 1.8.1 | v1.8.1-3.0.0 | 22.0.0-1.8.1 |
| | 1.11.0 | 1.11.0.rc2(beta) | v1.11.0-3.0.0 | - |
| CANN 6.0.RC1 | 1.5.0 | 1.5.0.post7 | v1.5.0-3.0.rc3 | 22.0.RC3 |
| | 1.8.1 | 1.8.1.rc3 | v1.8.1-3.0.rc3 | 22.0.RC3-1.8.1 |
| | 1.11.0 | 1.11.0.rc1(beta) | v1.11.0-3.0.rc3 | - |
| CANN 5.1.RC2 | 1.5.0 | 1.5.0.post6 | v1.5.0-3.0.rc2 | 22.0.RC2 |
| | 1.8.1 | 1.8.1.rc2 | v1.8.1-3.0.rc2 | 22.0.RC2-1.8.1 |
| CANN 5.1.RC1 | 1.5.0 | 1.5.0.post5 | v1.5.0-3.0.rc1 | 22.0.RC1 |
| | 1.8.1 | 1.8.1.rc1 | v1.8.1-3.0.rc1 | - |
| CANN 5.0.4 | 1.5.0 | 1.5.0.post4 | 2.0.4.tr5 | 21.0.4 |
| CANN 5.0.3 | 1.8.1 | 1.5.0.post3 | 2.0.3.tr5 | 21.0.3 |
| CANN 5.0.2 | 1.5.0 | 1.5.0.post2 | 2.0.2.tr5 | 21.0.2 |
## Suggestions and Communication
@@ -386,25 +173,32 @@ The version branches of AscendPyTorch have the following maintenance phases:
|-------------------|--------------|--------------------------------------------------------------------------------------------------------------------------------|
| Planning | 1-3 months | Plan features. |
| Development | 3 months | Develop features. |
| Maintained | 6-12 months | Allow the incorporation of all resolved issues and release the version. |
| Maintained | 6-12 months | Allow the incorporation of all resolved issues and release the version, Different versions of PyTorch adopt varying support policies. The maintenance periods for Regular Releases and Long-Term Support versions are 6 months and 12 months, respectively. |
| Unmaintained | 0-3 months | Allow the incorporation of all resolved issues. No dedicated maintenance personnel are available. No version will be released. |
| End Of Life (EOL) | N/A | Do not accept any modification to a branch. |
## Maintenance Status of Existing Branches
## PyTorch Maintenance Policies
| **Branch Name** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** |
| --------------- | ---------- | --------------- | --------------------------------------- | ------------ |
| **v2.0.2** | EOL | 2021/7/29 | N/A | |
| **v2.0.3** | EOL | 2021/10/15 | N/A | |
| **v2.0.4** | EOL | 2022/1/15 | N/A | |
| **v3.0.rc1** | EOL | 2022/4/10 | N/A | |
| **v3.0.rc2** | EOL | 2022/7/15 | N/A | |
| **v3.0.rc3** | Maintained | 2022/10/20 | Unmaintained <br> 2023-10-20 estimated | |
| **v3.0.0** | Maintained | 2023/1/18 | Unmaintained <br> 2024-1-18 estimated | |
| **v5.0.rc1** | Maintained | 2023/4/19 | Unmaintained <br> 2024-4-19 estimated | |
| **v5.0.rc2** | Maintained | 2023/7/19 | Unmaintained <br> 2024-7-19 estimated | |
| **v5.0.rc3** | Maintained | 2023/10/15 | Unmaintained <br> 2024-10-15 estimated | |
| **PyTorch** | **Maintenance Policies** | **Status** | **Launch Date** | **Subsequent Status** | **EOL Date** |
|-----------|--------------------|--------------|------------|-----------------|-----------|
| 2.2.0 | Regular Release | Maintained | 2024/04/01 | Unmaintained 2024-10-15 estimated | |
| 2.1.0 | Long Term Support | Maintained | 2023/10/15 | Unmaintained 2024-10-15 estimated | |
| 2.0.1 | Regular Release | EOL | 2023/7/19 | | 2024/3/14 |
| 1.11.0 | Long Term Support | Maintained | 2023/4/19 | Unmaintained 2024-4-19 estimated | |
| 1.8.1 | Long Term Support | EOL | 2022/4/10 | | 2023/4/10 |
| 1.5.0 | Long Term Support | EOL | 2021/7/29 | | 2022/7/29 |
## Reference Documents
For more detailed information on installation guides, model migration, training/inference tutorials, and API lists, please refer to the [Ascend Extension for Pytorch on the HiAI Community](https://www.hiascend.com/software/ai-frameworks/commercial).
| Document Name | Document Link |
| -------------------------------- | ------------------------------------------------------------ |
| AscendPyTorch Installation Guide | [link](https://www.hiascend.com/document/detail/zh/Pytorch/60RC1/quickstart/instg) |
| AscendPyTorch Network Model Migration and Training | [link](https://www.hiascend.com/document/detail/zh/Pytorch/60RC1/ptmoddevg/trainingmigrguide/PT_LMTMOG_0003.html) |
| AscendPyTorch Operator Adaptation | [link](https://www.hiascend.com/document/detail/zh/canncommercial/700/operatordev/tbeaicpudevg/atlasopdev_10_0086.html) |
| AscendPyTorch API List (PyTorch and Custom Interfaces) | [link](https://www.hiascend.com/document/detail/zh/Pytorch/60RC1/apiref/apilist/ptaoplist_000002.html) |
## License
PyTorch Ascend Adapter has a BSD-style license, as found in the [LICENSE](LICENSE) file.
Ascend Extension for Pytorch has a BSD-style license, as found in the [LICENSE](LICENSE) file.
+78 -269
View File
@@ -1,8 +1,8 @@
# PyTorch Ascend Adapter插件
# Ascend Extension for Pytorch
## 简介
本项目开发了名为**torch_npu**的**PyTorch Ascend Adapter**插件,使昇腾NPU可以适配PyTorch框架,为使用PyTorch框架的开发者提供昇腾AI处理器的超强算力。
本项目开发了名为**torch_npu**的**PyTorch Extension**插件,使昇腾NPU可以适配PyTorch框架,为使用PyTorch框架的开发者提供昇腾AI处理器的超强算力。
昇腾为基于华为昇腾处理器和软件的行业应用及服务提供全栈AI计算基础设施。您可以通过访问[昇腾社区](https://www.hiascend.com/zh/),了解关于昇腾的更多信息。
@@ -41,7 +41,7 @@ pip3 install torch==2.1.0+cpu --index-url https://download.pytorch.org/whl/cpu
2. **安装torch_npu依赖**
运行一下命令安装依赖。
运行以下命令安装依赖。
```Python
pip3 install pyyaml
@@ -51,17 +51,18 @@ pip3 install setuptools
3. **安装torch_npu**
```
pip3 install torch-npu==2.1.0rc1
pip3 install torch-npu==2.1.0.post3
```
如需要保存安装日志,可在pip3 install命令后面加上参数 `--log <PATH>`,并对您指定的目录`<PATH>`做好权限管控。
### 使用源代码进行安装
某些特殊场景下,用户可能需要自行编译**torch_npu**。可以根据[昇腾辅助软件表](#昇腾辅助软件)和[PyTorch与Python版本配套表](#PyTorch与Python版本配套表)选择合适的分支。推荐使用Docker镜像编译**torch_npu**,可以通过以下步骤获取:
某些特殊场景下,用户可能需要自行编译**torch_npu**。可以根据[昇腾辅助软件表](#昇腾辅助软件)和[PyTorch与Python版本配套表](#PyTorch与Python版本配套表)选择合适的分支。推荐使用Docker镜像编译**torch_npu**,可以通过以下步骤获取(建议只挂载工作路径,并避开系统路径,以降低安全风险), 生成的.whl文件路径为./dist/:
1. **克隆torch_npu代码仓**
```
git clone https://gitee.com/ascend/pytorch.git -b v2.1.0-5.0.rc3 --depth 1
git clone https://gitee.com/ascend/pytorch.git -b v2.1.0-6.0.rc1 --depth 1
```
2. **构建镜像**
@@ -88,6 +89,16 @@ pip3 install torch-npu==2.1.0rc1
```
## 卸载
Pytorch框架训练环境的卸载可以参考[昇腾官方文档](https://www.hiascend.com/document/detail/zh/ModelZoo/pytorchframework/ptes/ptes_00032.html)。
torch_npu的卸载只需执行命令:
```
pip3 uninstall torch_npu
```
如需要保存卸载日志,可在pip3 uninstall命令后面加上参数 `--log <PATH>`,并对您指定的目录`<PATH>`做好权限管控。
## 入门
@@ -120,258 +131,44 @@ print(z)
| PyTorch版本 | Python版本 |
| ------------- | :----------------------------------------------------------- |
| PyTorch1.11.0 | Python3.7.x(>=3.7.5), Python3.8.x, Python3.9.x, Python3.10.x |
| PyTorch2.0.1 | Python3.8.x, Python3.9.x, Python3.10.x |
| PyTorch2.1.0 | Python3.8.x, Python3.9.x, Python3.10.x |
| PyTorch2.2.0 | Python3.8.x, Python3.9.x, Python3.10.x |
## 昇腾辅助软件
<table><thead align="left"><tr id="row721911327225"><th class="cellrowborder" valign="top" id="mcps1.2.6.1.1"><p id="p0878358152310"><a name="p0878358152310"></a><a name="p0878358152310"></a>CANN版本</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.2"><p id="p1833820270243"><a name="p1833820270243"></a><a name="p1833820270243"></a>支持的PyTorch版本</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.3"><p id="p7878175817236"><a name="p7878175817236"></a><a name="p7878175817236"></a>支持的Adapter版本</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.4"><p id="p58781058202311"><a name="p58781058202311"></a><a name="p58781058202311"></a>Github分支</p>
</th>
<th class="cellrowborder" valign="top" id="mcps1.2.6.1.5"><p id="p1887865812234"><a name="p1887865812234"></a><a name="p1887865812234"></a>AscendHub镜像版本/名称(<a href="https://ascendhub.huawei.com/#/detail/pytorch-modelzoo" target="_blank" rel="noopener noreferrer">链接</a>)</p>
</th>
</tr>
</thead>
<tbody><tr id="row1121913217224"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p387812581238"><a name="p387812581238"></a><a name="p387812581238"></a>CANN 7.0.RC1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p633892712241"><a name="p633892712241"></a><a name="p633892712241"></a>2.1.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p13878165862310"><a name="p13878165862310"></a><a name="p13878165862310"></a>2.1.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p5878658162312"><a name="p5878658162312"></a><a name="p5878658162312"></a>v2.1.0-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p1887895818234"><a name="p1887895818234"></a><a name="p1887895818234"></a>-</p>
</td>
</tr>
<tr id="row122191232122216"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1333872762420"><a name="p1333872762420"></a><a name="p1333872762420"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p08788581239"><a name="p08788581239"></a><a name="p08788581239"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p88793589233"><a name="p88793589233"></a><a name="p88793589233"></a>v2.0.1-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p18791958192318"><a name="p18791958192318"></a><a name="p18791958192318"></a>-</p>
</td>
</tr>
<tr id="row1220113211225"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p16339162718249"><a name="p16339162718249"></a><a name="p16339162718249"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p587919583231"><a name="p587919583231"></a><a name="p587919583231"></a>1.11.0.post4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1879185852316"><a name="p1879185852316"></a><a name="p1879185852316"></a>v1.11.0-5.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p987915814231"><a name="p987915814231"></a><a name="p987915814231"></a>-</p>
</td>
</tr>
<tr id="row92207321228"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p5879195862316"><a name="p5879195862316"></a><a name="p5879195862316"></a>CANN 6.3.RC3.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p13391127102419"><a name="p13391127102419"></a><a name="p13391127102419"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p987935812311"><a name="p987935812311"></a><a name="p987935812311"></a>1.11.0.post3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p178797587233"><a name="p178797587233"></a><a name="p178797587233"></a>v1.11.0-5.0.rc2.2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p16879458102316"><a name="p16879458102316"></a><a name="p16879458102316"></a>-</p>
</td>
</tr>
<tr id="row17220143220221"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p287917582235"><a name="p287917582235"></a><a name="p287917582235"></a>CANN 6.3.RC3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p933902762410"><a name="p933902762410"></a><a name="p933902762410"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p10879135819230"><a name="p10879135819230"></a><a name="p10879135819230"></a>1.11.0.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p17879125816231"><a name="p17879125816231"></a><a name="p17879125816231"></a>v1.11.0-5.0.rc2.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p10879155882310"><a name="p10879155882310"></a><a name="p10879155882310"></a>-</p>
</td>
</tr>
<tr id="row422116324224"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p13879165832316"><a name="p13879165832316"></a><a name="p13879165832316"></a>CANN 6.3.RC2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1191901662516"><a name="p1191901662516"></a><a name="p1191901662516"></a>2.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p198791258142317"><a name="p198791258142317"></a><a name="p198791258142317"></a>2.0.1.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1587955816237"><a name="p1587955816237"></a><a name="p1587955816237"></a>v2.0.1-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p0879558192313"><a name="p0879558192313"></a><a name="p0879558192313"></a>-</p>
</td>
</tr>
<tr id="row1522123282216"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p19191169254"><a name="p19191169254"></a><a name="p19191169254"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p4879185815238"><a name="p4879185815238"></a><a name="p4879185815238"></a>1.8.1.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p887935810232"><a name="p887935810232"></a><a name="p887935810232"></a>v1.8.1-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p14879358172313"><a name="p14879358172313"></a><a name="p14879358172313"></a>23.0.RC1-1.8.1</p>
</td>
</tr>
<tr id="row19716641182317"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p691981615257"><a name="p691981615257"></a><a name="p691981615257"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p208791758142314"><a name="p208791758142314"></a><a name="p208791758142314"></a>1.11.0.post1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1987935852319"><a name="p1987935852319"></a><a name="p1987935852319"></a>v1.11.0-5.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1087918585237"><a name="p1087918585237"></a><a name="p1087918585237"></a>23.0.RC1-1.11.0</p>
</td>
</tr>
<tr id="row822143252217"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p108803589235"><a name="p108803589235"></a><a name="p108803589235"></a>CANN 6.3.RC1</p>
<p id="p129081558152312"><a name="p129081558152312"></a><a name="p129081558152312"></a></p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p12346162018257"><a name="p12346162018257"></a><a name="p12346162018257"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p6880205814236"><a name="p6880205814236"></a><a name="p6880205814236"></a>1.8.1.post1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p6880258162313"><a name="p6880258162313"></a><a name="p6880258162313"></a>v1.8.1-5.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p08807589236"><a name="p08807589236"></a><a name="p08807589236"></a>-</p>
</td>
</tr>
<tr id="row13745135213239"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p183463202251"><a name="p183463202251"></a><a name="p183463202251"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1888019580230"><a name="p1888019580230"></a><a name="p1888019580230"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p15880105813236"><a name="p15880105813236"></a><a name="p15880105813236"></a>v1.11.0-5.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1588012586230"><a name="p1588012586230"></a><a name="p1588012586230"></a>-</p>
</td>
</tr>
<tr id="row1667135119236"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p188801958102315"><a name="p188801958102315"></a><a name="p188801958102315"></a>CANN 6.0.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p43395279244"><a name="p43395279244"></a><a name="p43395279244"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p118801658182310"><a name="p118801658182310"></a><a name="p118801658182310"></a>1.5.0.post8</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p4880125819233"><a name="p4880125819233"></a><a name="p4880125819233"></a>v1.5.0-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p8880858122319"><a name="p8880858122319"></a><a name="p8880858122319"></a>22.0.0</p>
</td>
</tr>
<tr id="row123884481236"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p0339162717244"><a name="p0339162717244"></a><a name="p0339162717244"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p15880115811236"><a name="p15880115811236"></a><a name="p15880115811236"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p68808584233"><a name="p68808584233"></a><a name="p68808584233"></a>v1.8.1-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1688035812238"><a name="p1688035812238"></a><a name="p1688035812238"></a>22.0.0-1.8.1</p>
</td>
</tr>
<tr id="row133914572237"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p10339102719241"><a name="p10339102719241"></a><a name="p10339102719241"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p9880205892318"><a name="p9880205892318"></a><a name="p9880205892318"></a>1.11.0.rc2(beta)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p888005822314"><a name="p888005822314"></a><a name="p888005822314"></a>v1.11.0-3.0.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p6880145812238"><a name="p6880145812238"></a><a name="p6880145812238"></a>-</p>
</td>
</tr>
<tr id="row127654514238"><td class="cellrowborder" rowspan="3" valign="top" headers="mcps1.2.6.1.1 "><p id="p1288085862314"><a name="p1288085862314"></a><a name="p1288085862314"></a>CANN 6.0.RC1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p20327103216255"><a name="p20327103216255"></a><a name="p20327103216255"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p7880145811235"><a name="p7880145811235"></a><a name="p7880145811235"></a>1.5.0.post7</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1788095815239"><a name="p1788095815239"></a><a name="p1788095815239"></a>v1.5.0-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p6880115810237"><a name="p6880115810237"></a><a name="p6880115810237"></a>22.0.RC3</p>
</td>
</tr>
<tr id="row129461142152313"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p14327173292510"><a name="p14327173292510"></a><a name="p14327173292510"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1588035812311"><a name="p1588035812311"></a><a name="p1588035812311"></a>1.8.1.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p13880165816233"><a name="p13880165816233"></a><a name="p13880165816233"></a>v1.8.1-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p108806581238"><a name="p108806581238"></a><a name="p108806581238"></a>22.0.RC3-1.8.1</p>
</td>
</tr>
<tr id="row36411150122319"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1132743211257"><a name="p1132743211257"></a><a name="p1132743211257"></a>1.11.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p168800589238"><a name="p168800589238"></a><a name="p168800589238"></a>1.11.0.rc1(beta)</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p28816580233"><a name="p28816580233"></a><a name="p28816580233"></a>v1.11.0-3.0.rc3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p198811588236"><a name="p198811588236"></a><a name="p198811588236"></a>-</p>
</td>
</tr>
<tr id="row12371144713235"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p11881558122317"><a name="p11881558122317"></a><a name="p11881558122317"></a>CANN 5.1.RC2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p629873412510"><a name="p629873412510"></a><a name="p629873412510"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p3881105818236"><a name="p3881105818236"></a><a name="p3881105818236"></a>1.5.0.post6</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1088125852319"><a name="p1088125852319"></a><a name="p1088125852319"></a>v1.5.0-3.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p20881258112316"><a name="p20881258112316"></a><a name="p20881258112316"></a>22.0.RC2</p>
</td>
</tr>
<tr id="row14956184342315"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p929893462515"><a name="p929893462515"></a><a name="p929893462515"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p688120581238"><a name="p688120581238"></a><a name="p688120581238"></a>1.8.1.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p198819587236"><a name="p198819587236"></a><a name="p198819587236"></a>v1.8.1-3.0.rc2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1388175832319"><a name="p1388175832319"></a><a name="p1388175832319"></a>22.0.RC2-1.8.1</p>
</td>
</tr>
<tr id="row1522133210223"><td class="cellrowborder" rowspan="2" valign="top" headers="mcps1.2.6.1.1 "><p id="p7881205813233"><a name="p7881205813233"></a><a name="p7881205813233"></a>CANN 5.1.RC1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1610094112517"><a name="p1610094112517"></a><a name="p1610094112517"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p12881165818235"><a name="p12881165818235"></a><a name="p12881165818235"></a>1.5.0.post5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p14881105892315"><a name="p14881105892315"></a><a name="p14881105892315"></a>v1.5.0-3.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p5881115812234"><a name="p5881115812234"></a><a name="p5881115812234"></a>22.0.RC1</p>
</td>
</tr>
<tr id="row182218327224"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p19100441202520"><a name="p19100441202520"></a><a name="p19100441202520"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p688165810235"><a name="p688165810235"></a><a name="p688165810235"></a>1.8.1.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p6881195818236"><a name="p6881195818236"></a><a name="p6881195818236"></a>v1.8.1-3.0.rc1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p58817582239"><a name="p58817582239"></a><a name="p58817582239"></a>-</p>
</td>
</tr>
<tr id="row137028392234"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p208815585236"><a name="p208815585236"></a><a name="p208815585236"></a>CANN 5.0.4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1289474162511"><a name="p1289474162511"></a><a name="p1289474162511"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p68812058102318"><a name="p68812058102318"></a><a name="p68812058102318"></a>1.5.0.post4</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p17881658122311"><a name="p17881658122311"></a><a name="p17881658122311"></a>2.0.4.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p1588119588233"><a name="p1588119588233"></a><a name="p1588119588233"></a>21.0.4</p>
</td>
</tr>
<tr id="row182227322224"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p1188113584232"><a name="p1188113584232"></a><a name="p1188113584232"></a>CANN 5.0.3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p1389417414253"><a name="p1389417414253"></a><a name="p1389417414253"></a>1.8.1</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p14881358112314"><a name="p14881358112314"></a><a name="p14881358112314"></a>1.5.0.post3</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p9881205862316"><a name="p9881205862316"></a><a name="p9881205862316"></a>2.0.3.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p68811858122317"><a name="p68811858122317"></a><a name="p68811858122317"></a>21.0.3</p>
</td>
</tr>
<tr id="row17222203202219"><td class="cellrowborder" valign="top" headers="mcps1.2.6.1.1 "><p id="p68814580234"><a name="p68814580234"></a><a name="p68814580234"></a>CANN 5.0.2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.2 "><p id="p610954522514"><a name="p610954522514"></a><a name="p610954522514"></a>1.5.0</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p1882758112318"><a name="p1882758112318"></a><a name="p1882758112318"></a>1.5.0.post2</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p988215589234"><a name="p988215589234"></a><a name="p988215589234"></a>2.0.2.tr5</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.5 "><p id="p6882115811231"><a name="p6882115811231"></a><a name="p6882115811231"></a>21.0.2</p>
</td>
</tr>
</tbody>
</table>
**PyTorch Extension**版本号采用`{PyTorch版本}-{昇腾版本}`命名规则,前者为**PyTorch Extension**匹配的PyTorch版本,后者用于匹配CANN版本,详细匹配如下:
| CANN版本 | 支持的PyTorch版本 | 支持的Extension版本 | Gitee分支 | AscendHub镜像版本/名称([链接](https://ascendhub.huawei.com/#/detail/pytorch-modelzoo)) |
|----------------|--------------|-------------------|-------------------|----------------------|
| CANN 8.0.RC1 | 2.2.0 | 2.2.0 | v2.2.0-6.0.rc1 | - |
| | 2.1.0 | 2.1.0.post3 | v2.1.0-6.0.rc1 | - |
| | 1.11.0 | 1.11.0.post11 | v1.11.0-6.0.rc1 | - |
| CANN 7.0.0 | 2.1.0 | 2.1.0 | v2.1.0-5.0.0 | - |
| | 2.0.1 | 2.0.1.post1 | v2.0.1-5.0.0 | - |
| | 1.11.0 | 1.11.0.post8 | v1.11.0-5.0.0 | - |
| CANN 7.0.RC1 | 2.1.0 | 2.1.0.rc1 | v2.1.0-5.0.rc3 | - |
| | 2.0.1 | 2.0.1 | v2.0.1-5.0.rc3 | - |
| | 1.11.0 | 1.11.0.post4 | v1.11.0-5.0.rc3 | - |
| CANN 6.3.RC3.1 | 1.11.0 | 1.11.0.post3 | v1.11.0-5.0.rc2.2 | - |
| CANN 6.3.RC3 | 1.11.0 | 1.11.0.post2 | v1.11.0-5.0.rc2.1 | - |
| CANN 6.3.RC2 | 2.0.1 | 2.0.1.rc1 | v2.0.1-5.0.rc2 | - |
| | 1.11.0 | 1.11.0.post1 | v1.11.0-5.0.rc2 | 23.0.RC1-1.11.0 |
| | 1.8.1 | 1.8.1.post2 | v1.8.1-5.0.rc2 | 23.0.RC1-1.8.1 |
| CANN 6.3.RC1 | 1.11.0 | 1.11.0 | v1.11.0-5.0.rc1 | - |
| | 1.8.1 | 1.8.1.post1 | v1.8.1-5.0.rc1 | - |
| CANN 6.0.1 | 1.5.0 | 1.5.0.post8 | v1.5.0-3.0.0 | 22.0.0 |
| | 1.8.1 | 1.8.1 | v1.8.1-3.0.0 | 22.0.0-1.8.1 |
| | 1.11.0 | 1.11.0.rc2(beta) | v1.11.0-3.0.0 | - |
| CANN 6.0.RC1 | 1.5.0 | 1.5.0.post7 | v1.5.0-3.0.rc3 | 22.0.RC3 |
| | 1.8.1 | 1.8.1.rc3 | v1.8.1-3.0.rc3 | 22.0.RC3-1.8.1 |
| | 1.11.0 | 1.11.0.rc1(beta) | v1.11.0-3.0.rc3 | - |
| CANN 5.1.RC2 | 1.5.0 | 1.5.0.post6 | v1.5.0-3.0.rc2 | 22.0.RC2 |
| | 1.8.1 | 1.8.1.rc2 | v1.8.1-3.0.rc2 | 22.0.RC2-1.8.1 |
| CANN 5.1.RC1 | 1.5.0 | 1.5.0.post5 | v1.5.0-3.0.rc1 | 22.0.RC1 |
| | 1.8.1 | 1.8.1.rc1 | v1.8.1-3.0.rc1 | - |
| CANN 5.0.4 | 1.5.0 | 1.5.0.post4 | 2.0.4.tr5 | 21.0.4 |
| CANN 5.0.3 | 1.8.1 | 1.5.0.post3 | 2.0.3.tr5 | 21.0.3 |
| CANN 5.0.2 | 1.5.0 | 1.5.0.post2 | 2.0.2.tr5 | 21.0.2 |
## 建议与交流
@@ -384,26 +181,38 @@ AscendPyTorch版本分支的维护阶段如下:
| **状态** | **时间** | **说明** |
| ------------------- | -------- | ------------------------------------------------ |
| 计划 | 1—3 个月 | 计划特性 |
| 开发 | 3个月 | 开发特性 |
| 维护 | 6—12个月 | 合入所有已解决的问题并发布版本 |
| 开发 | 3 个月 | 开发特性 |
| 维护 | 6-12 个月| 合入所有已解决的问题并发布版本,针对不同的PyTorch版本采取不同的维护策略,常规版本和长期支持版本维护周期分别为6个月和12个月 |
| 无维护 | 0—3 个月 | 合入所有已解决的问题,无专职维护人员,无版本发布 |
| 生命周期终止(EOL) | N/A | 分支不再接受任何修改 |
## 现有分支的维护状态
## PyTorch版本维护策略
| **分支** | **状态** | **发布日期** | **后续状态** | **EOL日期** |
| ------------ | -------- | ------------ | -------------------------- | ----------- |
| **v2.0.2** | EOL | 2021/7/29 | N/A | |
| **v2.0.3** | EOL | 2021/10/15 | N/A | |
| **v2.0.4** | EOL | 2022/1/15 | N/A | |
| **v3.0.rc1** | EOL | 2022/4/10 | N/A | |
| **v3.0.rc2** | EOL | 2022/7/15 | N/A | |
| **v3.0.rc3** | 维护 | 2022/10/20 | 预计2023/10/20起无维护 | |
| **v3.0.0** | 维护 | 2023/1/18 | 预计2024/1/18起无维护 | |
| **v5.0.rc1** | 维护 | 2023/4/19 | 预计2024/4/19起无维护 | |
| **v5.0.rc2** | 维护 | 2023/7/19 | 预计2024/7/19起无维护 | |
| **v5.0.rc3** | 维护 | 2023/10/15 | 预计2024/10/15起无维护 | |
| **PyTorch版本** | **维护策略** | **当前状态** | **发布时间** | **后续状态** | **EOL日期** |
|-----------|-----------|--------|------------|-----------------------|-----------|
| 2.2.0 | 常规版本 | 维护 | 2024/04/01 | 预计2024/10/15起无维护 | |
| 2.1.0 | 长期支持 | 维护 | 2023/10/15 | 预计2024/10/15起无维护 | |
| 2.0.1 | 常规版本 | EOL | 2023/7/19 | | 2024/3/14 |
| 1.11.0 | 长期支持 | 维护 | 2023/4/19 | 预计2024/4/19起无维护 | |
| 1.8.1 | 长期支持 | EOL | 2022/4/10 | | 2023/4/10 |
| 1.5.0 | 长期支持 | EOL | 2021/7/29 | | 2022/7/29 |
## 安全声明
[Ascend Extension for PyTorch插件 安全声明](https://gitee.com/ascend/pytorch/blob/v2.1.0-6.0.rc1/SECURITYNOTE.md)
## 参考文档
有关安装指南、模型迁移和训练/推理教程和API列表等更多详细信息,请参考[昇腾社区Ascend Extension for PyTorch](https://www.hiascend.com/software/ai-frameworks/commercial)。
| 文档名称 | 文档链接 |
| -------------------------- | ------------------------------------------------------------ |
| AscendPyTorch 安装指南 | [参考链接](https://www.hiascend.com/document/detail/zh/canncommercial/700/envdeployment/instg/instg_0163.html) |
| AscendPyTorch 网络模型迁移和训练 | [参考链接](https://www.hiascend.com/document/detail/zh/canncommercial/700/modeldevpt/ptmigr/AImpug_000002.html) |
| AscendPyTorch 在线推理 | [参考链接](https://www.hiascend.com/document/detail/zh/canncommercial/700/modeldevpt/ptonlineinfer/PyTorch_Infer_000001.html) |
| AscendPyTorch 算子适配 | [参考链接](https://www.hiascend.com/document/detail/zh/canncommercial/700/operatordev/tbeaicpudevg/atlasopdev_10_0086.html) |
| AscendPyTorch API清单(PyTorch原生接口与自定义接口) | [参考链接](https://www.hiascend.com/document/detail/zh/canncommercial/700/modeldevpt/ptmigr/ptaoplist_000002.html) |
## 许可证
PyTorch Ascend Adapter插件使用BSD许可证。详见[LICENSE](LICENSE)文件。
Ascend Extension for PyTorch插件使用BSD许可证。详见[LICENSE](LICENSE)文件。
+216
View File
@@ -0,0 +1,216 @@
# Ascend Extension for PyTorch插件 安全声明
## 系统安全加固
建议用户在系统中配置开启ASLR(级别2 ),又称**全随机地址空间布局随机化**,可参考以下方式进行配置:
echo 2 > /proc/sys/kernel/randomize_va_space
## 运行用户建议
出于安全性及权限最小化角度考虑,不建议使用root等管理员类型账户使用torch_npu。
## 文件权限控制
1. 建议用户对训练所需文件、训练过程中保存的文件、用户个人的隐私数据、商业资产等敏感文件做好权限控制等安全措施,例如多用户共享数据集场景下的数据集文件写权限控制、profiler等场景产生数据文件权限控制等,设定的权限建议参考[文件权限参考](#文件权限参考)进行设置。
2. torch_npu中profiler工具会生成性能记录文件,生成的文件权限为640,文件夹权限为750,用户可根据需要自行对生成后的相关文件进行权限控制。
3. 用户安装和使用过程需要做好权限控制,建议参考[文件权限参考](#文件权限参考)进行设置。如需要保存安装/卸载日志,可在安装/卸载命令后面加上参数--log <FILE>, 注意对<FILE>文件及目录做好权限管控。
4. PyTorch框架运行中所生成的文件权限依赖系统设定,如torch.save接口保存的文件。建议当前执行脚本的用户根据自身需要,对生成文件做好权限控制,设定的权限可参考[文件权限参考](#文件权限参考) 。可使用umask控制默认权限,降低提权等安全风险,建议用户将主机(包括宿主机)和容器中的umask设置为0027及其以上,提高安全性。
##### 文件权限参考
| 类型 | Linux权限参考最大值 |
|----------------------------------- |-----------------------|
| 用户主目录 | 750(rwxr-x---) |
| 程序文件(含脚本文件、库文件等) | 550(r-xr-x---) |
| 程序文件目录 | 550(r-xr-x---) |
| 配置文件 | 640(rw-r-----) |
| 配置文件目录 | 750(rwxr-x---) |
| 日志文件(记录完毕或者已经归档) | 440(r--r-----) |
| 日志文件(正在记录) | 640(rw-r-----) |
| 日志文件目录 | 750(rwxr-x---) |
| Debug文件 | 640(rw-r-----) |
| Debug文件目录 | 750(rwxr-x---) |
| 临时文件目录 | 750(rwxr-x---) |
| 维护升级文件目录 | 770(rwxrwx---) |
| 业务数据文件 | 640(rw-r-----) |
| 业务数据文件目录 | 750(rwxr-x---) |
| 密钥组件、私钥、证书、密文文件目录 | 700(rwx------) |
| 密钥组件、私钥、证书、加密密文 | 600(rw-------) |
| 加解密接口、加解密脚本 | 500(r-x------) |
## 调试工具声明
torch_npu内集成性能分析工具profiler:
- 集成原因:对标pytorch原生支持能力,提供NPU PyTorch框架开发性能分析能力,加速性能分析调试过程。
- 使用场景:默认不采集,如用户需要进行性能分析时,可在模型训练脚本中添加Ascend Extension for PyTorch Profiler接口,执行训练的同时采集性能数据,完成训练后直接输出可视化的性能数据文件。
- 风险提示:使用该功能会在本地生成性能数据,用户需加强对相关性能数据的保护,请在需要模型性能分析时使用,分析完成后及时关闭。Profiler工具具体细节请参考[《PyTorch 性能分析工具介绍》](https://www.hiascend.com/document/detail/zh/Pytorch/60RC1/ptmoddevg/trainingmigrguide/performance_tuning_0013.html)。
## 数据安全声明
1. PyTorch使用过程中需要加载和保存数据,部分接口使用风险模块pickle,可能存在数据风险,如torch.load、torch.distributed.scatter_object_list等接口,可参考[torch.load](https://pytorch.org/docs/2.1/generated/torch.load.html#torch.load)、[collective-functions](https://pytorch.org/docs/2.1/distributed.html#collective-functions)了解具体风险。
2. Ascend Extension for PyTorch依赖CANN的基础能力实现AOE性能调优、算子dump、日志记录等功能,用户需要关注上述功能生成文件的权限控制,加强对相关数据的保护。
## 构建安全声明
torch_npu支持源码编译安装,在编译时会下载依赖第三方库并执行构建shell脚本,在编译过程中会产生临时程序文件和编译目录。用户可根据需要自行对源代码目录内的文件进行权限管控降低安全风险。
## 运行安全声明
1. 建议用户结合运行环境资源状况编写对应训练脚本。若训练脚本与资源状况不匹配,如数据集加载内存大小超出内存容量限制、训练脚本在本地生成数据超过磁盘空间大小等情况,可能引发错误并导致进程意外退出。
2. PyTorch和torch_npu在运行异常时会退出进程并打印报错信息,属于正常现象。建议用户根据报错提示定位具体错误原因,包括设定算子同步执行、查看CANN日志、解析生成的Core Dump文件等方式。
## 公网地址声明
在torch_npu的配置文件和脚本中存在[公网地址](#公网地址)
##### 公网地址
| 类型 | 开源代码地址 | 文件名 | 公网IP地址/公网URL地址/域名/邮箱地址 | 用途说明 |
|-------------------------|-------------------------|-------------------------|-------------------------|-------------------------|
| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.huaweicloud.com/repository/pypi/simple | docker配置文件,用于配置pip源 |
| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://download.pytorch.org/whl/cpu | docker配置源,用于配置torch下载连接 |
| 自研 | 不涉及 | ci\docker\X86\Dockerfile | https://mirrors.aliyun.com/pypi/simple/ | docker配置文件,用于配置pip源 |
| 自研 | 不涉及 | setup.cfg | https://gitee.com/ascend/pytorch | 用于打包whl的url入参 |
| 自研 | 不涉及 | setup.cfg | https://gitee.com/ascend/pytorch/tags | 用于打包whl的download_url入参 |
| 自研 | 不涉及 | third_party\op-plugin\ci\build.sh | https://gitee.com/ascend/pytorch.git | 编译脚本根据torch_npu仓库地址拉取代码进行编译 |
| 自研 | 不涉及 | third_party\op-plugin\ci\exec_ut.sh | https://gitee.com/ascend/pytorch.git | UT脚本根据torch_npu仓库地址下拉取代码进行UT测试 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/main/test/nn/test_convolution.py <br> https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_mps.py <br> https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_conv2d.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/legacy_serialized.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/gpu_tensors.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_nn.py <br> https://github.com/pytorch/pytorch/blob/v2.1.0/test/test_serialization.py | test\url.ini | https://download.pytorch.org/test_data/linear.pt | 用于test脚本下载相关pt文件 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/torch/csrc/profiler/unwind/eh_frame_hdr.h | third_party\profiler\unwind\eh_frame_hdr.h | https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html | c++调用栈实现相关注解网址 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/torch/csrc/profiler/unwind/fde.h | third_party\profiler\unwind\fde.h | https://www.airs.com/blog/archives/460 | c++调用栈实现相关注解网址 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/torch/csrc/profiler/unwind/fde.h | third_party\profiler\unwind\fde.h | https://web.archive.org/web/20221129184704/https://dwarfstd.org/doc/DWARF4.doc | c++调用栈实现相关注解网址 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/torch/csrc/profiler/unwind/fde.h | third_party\profiler\unwind\fde.h | https://dl.acm.org/doi/pdf/10.1145/3360572 | c++调用栈实现相关注解网址 |
| 开源引入 | https://github.com/pytorch/pytorch/blob/v2.1.0/torch/csrc/profiler/unwind/fde.h | third_party\profiler\unwind\fde.h | https://github.com/mstange/framehop/ | c++调用栈实现相关注解网址 |
## 公开接口声明
Ascend Extension for PyTorch是PyTorch适配插件,支持用户使用PyTorch在昇腾设备上进行训练和推理。Ascend Extension for PyTorch适配后支持用户使用PyTorch原生接口。除了原生PyTorch接口外,Ascend Extension for PyTorch提供了部分自定义接口,包括自定义算子、亲和库和其他接口,支持PyTorch接口和自定义接口连接,具体可参考[《PyTorch API参考》](https://www.hiascend.com/document/detail/zh/Pytorch/60RC1/apiref/apilist/ptaoplist_000002.html)。
参考[PyTorch社区公开接口规范](https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation),Ascend Extension for PyTorch提供了对外的自定义接口。如果一个函数看起来符合公开接口的标准且在文档中有展示,则该接口是公开接口。否则,使用该功能前可以在社区询问该功能是否确实是公开的或意外暴露的接口,因为这些未暴露接口将来可能会被修改或者删除。
Ascend Extension for PyTorch项目采用C++和Python联合开发,当前除Libtorch场景外正式接口只提供Python接口,在torch_npu的二进制包中动态库不直接提供服务,暴露的接口为内部使用,不建议用户使用。
## 通信安全加固
PyTorch分布式训练服务需要在设备间进行通信,通信开启的端口默认为全0侦听,为了降低安全风险,建议用户针对此场景进行安全加固,如使用iptables配置防火墙,在运行分布式训练开始前限制外部对分布式训练使用端口的访问,在运行分布式训练结束后清理防火墙规则。
1. 防火墙规则设定和移除参考脚本模板
- 防火墙规则设定,可参考如下脚本:
```
#!/bin/bash
set -x
# 要限制的端口号
port={端口号}
# 清除旧规则
iptables -D INPUT -p tcp -j {规则名}
iptables -F {规则名}
iptables -X {规则名}
# 创建新的规则链
iptables -t filter -N {规则名}
# 在多机场景下设定白名单,允许其他节点访问主节点的侦听端口
# 在规则链中添加允许特定IP地址范围的规则
iptables -t filter -A {规则名} -i eno1 -p tcp --dport $port -s {允许外部访问的IP} -j ACCEPT
# 屏蔽外部地址访问分布式训练端口
# 在PORT-LIMIT-RULE规则链中添加拒绝其他IP地址的规则
iptables -t filter -A {规则名} -i {要限制的网卡名} -p tcp --dport $port -j DROP
# 将流量传递给规则链
iptables -I INPUT -p tcp -j {规则名}
```
- 防火墙规则移除,可参考如下脚本:
```
#!/bin/bash
set -x
# 清除规则
iptables -D INPUT -p tcp -j {规则名}
iptables -F {规则名}
iptables -X {规则名}
```
2. 防火墙规则设定和移除参考脚本示例
1. 针对特定端口设定防火墙,脚本中端口号为要限制的端口,在PyTorch分布式训练中端口号请参考[通信矩阵信息](#通信矩阵信息);要限制的网卡名为服务器用于分布式通信使用的网卡,允许的外部访问的IP为分布式训练服务器的IP地址。网卡和服务器IP可以通过ifconfig查看,如下文回显的eth0为网卡名,192.168.1.1为服务器IP地址:
```
# ifconfig
eth0
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::230:64ee:ef1a:c1a/64 Scope:Link
```
2. 假定服务器主节点地址192.168.1.1,另一台需要进行分布式训练的服务器为192.168.1.2,训练端口为29510。
- 防火墙规则设定,可参考如下脚本:
```
#!/bin/bash
set -x
# 设定侦听的端口
port=29510
# 清除旧规则
iptables -D INPUT -p tcp -j PORT-LIMIT-RULE
iptables -F PORT-LIMIT-RULE
iptables -X PORT-LIMIT-RULE
# 创建新的PORT-LIMIT-RULE规则链
iptables -t filter -N PORT-LIMIT-RULE
# 在多机场景下设定白名单,允许192.168.1.2访问主节点
# 在PORT-LIMIT-RULE规则链中添加允许特定IP地址范围的规则
iptables -t filter -A PORT-LIMIT-RULE -i eno1 -p tcp --dport $port -s 192.168.1.2 -j ACCEPT
# 屏蔽外部地址访问分布式训练端口
# 在PORT-LIMIT-RULE规则链中添加拒绝其他IP地址的规则
iptables -t filter -A PORT-LIMIT-RULE -i eth0 -p tcp --dport $port -j DROP
# 将流量传递给PORT-LIMIT-RULE规则链
iptables -I INPUT -p tcp -j PORT-LIMIT-RULE
```
- 防火墙规则移除,可参考如下脚本:
```
#!/bin/bash
set -x
# 清除规则
iptables -D INPUT -p tcp -j PORT-LIMIT-RULE
iptables -F PORT-LIMIT-RULE
iptables -X PORT-LIMIT-RULE
```
## 通信矩阵
PyTorch提供分布式训练能力,支持在单机和多机场景下进行训练,需要进行网络通信。其中PyTorch需要使用TCP进行通信,torch_npu使用CANN中HCCL在NPU设备间通信,通信端口见[通信矩阵信息](#通信矩阵信息)。用户需要注意并保障节点间通信网络安全,可以使用iptables等方式消减安全风险,可参考[通信安全加固](#通信安全加固)进行网络安全加固。
##### 通信矩阵信息
| 组件 | PyTorch | HCCL |
| --------------------- | ------------------------------------ | ------------------------------------ |
| 源设备 | 运行torch_npu进程的服务器 | 运行torch_npu进程的服务器 |
| 源IP | 设备地址IP | 设备地址IP |
| 源端口 | 操作系统自动分配,分配范围由操作系统的自身配置决定 | 默认值为60000,取值范围[1024,65520]。用户可以通过HCCL_IF_BASE_PORT环境变量指定Host网卡起始端口号,配置后系统默认占用以该端口起始的16个端口 |
| 目的设备 | 运行torch_npu进程的服务器 | 运行torch_npu进程的服务器 |
| 目的IP | 设备地址IP | 设备地址IP |
| 目的端口 (侦听) | 默认29500/29400,用户可以设定端口号 | 默认值为60000,取值范围[1024,65520]。用户可以通过HCCL_IF_BASE_PORT环境变量指定Host网卡起始端口号,配置后系统默认占用以该端口起始的16个端口 |
| 协议 | TCP | TCP |
| 端口说明 | 1. 在静态分布式场景中(用torchrun/torch.distributed.launch使用的backend为static), 目的端口(默认29500)用于接收和发送数据,源端口用于接收和发送数据 <br> 2. 在动态分布式场景中(用torchrun或者torch.distributed.launch使用的backend为c10d), 目的端口(默认29400)用于接收和发送数据,源端口用于接收和发送数据。可以使用rdzv_endpoint和master_port指定端口号 <br> 3. 在分布式场景中,用torchrun或者torch.distributed.launch不指定任何参数时使用的端口号为29500 | 默认值为60000,取值范围[1024,65520]。用户可以通过HCCL_IF_BASE_PORT环境变量指定Host网卡起始端口号,配置后系统默认占用以该端口起始的16个端口 |
| 侦听端口是否可更改 | 是 | 是 |
| 认证方式 | 无认证方式 | 无认证方式 |
| 加密方式 | 无 | 无 |
| 所属平面 | 不涉及 | 不涉及 |
| 版本 | 所有版本 | 所有版本 |
| 特殊场景 | 无 | 无 |
| 备注 | 该通信过程由开源软件PyTorch控制,配置为PyTorch原生设置,可参考[PyTorch文档](https://pytorch.org/docs/stable/distributed.html#launch-utility)。源端口由操作系统自动分配,分配范围由操作系统的配置决定,例如ubuntu:采用/proc/sys/net/ipv4/ipv4_local_port_range文件指定,可通过cat /proc/sys/net/ipv4/ipv4_local_port_range或sysctl net.ipv4.ip_local_port_range查看 | 该通信过程由CANN中HCCL组件控制,torch_npu不进行控制,端口范围可参考[《环境变量参考》](https://www.hiascend.com/document/detail/zh/canncommercial/80RC1/apiref/envvar/envref_07_0001.html)的“执行相关 > 集合通信与分布式训练 > 集合通信相关配置>HCCL_IF_BASE_PORT” |
+122 -578
View File
@@ -5,589 +5,133 @@ Please note we provide an open source software notice along with this product an
Warranty Disclaimer
THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
Copyright Notice and License Texts
Software: pytorch v2.0.0
Copyright Notice and License Texts
Software: pytorch v2.1.0
Copyright notice:
(C) Copyright John Maddock 2006.
Copyright (c) 2017-2018 Advanced Micro Devices, Inc.
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
Copyright (C) 2000-2017 Julian Seward.
Copyright (C) 2001-2019 Free Software Foundation, Inc.
Copyright (C) 2003-2017 Josef Weidendorfer.
Copyright (C) 2006 The Android Open Source Project
Copyright (C) 2007-2017 Free Software Foundation, Inc.
Copyright (C) 2011 - 2012 Andrzej Krzemienski.
Copyright (C) 2012 Giovanni Garberoglio Interdisciplinary Laboratory for Computational Science (LISC)
Copyright (C) 2017 The Android Open Source Project
Copyright (C) 2018 Marat Dukhan
Copyright (C) Björn Fahller
Copyright (c) 1994 Hewlett-Packard Company
Copyright (c) 1996-1998 Silicon Graphics Computer Systems, Inc.
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation; All Rights Reserved
Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers.
Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
Copyright (c) 2005-2010 ActiveState Software Inc.
Copyright (c) 2005-2017, NumPy Developers.
Copyright (c) 2005-2022 NVIDIA Corporation Built on ThuFeb1018:23:41PST2022 Cuda compilation tools, release 11.6, V11.6.112
Copyright (c) 2006 Idiap Research Institute (Samy Bengio)
Copyright (c) 2006, Laurent Montel, <montel@kde.org>
Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
Copyright (c) 2007-2009 Scientific Computing and Imaging Institute, University of Utah
Copyright (c) 2008 - 2009 NVIDIA Corporation.
Copyright (c) 2008 - 2012 The Khronos Group Inc.
Copyright (c) 2008-2012 The Khronos Group Inc.
Copyright (c) 2008-2013 The Khronos Group Inc.
Copyright (c) 2008-2015 The Khronos Group Inc.
Copyright (c) 2010 ActiveState Software Inc.
Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
Copyright (c) 2011-2013 NYU (Clement Farabet)
Copyright (c) 2011-2013 NYU (Clement Farabet)
Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
Copyright (c) 2011-2019 Stephan Brumme.
Copyright (c) 2011-2021, NVIDIA CORPORATION.
Copyright (c) 2012 Massachusetts Institute of Technology
Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
Copyright (c) 2013 Eddy Petrișor
Copyright (c) 2014 Indiana University
Copyright (c) 2014 Matthew Rocklin
Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
Copyright (c) 2014, 2015, the respective contributors
Copyright (c) 2014, The Regents of the University of California (Regents)
Copyright (c) 2014, the respective contributors
Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
Copyright (c) 2014-2015 The Khronos Group Inc.
Copyright (c) 2014-2017 The Regents of the University of California (Regents)
Copyright (c) 2014-2017, the respective contributors
Copyright (c) 2015 Google Inc.
Copyright (c) 2015 Melissa E. O'Neill
Copyright (c) 2015 Yangqing Jia
Copyright (c) 2015-2016 Advanced Micro Devices, Inc.
Copyright (c) 2015-2017 The Khronos Group Inc.
Copyright (c) 2016 Facebook Inc.
Copyright (c) 2016 Microsoft Licensed under The MIT License [see r-fcnLICENSE for details]
Copyright (c) 2016, NVIDIA CORPORATION, All rights reserved
Copyright (c) 2016, NVIDIA CORPORATION, All rights reserved Distributed under 2-clause BSD license; see accompanying LICENSE file
Copyright (c) 2016- Facebook, Inc (Adam Paszke)
Copyright (c) 2016-2017, ARM Limited and Contributors
Copyright (c) 2016-present, Facebook Inc.
Copyright (c) 2016-present, Facebook, Inc.
Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES. SPDX-License-Identifier: BSD-3-Clause
Copyright (c) 2017 Georgia Institute of Technology
Copyright (c) 2017 Microsoft Licensed under The Apache-2.0 License [see LICENSE for details]
Copyright (c) 2017 by Contributors \file dlpack.h \brief The common header of DLPack.
Copyright (c) 2017-2018 Facebook Inc.
Copyright (c) 2017-present, Facebook, Inc.
Copyright (c) 2018 MathInf GmbH, Thomas Viehmann Licensed under the BSD-3-Clause license This is the CPU implementation of the Connectionist Temporal Loss.
Copyright (c) 2018 MathInf GmbH, Thomas Viehmann Licensed under the BSD-3-Clause license This is the GPU implementation of the Connectionist Temporal Loss.
Copyright (c) 2018, Steven Moshier
Copyright (c) 2018-present, Facebook, Inc.
Copyright (c) 2019 NumPy Developers
Copyright (c) 2022 Cruise LLC.
Copyright (c) 2022, Tri Dao.
Copyright (c) Edward Z. Yang <ezyang@mit.edu>
Copyright (c) Facebook Inc. and Microsoft Corporation.
Copyright (c) Facebook, Inc. and its affiliates.
Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
Copyright (c) Meta Platforms, Inc. and affiliates
Copyright (c) Meta Platforms, Inc. and affiliates Owner(s): ["oncall: distributed"]
Copyright (c) Meta Platforms, Inc. and affiliates flake8: noqa
Copyright (c) Meta Platforms, Inc. and affiliates from .matrixops import noqa: F403
Copyright (c) Meta Platforms, Inc. and affiliates from abc import ABC, abstractmethod from typing import Optional, Union
Copyright (c) Meta Platforms, Inc. and affiliates from dataclasses import dataclass from typing import Callable, cast, Dict, Iterable, Optional, Sequence, Set, Tuple, Union
Copyright (c) Meta Platforms, Inc. and affiliates from torch.distributed.tensor.parallel.api import parallelizemodule from torch.distributed.tensor.parallel.multiheadattentiontp import (
Copyright (c) Meta Platforms, Inc. and affiliates from typing import Callable, cast, Dict, Tuple, Union, Optional
Copyright (c) Meta Platforms, Inc. and affiliates from typing import Callable, cast, Optional, Sequence
Copyright (c) Meta Platforms, Inc. and affiliates from typing import Dict, Tuple
Copyright (c) Meta Platforms, Inc. and affiliates from typing import Dict, Union
Copyright (c) Meta Platforms, Inc. and affiliates from typing import Tuple, Union
Copyright (c) Meta Platforms, Inc. and affiliates from typing import cast
Copyright (c) Meta Platforms, Inc. and affiliates from typing import cast, Dict, List, Optional, Sequence, Tuple
Copyright (c) Meta Platforms, Inc. and affiliates from typing import cast, Dict, List, Sequence, Tuple
Copyright (c) Meta Platforms, Inc. and affiliates from typing import cast, List, Optional, Sequence, Tuple
Copyright (c) Meta Platforms, Inc. and affiliates from typing import cast, Optional, Sequence
Copyright (c) Meta Platforms, Inc. and affiliates implement matrix related ops for distributed tensor
Copyright (c) Meta Platforms, Inc. and affiliates import copy import warnings from typing import Callable, cast, Dict, Optional, Sequence
Copyright (c) Meta Platforms, Inc. and affiliates import dataclasses import logging from typing import Dict, List
Copyright (c) Meta Platforms, Inc. and affiliates import functools import operator from typing import Iterable, List, Sequence, Union
Copyright (c) Meta Platforms, Inc. and affiliates import os import warnings from typing import List, Optional, Sequence, TypeVar, Union
Copyright (c) Meta Platforms, Inc. and affiliates import torch
Copyright (c) Meta Platforms, Inc. and affiliates pyre-ignore-all-errors[6]
Copyright (c) Meta Platforms, Inc. and affiliates.
Copyright (c) Meta Platforms, Inc. and its affiliates.
Copyright 2004-present Facebook. All Rights Reserved.
Copyright 2005 Robert Kern (robert.kern@gmail.com)
Copyright 2005, Google Inc.
Copyright 2006, Google Inc.
Copyright 2008 Google Inc.
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC All Rights Reserved.
Copyright 2013 Conrad Steenberg <conrad.steenberg@gmail.com>
Copyright 2013-2014 RAD Game Tools and Valve Software
Copyright 2015 Google Inc. All Rights Reserved.
Copyright 2015 The Gemmlowp Authors. All Rights Reserved.
Copyright 2016 Facebook @author Tudor Bosman (tudorb@fb.com)
Copyright 2016 Martin Raiber All Rights Reserved.
Copyright 2019 Kakao Brain
Copyright 2019-2020 Kakao Brain
Copyright 2022 Cruise LLC import logging import warnings from collections import OrderedDict from typing import Union, Iterable, Dict
Copyright Malte Skarupke 2017.
Copyright Michael Park, 2015-2017
Copyright © 1995-2011 by Fredrik Lundh
Copyright © 1997-2011 by Secret Labs AB
Copyright © 2001-2014 Python Software Foundation; All Rights Reserved
Copyright © 2005-2020 Rich Felker, et al.
Copyright © 2010-2022 by Alex Clark and contributors
Copyright © 2022 Apple Inc.
Copyright © 2023 Apple Inc.
Copyright(c) 2013, 2014, 2015, the respective contributors
Copyright(c) 2015, 2016 the respective contributors
Copyright (c) 2016- Facebook, Inc
Copyright (c) 2014- Facebook, Inc
Copyright (c) 2011-2014 Idiap Research Institute
Copyright (c) 2012-2014 Deepmind Technologies
Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)
Copyright (c) 2011-2013 NYU
Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)
Copyright (c) 2006 Idiap Research Institute
Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)
Copyright (c) 2016-present, Facebook Inc.
Copyright (c) 2016 Facebook Inc.
Copyright (c) 2015 Google Inc.
Copyright (c) 2015 Yangqing Jia
Copyright 2019-2020 Kakao Brain
Copyright (c) 2022 Cruise LLC.
Copyright (c) 2013, 2014, 2015, the respective contributors
Copyright (c) 2015, 2016 the respective contributors
Copyright (c) 2014, The Regents of the University of California (Regents)
Copyright (c) 2014, the respective contributors
Copyright (c) 2018, Steven Moshier
Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers
Copyright (c) 1997-2011 by Secret Labs AB
Copyright (c) 1995-2011 by Fredrik Lundh
Copyright (c) 2010-2022 by Alex Clark and contributors
Copyright (c) 2006 The Android Open Source Project
Copyright (c) Facebook, Inc. and its affiliates
Copyright (c) Meta Platforms, Inc. and affiliates
Copyright 2004-present Facebook
Copyright (c) 2017 by Contributors
Copyright (c) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura
Copyright (c) 2022 Apple Inc.
Copyright (c) 2023 Apple Inc.
Copyright 2005 Robert Kern (robert.kern@gmail.com)
copyright 2019 The TensorFlow Authors
Copyright (c) 2018 MathInf GmbH, Thomas Viehmann
Copyright (c) 2014 Indiana University (c)
Copyright John Maddock 2006
Copyright (c) 2012 Massachusetts Institute of Technology
Copyright (c) 2012 Giovanni Garberoglio Interdisciplinary Laboratory for Computational Science (LISC) Fondazione Bruno Kessler and University of Trento
Copyright (c) 2018 Marat Dukhan
Copyright (c) 2017-2018 Facebook Inc.
Copyright (c) 2017 Georgia Institute of Technology
Copyright 2015 Google Inc.
Copyright (c) 2011-2021, NVIDIA CORPORATION.
Copyright (c) 2022, Tri Dao
Copyright (c) 2017 - 2023 NVIDIA CORPORATION & AFFILIATES.
Copyright (c) 2017 - 2022 NVIDIA CORPORATION & AFFILIATES.
Copyright (c) 2017 The Android Open Source Project
Copyright (c) 2016-present, Facebook, Inc.
Copyright (c) 2005-2020 Rich Felker
Copyright Malte Skarupke 2017
Copyright 2008 Google Inc.
Copyright (c) 2011 - 2012 Andrzej Krzemienski
Copyright (c) 2001-2019 Free Software Foundation, Inc.
Copyright (c) 1994 Hewlett-Packard Company
Copyright (c) 1996-1998 Silicon Graphics Computer Systems, Inc.
Copyright (c) Bjorn Fahller
Copyright Michael Park, 2015-2017
Copyright (c) 2017-present, Facebook, Inc.
Copyright (c) 2018-present, Facebook, Inc.
Copyright (c) 2008-2015 The Khronos Group Inc.
Copyright 2016 Facebook
Copyright (c) 2016, NVIDIA CORPORATION
Copyright (c) 2008 - 2012 The Khronos Group Inc.
Copyright (c) 2008-2013 The Khronos Group Inc.
Copyright (c) 2008-2012 The Khronos Group Inc.
Copyright (c) 2016-2017, ARM Limited and Contributors
Copyright (c) 2014-2015 The Khronos Group Inc.
Copyright (c) 2015-2017 The Khronos Group Inc.
Copyright (c) Facebook Inc. and Microsoft Corporation
Copyright (c) 2014-2017 The Regents of the University of California (Regents)
Copyright (c) 2014-2017, the respective contributors
Copyright (c) 2017 Microsoft
Copyright 2015 The Gemmlowp Authors
Copyright (c) 2011-2019 Stephan Brumme
Copyright 2006, Google Inc.
Copyright (c) Meta Platforms, Inc. and its affiliates
Copyright (c) 2008 - 2009 NVIDIA Corporation
Copyright (c) 2007-2009 Scientific Computing and Imaging Institute, University of Utah
Copyright (c) 2006, Laurent Montel, montel@kde.org
Copyright 2013 Conrad Steenberg conrad.steenberg@gmail.com
copyright 2022, PyTorch
copyright 2023, PyTorch
Copyright (c) 2005-2022 NVIDIA Corporation Built
copyright PyTorch Contributors
Copyright (c) 2018 Alex Rogozhnikov
Copyright (c) 2016 Microsoft
Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
Copyright (c) 2014, 2015, the respective contributors
Copyright (c) 2005-2017, NumPy Developers (c) Parameter containing Float
Copyright 2005, Google Inc.
Copyright 2019 Kakao Brain
Copyright 2013-2014 RAD Game
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
Copyright 2016 Martin Raiber
Copyright (c) 2003-2017 Josef Weidendorfer
Copyright (c) 2000-2017 Julian Seward
Copyright (c) Edward Z. Yang ezyang@mit.edu
Copyright (c) 2005-2010 ActiveState Software Inc.
Copyright (c) 2013 Eddy Petrisor
Copyright (c) 2010 ActiveState Software Inc.
Copyright (c) 2001-2014 Python Software Foundation
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation
Copyright Python Software Foundation
Copyright 2022 Cruise LLC
Copyright (c) 2014 Matthew Rocklin
Copyright (c) 2015 Melissa E. O'Neill
Copyright (c) 2019 NumPy Developers
Copyright (c) 2015-2016 Advanced Micro Devices, Inc.
Copyright 2013 Mark Dickinson
License: BSD 2-Clause License
BSD Two Clause License
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: Apache License V2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
License: LGPL V2.1
GNU Lesser General Public License
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
License: GPL V3.0
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
•a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
•b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
•c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
•d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
•a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
•b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
•c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
•d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
•e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
•a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
•b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
•c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
•d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
•e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
•f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
License: BSD 3-Clause License
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: MIT License
The MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License: Boost Software License V1.0
1 Boost Software License - Version 1.0
2 August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Copyright (c) , <YEAR>,<OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Written Offer
This product contains software whose rights holders license it on the terms of the GNU General Public License, version 2 (GPLv2) and/or other open source software licenses. We will provide you and any third party with the source code of the software licensed under an open source software license if you send us a written request by mail or email to the following addresses:
This product contains software whose rights holders license it on the terms of the GNU General Public License, version 2 (GPLv2) and/or other open source software licenses. We will provide you and any third party with the source code of the software licensed under an open source software license if you send us a written request by mail or email to the following addresses:
foss@huawei.com
detailing the name of the product and the firmware version for which you need the source code and indicating how we can contact you.
+12
View File
@@ -122,6 +122,16 @@ def check_gtest_valid(base_dir):
return os.path.exists(gtest_path)
def generate_dbg_files_and_strip():
library_dir = Path(BASE_DIR).joinpath("build/packages/torch_npu")
dbg_dir = Path(BASE_DIR).joinpath("build/dbg_libtorch")
os.makedirs(dbg_dir, exist_ok=True)
library_files = [Path(i) for i in library_dir.rglob('*.so')]
for library_file in library_files:
subprocess.check_call(["eu-strip", library_file, "-f",
str(dbg_dir.joinpath(library_file.name)) + ".debug"], cwd=BASE_DIR) # Compliant
def run_cmake():
cmake = get_cmake_command()
@@ -159,6 +169,8 @@ def run_cmake():
subprocess.check_call([cmake, BASE_DIR] + cmake_args, cwd=build_type_dir, env=os.environ)
subprocess.check_call(['make'] + build_args, cwd=build_type_dir, env=os.environ)
if which('eu-strip') is not None:
generate_dbg_files_and_strip()
def check_opplugin_valid(base_dir):
+103 -23
View File
@@ -6,14 +6,27 @@ import sys
import subprocess
import threading
import queue
import argparse
from abc import ABCMeta, abstractmethod
from pathlib import Path
import psutil
from torch_npu.utils.path_manager import PathManager
BASE_DIR = Path(__file__).absolute().parent.parent
TEST_DIR = BASE_DIR / 'test'
# Add slow test cases here (first element must be test_ops)
SLOW_TEST_BLOCKLIST = [
'test_ops',
'test_modules',
'test_binary_ufuncs',
'test_ops_fwd_gradients',
'test_ops_gradients',
'test_reductions',
'test_unary_ufuncs'
]
class AccurateTest(metaclass=ABCMeta):
@abstractmethod
@@ -76,7 +89,7 @@ class CoreTestStrategy(AccurateTest):
Determine whether the core tests should be runned
"""
block_list = ['test', 'docs']
core_test_cases = [str(i) for i in (BASE_DIR / 'test/test_npu').rglob('test_*.py')]
core_test_cases = [str(i) for i in (BASE_DIR / 'test/npu').rglob('test_*.py')]
def identify(self, modify_file):
modified_module = str(Path(modify_file).parts[0])
@@ -102,25 +115,39 @@ class DirectoryMappingStrategy(AccurateTest):
Map the modified files to the corresponding test cases
"""
mapping_list = {
'contrib': 'test/test_contrib',
'cpp_extension': 'test/test_cpp_extension',
'distributed': 'test/test_distributed',
'fx': 'test/test_fx',
'hooks': 'test/test_hooks',
'optim': 'test/test_optim',
'profiler': 'test/test_profiler',
'onnx': 'test/test_onnx',
'utils': 'test/test_utils',
'contrib': 'test/contrib',
'cpp_extension': 'test/cpp_extensions',
'distributed': 'test/distributed',
'fx': 'test/test_fx.py',
'optim': 'test/optim',
'profiler': 'test/profiler',
'onnx': 'test/onnx',
'utils': 'test/test_utils.py',
'testing': 'test/test_testing.py',
'jit': 'test/jit',
'rpc': 'test/distributed/rpc',
'dynamo': 'test/dynamo',
'checkpoint': 'test/distributed/checkpoint',
}
def get_module_name(self, modify_file):
module_name = str(Path(modify_file).parts[1])
if module_name == 'csrc':
module_name = str(Path(modify_file).parts[2])
for part in Path(modify_file).parts:
if part == 'rpc' or part == 'checkpoint':
module_name = part
if module_name == 'utils' and Path(modify_file).parts[2] == 'cpp_extension.py':
module_name = 'cpp_extension'
if module_name == 'utils' and 'dynamo' in Path(modify_file).parts[2]:
module_name = 'dynamo'
return module_name
def identify(self, modify_file):
current_all_ut_path = []
if str(Path(modify_file).parts[0]) == 'torch_npu':
mapped_ut_path = []
module_name = str(Path(modify_file).parts[1])
if module_name == 'csrc':
module_name = str(Path(modify_file).parts[2])
module_name = self.get_module_name(modify_file)
if module_name in self.mapping_list:
mapped_ut_path.append(self.mapping_list[module_name])
file_name = str(Path(modify_file).stem)
@@ -131,11 +158,11 @@ class DirectoryMappingStrategy(AccurateTest):
if Path.is_file(BASE_DIR / mapped_path):
current_all_ut_path.append(str(BASE_DIR / mapped_path))
else:
current_all_ut_path += [str(i) for i in (BASE_DIR / mapped_path).rglob('test_*.py')]
current_all_ut_path += [str(i) for i in (BASE_DIR / mapped_path).glob('test_*.py')]
return current_all_ut_path
class TestMgr():
class TestMgr:
def __init__(self):
self.modify_files = []
self.test_files = {
@@ -166,6 +193,34 @@ class TestMgr():
if Path(changed_file).exists()
]
self.test_files['ut_files'] = exist_ut_file
self.exclude_test_files(SLOW_TEST_BLOCKLIST)
def load_core_ut(self):
self.test_files['ut_files'] += [str(i) for i in (BASE_DIR / 'test/npu').rglob('test_*.py')]
def load_distributed_ut(self):
self.test_files['ut_files'] += [str(i) for i in (BASE_DIR / 'test/distributed').rglob('test_*.py')]
def load_ut_in_parallel(self, rank, world_size):
if rank > world_size:
raise Exception(f'rank {rank} is greater than world_size {world_size}')
all_files = [str(i) for i in (BASE_DIR / 'test').rglob('test_*.py')
if 'distributed' not in str(i) and 'test_ops.py' not in str(i)]
begin = (rank - 1) * len(all_files) // world_size
end = rank * len(all_files) // world_size
self.test_files['ut_files'] = all_files[begin:end]
def exclude_test_files(self, block_list):
def remove_test_files(key):
for test_name in block_list:
test_files_copy = self.test_files[key][:]
for test_file in test_files_copy:
if test_name in test_file:
print(f'Excluding slow test: {test_name}')
self.test_files[key].remove(test_file)
for test_files_key in self.test_files.keys():
remove_test_files(test_files_key)
def get_test_files(self):
return self.test_files
@@ -191,16 +246,18 @@ def exec_ut(files):
执行单元测试文件,其中存在失败,则标识异常并打印相关信息
"""
def get_op_name(ut_file):
return ut_file.split('/')[-1].split('.')[0].lstrip('test_')
op_name = str(ut_file.split('/')[-1].split('.')[0])
return op_name[5:] if op_name.startswith("test_") else op_name
def get_ut_name(ut_file):
return str(Path(ut_file).relative_to(TEST_DIR))[:-3]
def get_ut_cmd(ut_type, ut_file):
cmd = [sys.executable, "run_test.py", "-v", "-i"]
cmd = [sys.executable, "run_test.py", "-v"]
if ut_type == "op_ut_files":
return cmd + ["test_ops", "--", "-k", get_op_name(ut_file)]
return cmd + [get_ut_name(ut_file)]
# do not skip ops related test entries
return cmd + ["-e"] + SLOW_TEST_BLOCKLIST[1:] + ["-i", "test_ops", "--", "-k", "_" + get_op_name(ut_file)]
return cmd + ["-i", get_ut_name(ut_file)]
def wait_thread(process, event_timer):
process.wait()
@@ -218,7 +275,7 @@ def exec_ut(files):
stdout_t.start()
def print_subprocess_log(log_queue):
while (not log_queue.empty()):
while not log_queue.empty():
print((log_queue.get()).strip())
def run_cmd_with_timeout(cmd):
@@ -237,6 +294,9 @@ def exec_ut(files):
print_subprocess_log(stdout_queue)
if not event_timer.is_set():
ret = 1
parent_process = psutil.Process(p.pid)
for children_process in parent_process.children(recursive=True):
children_process.kill()
p.kill()
p.terminate()
print("Timeout: Command '{}' timed out after 2000 seconds".format(" ".join(cmd)))
@@ -252,7 +312,9 @@ def exec_ut(files):
for ut_type, ut_files in files.items():
for ut_file in ut_files:
cmd = get_ut_cmd(ut_type, ut_file)
ut_info = " ".join(cmd[4:]).replace(" -- -k", "")
ut_info = str(cmd[-1])
if ut_type == "op_ut_files":
ut_info = "test_ops " + ut_info
ret = run_cmd_with_timeout(cmd)
if ret:
has_failed = ret
@@ -270,10 +332,28 @@ def exec_ut(files):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Control needed ut cases')
parser.add_argument(
'--only_distributed', action="store_true", help='Only run distributed cases')
parser.add_argument(
'--rank', default=0, type=int, help='Index of current ut nodes')
parser.add_argument(
'--world_size', default=0, type=int, help='Number of ut nodes')
options = parser.parse_args()
cur_modify_files = str(BASE_DIR / 'modify_files.txt')
test_mgr = TestMgr()
test_mgr.load(cur_modify_files)
test_mgr.analyze()
if options.only_distributed:
test_mgr.load_distributed_ut()
else:
if options.rank > 0 and options.world_size > 0:
test_mgr.load_ut_in_parallel(options.rank, options.world_size)
else:
if os.path.exists(cur_modify_files):
test_mgr.load(cur_modify_files)
test_mgr.analyze()
else:
test_mgr.load_core_ut()
cur_test_files = test_mgr.get_test_files()
test_mgr.print_modify_files()
+1 -5
View File
@@ -6,6 +6,7 @@ CUR_DIR=$(dirname $(readlink -f $0))
SUPPORTED_PY_VERSION=(3.8 3.9 3.10)
PY_VERSION='3.8' # Default supported python version is 3.8
DEFAULT_SCRIPT_ARGS_NUM=1 # Default supported input parameters
export DISABLE_RPC_FRAMEWORK=FALSE
# Parse arguments inside script
function parse_script_args() {
@@ -40,11 +41,6 @@ function parse_script_args() {
args_num=$((args_num-1))
shift
;;
--tocpu=*)
export 'NPU_TOCPU'=${1:8}
args_num=$((args_num-1))
shift
;;
--disable_torchair)
export DISABLE_INSTALL_TORCHAIR=TRUE
shift
+3 -2
View File
@@ -1,5 +1,6 @@
#!/bin/bash
py_execute=${1-python3}
CUR_DIR=$(dirname $(readlink -f $0))
cd ${CUR_DIR}/../examples/libtorch_resnet
@@ -8,7 +9,7 @@ if [ -f ./resnet_model.pt ]; then
rm ./resnet_model.pt
fi
python3 resnet_trace.py
$py_execute resnet_trace.py
if [ $? != 0 ]; then
echo "Failed to trace resnet model."
@@ -20,7 +21,7 @@ if [ -d "build" ]; then
fi
mkdir build && cd build && \
cmake -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` .. && \
cmake -DCMAKE_PREFIX_PATH=`$py_execute -c 'import torch;print(torch.utils.cmake_prefix_path)'` .. && \
make && ./libtorch_resnet ../resnet_model.pt > out.log
if grep -q "resnet_model run success!" out.log; then
+4
View File
@@ -29,6 +29,7 @@ from .gen_variable_type import (
gen_variable_type, gen_variable_type_head
)
from .gen_variable_factories import gen_variable_factories
from .gen_autograd_functions import gen_autograd_functions_python
from .utils import parse_derivatives, filt_npu_autograd_functions
@@ -61,6 +62,9 @@ def gen_autograd(
# Generate variable_factories.h
gen_variable_factories(out, torch_template_path, native_funcs)
# Generate python_functions.h/cpp
gen_autograd_functions_python(out, differentiability_infos, template_path)
def main() -> None:
parser = argparse.ArgumentParser(
@@ -0,0 +1,63 @@
# Generates C++ autograd functions for the derivatives of ATen operations
#
# This writes two files:
# python_functions.h/cpp: Python bindings for subclasses of autograd::Node
from typing import Dict
from torchgen.api.autograd import DifferentiabilityInfo
from torchgen.model import FunctionSchema
from torchgen.utils import FileManager
from torchgen.gen import FileManager
from torchgen.packaged.autograd.gen_autograd_functions import (
process_function,
get_infos_with_derivatives_list,
PY_FUNCTION_DEFINITION,
PY_FUNCTION_PROPS_AND_GETTERS
)
def gen_autograd_functions_python(
out: str,
differentiability_infos: Dict[FunctionSchema, Dict[str, DifferentiabilityInfo]],
template_path: str,
) -> None:
fm = FileManager(install_dir=out, template_dir=template_path, dry_run=False)
num_shards = 2
fm.write(
"python_functions.h",
lambda: {
"generated_comment":
f"@ generated from {fm.template_dir_for_comments()}/python_functions.h",
"shard_forward_declare": [
f"void initialize_autogenerated_functions_{i}(PyObject* module);"
for i in range(num_shards)
],
"shard_call": [
f"initialize_autogenerated_functions_{i}(module);"
for i in range(num_shards)
],
},
)
# get a 1D list of diffinfos, we do not need them to be per FunctionSchema/DispatchKey here
# infos with the diff dispatchkeys but the same name will still be in the same shard.
infos = get_infos_with_derivatives_list(differentiability_infos)
fm.write_sharded(
"python_functions.cpp",
infos,
key_fn=lambda info: info.name,
base_env={
"generated_comment":
f"@ generated from {fm.template_dir_for_comments()}/python_functions.cpp",
},
env_callable=lambda info: {
"py_function_initializers": [
process_function(info, PY_FUNCTION_DEFINITION)
],
"py_function_props_and_getters": [
process_function(info, PY_FUNCTION_PROPS_AND_GETTERS)
],
},
num_shards=num_shards,
sharded_keys={"py_function_initializers", "py_function_props_and_getters"},
)
@@ -0,0 +1,46 @@
#ifndef BUILD_LIBTORCH
#include <torch/csrc/autograd/generated/python_functions.h>
// ${generated_comment}
#include <Python.h>
#include <ATen/ATen.h>
#include <c10/core/SymNodeImpl.h>
#include <torch/csrc/autograd/generated/Functions.h>
#include <torch/csrc/autograd/python_cpp_function.h>
#include <torch/csrc/autograd/python_variable.h>
#include <torch/csrc/autograd/saved_variable.h>
#include <torch/csrc/utils/pybind.h>
#include <pybind11/pybind11.h>
#include <torch/csrc/utils/pybind.h>
#include "torch_npu/csrc/aten/Functions.h"
// NOTE: See [Sharded File] comment in VariableType
namespace at_npu {
namespace autograd {
namespace generated {
template <typename C>
static void addClass(PyObject *module, PyTypeObject &type, const char *name,
PyGetSetDef *function_properties = NULL,
PyMethodDef *function_methods = NULL)
{
_initFunctionPyTypeObject(type, name, function_properties, function_methods);
Py_INCREF(&type);
PyModule_AddObject(module, name, (PyObject *)&type);
registerCppFunction(typeid(C), &type);
}
${py_function_props_and_getters}
void initialize_autogenerated_functions${shard_id}(PyObject *module)
{
${py_function_initializers}
}
}
}
} // namespace at_npu::autograd::generated
#endif
@@ -0,0 +1,24 @@
#ifndef BUILD_LIBTORCH
#pragma once
#include <Python.h>
// ${generated_comment}
// Python bindings for automatically generated autograd functions
namespace at_npu {
namespace autograd {
namespace generated {
${shard_forward_declare}
inline void initialize_autogenerated_functions(PyObject *module)
{
${shard_call}
}
}
}
} // namespace at_npu::autograd::generated
#endif
+15 -2
View File
@@ -1,13 +1,26 @@
"""
This file is mainly used to transform failed test names into DecorateInfo Object.
"""
from pathlib import Path
import os
import yaml
from torchgen.code_template import CodeTemplate
from torchgen.gen import FileManager
unsupported_dict_path = os.path.realpath(os.path.join("test", "unsupported_ops_info.yaml"))
from codegen.autograd.utils import VERSION_PART
from codegen.utils import PathManager
project_path = Path(os.path.dirname(__file__)).parent
op_plugin_info_path = os.path.realpath(os.path.join(
project_path,
f'third_party/op-plugin/test/test_v{VERSION_PART[0]}r{VERSION_PART[1]}_ops',
"unsupported_ops_info.yaml"))
torch_npu_info_path = os.path.realpath(os.path.join(project_path, "test", "unsupported_ops_info.yaml"))
unsupported_dict_path = op_plugin_info_path if os.path.exists(op_plugin_info_path) else torch_npu_info_path
PathManager.check_directory_path_readable(unsupported_dict_path)
with open(unsupported_dict_path, "r") as f:
unsupported_summary_dict = yaml.safe_load(f)
skip_list = dict()
@@ -85,7 +98,7 @@ def gen_ops_info(summary_dict):
)
fm = FileManager(os.path.join("torch_npu", "testing"), os.path.join("codegen", "templates"), False)
fm.write_with_template(f"npu_testing_utils.py", "npu_testing_utils.py", lambda:{
fm.write_with_template(f"_npu_testing_utils.py", "npu_testing_utils.py", lambda:{
"skip_detail": [skip_template.substitute(op_name=op, decorators=doc) for op, doc in skip_list.items()]
})
+27 -38
View File
@@ -4,14 +4,14 @@ from typing import List, Dict, Sequence
import yaml
from torchgen.code_template import CodeTemplate
from torchgen.gen import (parse_tags_yaml, LineLoader, FileManager, cpp_string, error_check_native_functions)
from torchgen.model import (BackendIndex, DispatchKey, Location, Variant,
from torchgen.gen import (parse_tags_yaml, FileManager, cpp_string, error_check_native_functions)
from torchgen.model import (BackendIndex, DispatchKey, Variant,
NativeFunction, OperatorName, BackendMetadata)
from torchgen.utils import concatMap, context
from torchgen.utils import concatMap
from torchgen.context import with_native_function, native_function_manager
from torchgen.api.types import DispatcherSignature
from torchgen.api import cpp
from codegen.utils import (enable_opplugin, is_op_valid, filed_tag, get_opplugin_wrap_name, PathManager)
from codegen.utils import (enable_opplugin, is_op_valid, field_tag, get_opplugin_wrap_name, parse_npu_yaml)
# Parse native_functions.yaml into a sequence of NativeFunctions and Backend Indices.
@@ -22,11 +22,6 @@ CUSTOM_FUNCTIONS_DECLARATION = CodeTemplate("""\
${return_type} ${func_name}(${args_str});
""")
EXPORT_CUSTOM_FUNCTIONS_DECLARATION = CodeTemplate("""\
__attribute__((__visibility__("default"))) \
${return_type} ${func_name}(${args_str});
""")
CUSTOM_FUNCTIONS_DEFINITION = CodeTemplate("""\
${return_type} ${func_name}(${args_str}) {
static auto op = c10::Dispatcher::singleton().findSchemaOrThrow("npu::${base_name}", "${overload}").typed<${schema}>();
@@ -34,31 +29,28 @@ ${return_type} ${func_name}(${args_str}) {
}
""")
SKIP_PYTHON_BINDINGS_SIGNATURES = []
@with_native_function
def should_generate_ops_patch(f: NativeFunction) -> bool:
func_signature = str(f.func)
for pattern in SKIP_PYTHON_BINDINGS_SIGNATURES:
if pattern == func_signature:
return False
return True
def parse_custom_yaml(custom_path: str, tag_path: str) -> ParsedYaml:
valid_tags = parse_tags_yaml(tag_path)
rs: List[NativeFunction] = []
bs: Dict[DispatchKey, Dict[OperatorName, BackendMetadata]] = defaultdict(dict)
# Filter the custom native yaml file, and extract the functions we defined.
from io import StringIO
f_str = StringIO()
PathManager.check_directory_path_readable(custom_path)
with open(custom_path, 'r') as f:
for line in f:
if line.split(':')[0] in ['backend', 'cpp_namespace', 'extra_headers',
'supported', 'autograd']:
flag = False
continue
if line.split(':')[0] in ['custom', 'custom_autograd']:
flag = True
continue
if ':' not in line or not flag:
continue
f_str.write(line)
f_str.seek(0)
custom_es = yaml.safe_load(f_str)
custom_es = filed_tag(custom_es)
source_es = parse_npu_yaml(custom_path)
custom_es = source_es.get('custom', []) + source_es.get('custom_autograd', [])
custom_es = field_tag(custom_es)
for e_with_vars in custom_es:
func, m = NativeFunction.from_yaml(e_with_vars, "Location", valid_tags)
func.variants.discard(Variant.method)
@@ -106,7 +98,8 @@ def compute_op_definition(f: NativeFunction):
if enable_opplugin() and is_op_valid(str(f.func.name)):
impl_name = f"op_plugin::{get_opplugin_wrap_name(f)}"
check_out = [f'TORCH_CHECK(out.size() == {out_num}, "expected tuple of {out_num} elements but got ", out.size());']
check_out = [f'TORCH_CHECK(out.size() == {out_num}, "expected tuple of {out_num} elements but got ", out.size(), '
f'OPS_ERROR(ErrCode::PARAM));']
unpack_out = check_out + [f'at::Tensor {args[-out_num + i].name} = out[{i}];' for i in range(out_num)] \
if out_num > 1 else ''
out_return_type = '::std::tuple<{}>'.format(', '.join(['at::Tensor'] * out_num))
@@ -164,9 +157,11 @@ def gen_custom_trace(fm: FileManager, custom_trace_functions: Sequence[NativeFun
def gen_custom_ops_patch(fm: FileManager, custom_trace_functions: Sequence[NativeFunction]):
valid_native_functions = list(filter(should_generate_ops_patch, custom_trace_functions))
fm.write_with_template(f'custom_ops.py', 'custom_ops.py', lambda: {
'custom_ops': [f'torch_npu.{ops} = torch.ops.npu.{ops}'
for ops in set([f.func.name.name for f in custom_trace_functions])],
for ops in set([f.func.name.name for f in valid_native_functions])],
})
@@ -176,15 +171,9 @@ def compute_custom_functions_declaration(f: NativeFunction, func_type: str):
name = sig.name()
args = sig.arguments()
if func_type == 'call':
args_str = ', '.join(a.defn() for a in args)
args_str = ', '.join(a.decl() for a in args)
if func_type == 'redispatch':
args_str = 'c10::DispatchKeySet dispatchKeySet, ' + ', '.join(a.defn() for a in args)
if (func_type == 'call') and (name == 'npu_slice_out'):
return [EXPORT_CUSTOM_FUNCTIONS_DECLARATION.substitute(
return_type=cpp.returns_type(f.func.returns).cpp_type(),
func_name=name,
args_str=args_str,)]
args_str = 'c10::DispatchKeySet dispatchKeySet, ' + ', '.join(a.decl() for a in args)
return [CUSTOM_FUNCTIONS_DECLARATION.substitute(
return_type=cpp.returns_type(f.func.returns).cpp_type(),
+85 -34
View File
@@ -17,32 +17,31 @@
import pathlib
import argparse
import os
import stat
import re
from collections import namedtuple, Counter, defaultdict
from typing import List, Dict, Union, Sequence, Optional, Set, Callable
import yaml
from torchgen.code_template import CodeTemplate
from torchgen.gen import (parse_tags_yaml, LineLoader, FileManager, parse_native_yaml,
from torchgen.gen import (parse_tags_yaml, FileManager, parse_native_yaml,
get_grouped_native_functions, error_check_native_functions)
from torchgen.model import (BackendIndex, DispatchKey, Location,
from torchgen.model import (BackendIndex, DispatchKey,
NativeFunction, NativeFunctionsGroup, OperatorName,
BackendMetadata, is_cuda_dispatch_key)
from torchgen.native_function_generation import add_generated_native_functions
from torchgen.selective_build.selector import SelectiveBuilder
from torchgen.utils import Target, concatMap, context, NamespaceHelper
from torchgen.context import native_function_manager
import torchgen.dest as dest
import torchgen.api.dispatcher as dispatcher
from torchgen.api.types import DispatcherSignature
import torchgen.api.native as native
from torchgen.api.cpp import JIT_TO_CPP_DEFAULT
from torchgen.gen_backend_stubs import gen_dispatchkey_nativefunc_headers
from codegen.utils import (get_torchgen_dir, rename_privateuse1_dispatch_key, gen_unstructured,
add_header_to_template_file, parse_npu_yaml, get_opplugin_wrap_name,
parse_opplugin_yaml, merge_custom_yaml, filed_tag, gen_custom_yaml_path,
update_opapi_info, is_opapi, PathManager)
get_target_functions, merge_custom_yaml, field_tag, gen_custom_yaml_path,
update_opapi_info, is_opapi, PathManager, filt_exposed_api, get_target_native_registration)
from codegen.custom_functions import (parse_custom_yaml, gen_custom_trace, gen_custom_ops_patch,
gen_custom_functions_dispatch)
@@ -139,7 +138,7 @@ def parse_native_and_custom_yaml(path: str, tag_path: str, custom_path: str) ->
supported_es = source_es.get('supported', []) + source_es.get('autograd', []) + custom_es
for es in supported_es:
update_opapi_info(es)
custom_es = filed_tag(custom_es)
custom_es = field_tag(custom_es)
for e in custom_es:
func, m = NativeFunction.from_yaml(e, "Location", valid_tags)
rs.append(func)
@@ -192,7 +191,7 @@ def parse_backend_yaml(
if not isinstance(yaml_values, dict):
raise TypeError("yaml_values is not dict")
valid_keys = ['backend', 'cpp_namespace', 'tocpu', 'supported', 'autograd', 'custom', 'custom_autograd', 'symint']
valid_keys = ['backend', 'cpp_namespace', 'supported', 'autograd', 'custom', 'custom_autograd', 'symint']
yaml_backend = yaml_values.pop('backend', None)
true_backend = 'PrivateUse1' if yaml_backend == 'NPU' else yaml_backend
@@ -221,13 +220,11 @@ def parse_backend_yaml(
supported_autograd = yaml_values.pop('autograd', [])
if not isinstance(supported_autograd, list):
raise TypeError(f'expected "autograd" to be a list, but got: {supported_autograd}')
supported = [op['func'].split("(")[0] if isinstance(op, Dict) else op for op in supported]
supported = [op['func'].split("(")[0] for op in supported
if isinstance(op, Dict) and ("impl_ns" in op.keys() or "op_api" in op.keys())] + \
[op for op in supported if not isinstance(op, Dict)]
supported_autograd = [op['func'].split("(")[0] if isinstance(op, Dict) else op for op in supported_autograd]
supported_tocpu = yaml_values.pop('tocpu', [])
if not isinstance(supported_tocpu, list):
raise TypeError(f'expected "tocpu" to be a list, but got: {supported_tocpu}')
custom = yaml_values.pop('custom', [])
if not isinstance(custom, list):
raise TypeError(f'expected "autograd" to be a list, but got: {custom}')
@@ -244,6 +241,8 @@ def parse_backend_yaml(
for item in custom_autograd:
supported_autograd.append(item['func'][:item['func'].index('(')])
# custom_supported is only supported for filt expose api, and is not useful here.
yaml_values.pop('custom_supported', [])
if (len(yaml_values.keys()) > 0):
raise KeyError(f'{backend_yaml_path} contains unexpected keys: {", ".join(yaml_values.keys())}. \
Only the following keys are supported: {", ".join(valid_keys)}')
@@ -277,21 +276,10 @@ the behavior of autograd for some operators on your backend. However "Autograd{b
backend_indices[autograd_key] = autograd_idx
backend_indices[str(autograd_key) + opapi_key] = opapi_autograd_idx
check_op_on_cpu_kernels(supported_tocpu, backend_indices)
check_grouped_native_functions(backend_key, autograd_key, backend_indices, grouped_native_functions)
return ParsedExternalYaml(true_backend, backend_key, autograd_key, cpp_namespace, backend_indices)
def check_op_on_cpu_kernels(
expected_to_cpu: List,
backend_indices: Dict[DispatchKey, BackendIndex]):
op_names: List[OperatorName] = list(backend_indices[DispatchKey.CPU].index.keys())
for op_name in op_names:
if op_name.name.base not in expected_to_cpu:
backend_indices[DispatchKey.CPU].index.pop(op_name, None)
def op_plugin_kernel_conut(op_plugin_ops_dir: str):
actual_backend_kernel_name_counts = Counter()
file_path = os.path.join(op_plugin_ops_dir, "OpInterface.h")
@@ -340,8 +328,6 @@ def check_op_plugin_kernels(
def main() -> None:
parser = argparse.ArgumentParser(description='Generate backend stub files')
parser.add_argument(
'--to_cpu', type=str, default="TRUE", help='move op which npu does not support to cpu')
parser.add_argument(
'-s',
'--source_yaml',
@@ -360,7 +346,7 @@ def main() -> None:
help='path to the source yaml file containing kernel definitions in op_plugin')
options = parser.parse_args()
run(options.to_cpu, options.source_yaml, options.output_dir, options.dry_run,
run(options.source_yaml, options.output_dir, options.dry_run,
options.impl_path, options.op_plugin_impl_path, options.op_plugin_yaml_path)
@@ -374,6 +360,7 @@ def gen_dispatcher_registrations(
selector: "SelectiveBuilder",
dispatch_key_name: str,
register_dispatch_key_func: Callable,
native_function_registrations: str = '',
):
backend_index = backend_indices[backend_dispatch_key]
ns_helper = NamespaceHelper(namespace_str="at")
@@ -430,7 +417,7 @@ $dispatch_registrations_body
'deferred_dispatch_registrations': '',
'dispatch_helpers': dest.gen_registration_helpers(backend_index),
'dispatch_namespace': dispatch_key.lower(),
'dispatch_namespaced_definitions': '',
'dispatch_namespaced_definitions': native_function_registrations,
'dispatch_anonymous_definitions': list(
concatMap(
register_dispatch_key_func(
@@ -506,7 +493,53 @@ m.impl("${schema}", TORCH_FN(at::native::${kernel}));"""
})
def run(to_cpu: str, source_yaml: str, output_dir: str, dry_run: bool,
def gen_target_registration(
target_op_type: str,
dispatch_key: DispatchKey,
backend_indices: Dict[DispatchKey, BackendIndex],
grouped_native_functions: Sequence[Union[NativeFunction, NativeFunctionsGroup]],
op_plugin_yaml_path: str,
fm: FileManager,
selector: "SelectiveBuilder",
native_functions: List[NativeFunction] = None,
):
target_ops = get_target_functions(op_plugin_yaml_path, target_op_type=target_op_type)
target_native_functions = []
for f in grouped_native_functions:
if isinstance(f, NativeFunctionsGroup):
for func in f.functions():
if func.func in target_ops:
target_native_functions.append(f)
elif f.func in target_ops:
target_native_functions.append(f)
metadata: Dict[OperatorName, BackendMetadata] = {}
for op in target_ops:
kernel_name = dispatcher.name(op)
metadata[op.name] = BackendMetadata(kernel=kernel_name, structured=False, cpp_namespace=target_op_type)
backend_indices[dispatch_key] = BackendIndex(
dispatch_key=dispatch_key,
use_out_as_primary=False,
external=True,
device_guard=False,
index=metadata)
native_registration = get_target_native_registration(dispatch_key, backend_indices, metadata, native_functions)
gen_dispatcher_registrations(
fm,
backend_indices[dispatch_key].native_function_class_name(),
backend_indices,
target_native_functions,
dispatch_key,
dispatch_key,
selector,
dispatch_key_name=dispatch_key.name,
register_dispatch_key_func=dest.RegisterDispatchKey,
native_function_registrations=native_registration,
)
def run(source_yaml: str, output_dir: str, dry_run: bool,
impl_path: Optional[str], op_plugin_impl_path: Optional[str], op_plugin_yaml_path: Optional[str]) -> None:
rename_privateuse1_dispatch_key()
torchgen_path = get_torchgen_dir()
@@ -522,7 +555,7 @@ def run(to_cpu: str, source_yaml: str, output_dir: str, dry_run: bool,
tags_yaml_path = os.path.join(torchgen_path, 'packaged/ATen/native/tags.yaml')
native_yaml_path = os.path.join(torchgen_path, 'packaged/ATen/native/native_functions.yaml')
parsed_yaml = parse_native_and_custom_yaml(native_yaml_path, tags_yaml_path, source_yaml)
parse_opplugin_yaml(op_plugin_yaml_path)
get_target_functions(op_plugin_yaml_path)
native_functions, backend_indices = parsed_yaml.native_functions, parsed_yaml.backend_indices
grouped_native_functions = get_grouped_native_functions(native_functions)
parsed_backend_yaml = parse_backend_yaml(source_yaml, grouped_native_functions, backend_indices)
@@ -573,8 +606,8 @@ def run(to_cpu: str, source_yaml: str, output_dir: str, dry_run: bool,
register_dispatch_key_func=dest.RegisterDispatchKey,
)
template_dir = os.path.join(pathlib.Path(__file__).parent.absolute(), "templates")
fm = FileManager(install_dir=output_dir, template_dir=template_dir, dry_run=dry_run)
pta_template_dir = os.path.join(pathlib.Path(__file__).parent.absolute(), "templates")
fm = FileManager(install_dir=output_dir, template_dir=pta_template_dir, dry_run=dry_run)
custom_functions = parse_custom_yaml(source_yaml, tags_yaml_path).native_functions
gen_custom_trace(fm, custom_functions)
@@ -587,9 +620,27 @@ def run(to_cpu: str, source_yaml: str, output_dir: str, dry_run: bool,
backend_indices[backend_dispatch_key])
custom_ops_patch_dir = os.path.join(output_dir, "../../utils/")
fm = FileManager(install_dir=custom_ops_patch_dir, template_dir=template_dir, dry_run=dry_run)
fm = FileManager(install_dir=custom_ops_patch_dir, template_dir=pta_template_dir, dry_run=dry_run)
gen_custom_ops_patch(fm, custom_functions)
filt_exposed_list = filt_exposed_api(source_yaml)
exposed_path = pathlib.Path(__file__).parents[1].joinpath('torch_npu/utils/exposed_api.py')
PathManager.remove_path_safety(exposed_path)
with os.fdopen(os.open(exposed_path, os.O_RDWR | os.O_CREAT, stat.S_IWUSR | stat.S_IRUSR), 'w') as f:
f.write(f'public_npu_functions = {filt_exposed_list}')
os.chmod(exposed_path, stat.S_IRUSR | stat.S_IEXEC | stat.S_IRGRP | stat.S_IXGRP)
fm = make_file_manager(output_dir)
gen_target_registration(
"sparse",
DispatchKey.SparsePrivateUse1,
backend_indices,
grouped_native_functions,
op_plugin_yaml_path,
fm,
selector,
native_functions
)
def apply_torchgen_patch():
dest.RegisterDispatchKey.gen_unstructured = gen_unstructured
@@ -601,4 +652,4 @@ def apply_torchgen_patch():
if __name__ == '__main__':
apply_torchgen_patch()
main()
main()
@@ -26,6 +26,7 @@
#include "torch_npu/csrc/aten/NPUNativeFunctions.h"
#include "torch_npu/csrc/aten/VariableType.h"
#include "torch_npu/csrc/core/npu/NPUException.h"
#include "op_plugin/OpInterface.h"
namespace at_npu {
+120 -44
View File
@@ -18,18 +18,23 @@ import sys
import stat
import traceback
import warnings
from typing import List, Optional, Set, Dict
from typing import List, Optional, Set, Dict, Union, Sequence
from collections import defaultdict
import yaml
from torchgen.api.types.signatures import NativeSignature
from torchgen.context import native_function_manager
from torchgen.code_template import CodeTemplate
from torchgen.model import (
Arguments,
BackendIndex,
BackendMetadata,
DispatchKey,
is_cuda_dispatch_key,
NativeFunction,
NativeFunctionsGroup,
FunctionSchema,
OperatorName,
)
from torchgen.api import cpp
from torchgen.api.translate import translate
@@ -40,7 +45,7 @@ GLOBAL_STRUCTURED_OP_INFO_CACHE = defaultdict(str)
GLOBAL_OPAPI_INFO_CACHE = set()
CUSTOM_YAML_NAME = "npu_native_functions_by_codegen.yaml"
FIELDS_TO_REMOVE = ["wrap_impl", "impl_name", "impl_ns", "op_api"]
FIELDS_TO_USE = ["func", "tags", "dispatch"]
class PathManager:
@@ -144,52 +149,22 @@ def merge_custom_yaml(pta_path, op_plugin_path):
return merged_yaml
def filed_tag(custom_es):
for e in custom_es:
if not isinstance(e, Dict):
print(e)
def field_tag(custom_es):
for i, es in enumerate(custom_es):
if not isinstance(es, dict):
continue
for field in FIELDS_TO_REMOVE:
e.pop(field, None)
custom_es[i] = {key: custom_es[i][key] for key in FIELDS_TO_USE if key in custom_es[i]}
return custom_es
def parse_opplugin_yaml(custom_path: str) -> Dict:
def filt_exposed_api(custom_path: str):
source_es = parse_npu_yaml(custom_path)
custom = source_es.pop('custom', [])
if custom is None:
custom = [] # Allow an empty list of supported ops
official = source_es.pop('official', [])
if official is None:
official = [] # Allow an empty list of supported ops
support_ops = custom + official
symint = source_es.pop("symint", [])
if symint is None:
symint = []
symint = [op['func'] if isinstance(op, Dict) else op for op in symint]
symint_set = set([str(FunctionSchema.parse(op).name) for op in symint])
global GLOBAL_STRUCTURED_OP_INFO_CACHE
for x in support_ops:
funcs = x.get("func", None)
if not isinstance(funcs, str):
raise TypeError(f'not a str : {funcs}')
func = FunctionSchema.parse(funcs)
wrap_name = cpp.name(func)
op_key = str(func.name)
if op_key in symint_set:
wrap_name += "_symint"
cur_wrap_name = GLOBAL_STRUCTURED_OP_INFO_CACHE.get(op_key, "")
if cur_wrap_name and cur_wrap_name != wrap_name:
print(f"Find different wrap_name for {cur_wrap_name} and {wrap_name} between pta and opplugin, ",
f"with {wrap_name} being used as the actual wrap_name")
GLOBAL_STRUCTURED_OP_INFO_CACHE[op_key] = wrap_name
return source_es
custom_es = source_es.get('custom', []) + source_es.get('custom_autograd', [])
exposed_set = set()
for es in custom_es:
if es.get('exposed', False):
exposed_set.add(es.get('func').split('(')[0].split('.')[0])
return list(exposed_set)
def rename_privateuse1_dispatch_key():
@@ -281,7 +256,7 @@ return {sig.name()}({', '.join(e.expr for e in translate(cpp_sig.arguments(), si
return f"""
{returns_type} {name}({args_str}) {{
TORCH_CHECK_NOT_IMPLEMENTED({self_arg_name}.is_meta(),
"Cannot inplace into non-meta tensor with meta tensor argument");
"Cannot inplace into non-meta tensor with meta tensor argument", OPS_ERROR(ErrCode::NOT_SUPPORT));
return {self_arg_name};
}}
"""
@@ -490,3 +465,104 @@ def update_opapi_info(op_info):
def is_opapi(op_key):
global GLOBAL_OPAPI_INFO_CACHE
return op_key in GLOBAL_OPAPI_INFO_CACHE
def get_target_functions(yaml_path: str, target_op_type: str = None) -> List:
source_es = parse_npu_yaml(yaml_path)
custom = source_es.pop('custom', [])
if custom is None:
custom = [] # Allow an empty list of supported ops
official = source_es.pop('official', [])
if official is None:
official = [] # Allow an empty list of supported ops
support_ops = custom + official
symint = source_es.pop("symint", [])
if symint is None:
symint = []
symint = [op['func'] if isinstance(op, Dict) else op for op in symint]
symint_set = set([str(FunctionSchema.parse(op).name) for op in symint])
global GLOBAL_STRUCTURED_OP_INFO_CACHE
GLOBAL_STRUCTURED_OP_INFO_CACHE.clear()
target_funcs = []
for op in support_ops:
funcs = op.get("func", None)
if not isinstance(funcs, str):
raise TypeError(f'not a str : {funcs}')
func = FunctionSchema.parse(funcs)
wrap_name = cpp.name(func)
op_key = str(func.name)
if op_key in symint_set:
wrap_name += "_symint"
if target_op_type is not None:
if target_op_type not in op.keys():
continue
wrap_name += "_" + target_op_type
cur_wrap_name = GLOBAL_STRUCTURED_OP_INFO_CACHE.get(op_key, "")
if cur_wrap_name and cur_wrap_name != wrap_name:
print(f"Find different wrap_name for {cur_wrap_name} and {wrap_name} between pta and opplugin, ",
f"with {wrap_name} being used as the actual wrap_name")
GLOBAL_STRUCTURED_OP_INFO_CACHE[op_key] = wrap_name
target_funcs.append(func)
return target_funcs
def get_target_native_registration(
dispatch_key: DispatchKey,
backend_indices: Dict[DispatchKey, BackendIndex],
metadata: Dict[OperatorName, BackendMetadata],
native_functions: List[NativeFunction],
):
if native_functions is None:
return ""
cpu_dispatch_key = DispatchKey.parse(dispatch_key.name.replace("PrivateUse1", "CPU"))
cpu_backend_indices = backend_indices[cpu_dispatch_key]
cuda_dispatch_key = DispatchKey.parse(dispatch_key.name.replace("PrivateUse1", "CUDA"))
cuda_backend_indices = backend_indices[cuda_dispatch_key]
target_native_functions_kernels = {}
for op_name in cpu_backend_indices.index.keys():
if cpu_backend_indices.index[op_name].kernel == cuda_backend_indices.index[op_name].kernel \
and op_name not in metadata.keys():
target_native_functions_kernels[op_name] = cpu_backend_indices.index[op_name].kernel
target_native_functions = []
for f in native_functions:
if f.func.name in target_native_functions_kernels.keys():
target_native_functions.append(f)
native_functions_registration_template = CodeTemplate(
"""\
namespace {
${dispatch_helpers}
TORCH_LIBRARY_IMPL(aten, ${dispatch_key}, m) {
${native_kernels}
}
}
""")
def wrap_native_function(f):
kernel_name = target_native_functions_kernels[f.func.name]
wrap_func_name = f"wrap_{dispatch_key}_{str(f.func.name.name)}_{f.func.name.overload_name}"
with native_function_manager(f):
sig = NativeSignature(f.func, prefix='', symint=kernel_name.endswith('symint'))
args_exprs_str = ', '.join(a.name for a in sig.arguments())
return f"""{sig.decl(name=wrap_func_name)} {{
return at::native::{kernel_name}({args_exprs_str});
}}
"""
def register_wrap_native_function(f):
wrap_func_name = f"wrap_{dispatch_key}_{str(f.func.name.name)}_{f.func.name.overload_name}"
return f"m.impl(\"{f.func.name}\", TORCH_FN({wrap_func_name}));"
return native_functions_registration_template.substitute(
dispatch_helpers=[wrap_native_function(f) for f in target_native_functions],
dispatch_key=dispatch_key.name,
native_kernels=[register_wrap_native_function(f) for f in target_native_functions]
)
@@ -36,5 +36,6 @@ int main(int argc, const char* argv[]) {
std::cout << output.slice(1, 0, 5) << std::endl;
std::cout << "resnet_model run success!" << std::endl;
torch_npu::finalize_npu();
return 0;
}
+9
View File
@@ -36,3 +36,12 @@ ${python_execute} -m codegen.autograd.gen_autograd \
--npu_native_function_dir="$source_yaml"
${python_execute} -m codegen.codegen_ops_info
if [ -f $CDIR/third_party/op-plugin/codegen/templates/_op_plugin_docs.py ]; then
if [ -f $CDIR/torch_npu/_op_plugin_docs.py ]; then
# remove _op_plugin_docs.py
rm $CDIR/torch_npu/_op_plugin_docs.py
echo "Existing _op_plugin_docs.py in torch_npu deleted."
fi
cp -f $CDIR/third_party/op-plugin/codegen/templates/_op_plugin_docs.py $CDIR/torch_npu/_op_plugin_docs.py
fi
+54 -6
View File
@@ -27,12 +27,14 @@ from wheel.bdist_wheel import bdist_wheel
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
THIRD_PARTY_PATH = os.path.join(BASE_DIR, "third_party")
VERSION = '2.1.0'
VERSION = '2.1.0.post5'
UNKNOWN = "Unknown"
DISABLE_TORCHAIR = "TRUE"
BUILD_PERMISSION = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP
DISABLE_TORCHAIR = "FALSE"
if os.environ.get("DISABLE_INSTALL_TORCHAIR") is not None:
DISABLE_TORCHAIR = os.environ.get("DISABLE_INSTALL_TORCHAIR")
DISABLE_RPC = "TRUE"
DISABLE_RPC = "FALSE"
if os.environ.get("DISABLE_RPC_FRAMEWORK") is not None:
DISABLE_RPC = os.environ.get("DISABLE_RPC_FRAMEWORK")
@@ -104,7 +106,7 @@ def generate_torch_npu_version():
with os.fdopen(os.open(version_path, flags, modes), 'w') as f:
f.write("__version__ = '{version}'\n".format(version=VERSION))
f.write("git_version = {}\n".format(repr(sha)))
os.chmod(version_path, stat.S_IRUSR | stat.S_IEXEC | stat.S_IRGRP | stat.S_IXGRP)
os.chmod(version_path, mode=stat.S_IRUSR | stat.S_IEXEC | stat.S_IRGRP | stat.S_IXGRP)
generate_torch_npu_version()
@@ -206,6 +208,23 @@ def check_tensorpipe_valid(base_dir):
return os.path.exists(tensorpipe_path)
def generate_dbg_files_and_strip():
library_dir = Path(BASE_DIR).joinpath("build/packages/torch_npu")
dbg_dir = Path(BASE_DIR).joinpath("build/dbg")
os.makedirs(dbg_dir, exist_ok=True)
library_files = [Path(i) for i in library_dir.rglob('*.so')]
for library_file in library_files:
subprocess.check_call(["eu-strip", library_file, "-f",
str(dbg_dir.joinpath(library_file.name)) + ".debug"], cwd=BASE_DIR) # Compliant
def patchelf_dynamic_library():
library_dir = Path(BASE_DIR).joinpath("build/packages/torch_npu/lib")
library_files = [str(i) for i in library_dir.rglob('*.so')]
for library_file in library_files:
subprocess.check_call(["patchelf", "--remove-needed", "libgomp.so.1", library_file], cwd=BASE_DIR) # Compliant
def CppExtension(name, sources, *args, **kwargs):
r'''
Creates a :class:`setuptools.Extension` for C++.
@@ -289,6 +308,7 @@ class CPPLibBuild(build_clib, object):
build_type_dir = os.path.join(build_dir)
output_lib_path = os.path.join(build_type_dir, "packages/torch_npu/lib")
os.makedirs(build_type_dir, exist_ok=True)
os.chmod(build_type_dir, mode=BUILD_PERMISSION)
os.makedirs(output_lib_path, exist_ok=True)
self.build_lib = os.path.relpath(os.path.join(build_dir, "packages/torch_npu"))
self.build_temp = os.path.relpath(build_type_dir)
@@ -317,6 +337,14 @@ class CPPLibBuild(build_clib, object):
build_args = ['-j', str(multiprocessing.cpu_count())]
subprocess.check_call([self.cmake, BASE_DIR] + cmake_args, cwd=build_type_dir, env=os.environ)
for base_dir, dirs, files in os.walk(build_type_dir):
for dir_name in dirs:
dir_path = os.path.join(base_dir, dir_name)
os.chmod(dir_path, mode=BUILD_PERMISSION)
for file_name in files:
file_path = os.path.join(base_dir, file_name)
os.chmod(file_path, mode=BUILD_PERMISSION)
subprocess.check_call(['make'] + build_args, cwd=build_type_dir, env=os.environ)
@@ -338,12 +366,22 @@ class InstallCmd(install):
return super(InstallCmd, self).finalize_options()
def add_ops_files(base_dir, file_list):
# add ops header files
plugin_path = os.path.join(base_dir, 'third_party/op-plugin/op_plugin/include')
if os.path.exists(plugin_path):
file_list.append('third_party/op-plugin/op_plugin/include/*.h')
return
def get_src_py_and_dst():
ret = []
generated_python_files = glob.glob(
os.path.join(BASE_DIR, "torch_npu", '**/*.py'),
recursive=True) + glob.glob(
os.path.join(BASE_DIR, "torch_npu", '**/*.yaml'),
recursive=True) + glob.glob(
os.path.join(BASE_DIR, "torch_npu", 'acl.json'),
recursive=True)
for src in generated_python_files:
dst = os.path.join(
@@ -361,6 +399,7 @@ def get_src_py_and_dst():
"third_party/acl/inc/*/*.h",
"third_party/acl/inc/*/*/*.h"
]
add_ops_files(BASE_DIR, header_files)
glob_header_files = []
for regex_pattern in header_files:
glob_header_files += glob.glob(os.path.join(BASE_DIR, regex_pattern), recursive=True)
@@ -411,6 +450,12 @@ class PythonPackageBuild(build_py, object):
class BdistWheelBuild(bdist_wheel):
def run(self):
if which('patchelf') is not None:
patchelf_dynamic_library()
if which('eu-strip') is not None:
generate_dbg_files_and_strip()
torch_dependencies = ["libc10.so", "libtorch.so", "libtorch_cpu.so", "libtorch_python.so"]
cann_dependencies = ["libhccl.so", "libascendcl.so", "libacl_op_compiler.so", "libge_runner.so",
"libgraph.so", "libacl_tdt_channel.so", "libfmk_parser.so", "libascend_protobuf.so"]
@@ -447,7 +492,8 @@ include_directories = [
BASE_DIR,
os.path.join(BASE_DIR, 'patch/include'),
os.path.join(BASE_DIR, 'third_party/hccl/inc'),
os.path.join(BASE_DIR, 'third_party/acl/inc')
os.path.join(BASE_DIR, 'third_party/acl/inc'),
os.path.join(BASE_DIR, 'third_party/profiler')
]
extra_link_args = []
@@ -472,7 +518,7 @@ if DEBUG:
extra_link_args += ['-O0', '-g', '-Wl,-z,now']
else:
extra_compile_args += ['-DNDEBUG']
extra_link_args += ['-Wl,-z,now,-s']
extra_link_args += ['-Wl,-z,now']
# valid manylinux tags
manylinux_tags = [
@@ -523,6 +569,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
]
requirements = ['torch==2.1.0+cpu' if platform.machine() == 'x86_64' else 'torch==2.1.0']
setup(
name=os.environ.get('TORCH_NPU_PACKAGE_NAME', 'torch_npu'),
@@ -546,6 +593,7 @@ setup(
extra_link_args=extra_link_args + ['-Wl,-rpath,$ORIGIN/lib'],
),
],
install_requires=requirements,
extras_require={
},
package_data={
@@ -0,0 +1,123 @@
import os
import sys
import shutil
import subprocess
import ctypes
import torch
import torch.utils.cpp_extension
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
PYTORCH_INSTALL_PATH = os.path.dirname(os.path.realpath(torch.__file__))
PYTORCH_NPU_INSTALL_PATH = os.path.dirname(os.path.realpath(torch_npu.__file__))
def create_build_path(build_directory):
if os.path.exists(build_directory):
shutil.rmtree(build_directory, ignore_errors=True)
os.makedirs(build_directory, exist_ok=True)
def build_stub(base_dir):
build_stub_cmd = ["sh", os.path.join(base_dir, 'third_party/acl/libs/build_stub.sh')]
if subprocess.call(build_stub_cmd) != 0:
raise RuntimeError('Failed to build stub: {}'.format(build_stub_cmd))
class TestPluggableAllocator(TestCase):
module = None
new_alloc = None
build_directory = "allocator/build"
@classmethod
def setUpClass(cls):
# Build Extension
BASE_DIR = os.path.abspath("./../")
build_stub(BASE_DIR)
create_build_path(cls.build_directory)
CANN_LIB_PATH = os.path.join(BASE_DIR, 'third_party/acl/libs')
extra_ldflags = []
extra_ldflags.append("-lascendcl")
extra_ldflags.append(f"-L{CANN_LIB_PATH}")
extra_ldflags.append("-lc10")
extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}")
extra_include_paths = ["cpp_extensions"]
extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include'))
cls.module = torch.utils.cpp_extension.load(
name="pluggable_allocator_extensions",
sources=[
"cpp_extensions/pluggable_allocator_extensions.cpp"
],
extra_include_paths=extra_include_paths,
extra_cflags=["-g"],
extra_ldflags=extra_ldflags,
build_directory=cls.build_directory,
verbose=True,
)
def test_pluggable_allocator(self):
os_path = os.path.join(TestPluggableAllocator.build_directory, 'pluggable_allocator_extensions.so')
# Load the allocator
TestPluggableAllocator.new_alloc = torch_npu.npu.memory.NPUPluggableAllocator(os_path, 'my_malloc', 'my_free')
# Swap the current allocator
torch_npu.npu.memory.change_current_allocator(TestPluggableAllocator.new_alloc)
# This will allocate memory in the device using the new allocator
self.assertFalse(self.module.check_custom_allocator_used())
npu_tensor = torch.zeros(10, device='npu')
cpu_tensor = torch.zeros(10)
self.assertRtolEqual(npu_tensor.cpu().numpy(), cpu_tensor.numpy())
self.assertTrue(self.module.check_custom_allocator_used())
def test_set_get_device_stats_fn(self):
os_path = os.path.join(TestPluggableAllocator.build_directory, 'pluggable_allocator_extensions.so')
myallocator = ctypes.CDLL(os_path)
get_device_stats_fn = ctypes.cast(getattr(myallocator, "my_get_device_stats"), ctypes.c_void_p).value
msg = "get_device_stats_fn_ is not define, please set by set_get_device_stats_fn"
with self.assertRaisesRegex(RuntimeError, msg):
torch.npu.memory_stats_as_nested_dict()
TestPluggableAllocator.new_alloc.allocator().set_get_device_stats_fn(get_device_stats_fn)
self.assertEqual(torch.npu.memory_stats_as_nested_dict()["num_alloc_retries"], 0)
def test_set_reset_peak_status_fn(self):
os_path = os.path.join(TestPluggableAllocator.build_directory, 'pluggable_allocator_extensions.so')
myallocator = ctypes.CDLL(os_path)
reset_peak_status_fn = ctypes.cast(getattr(myallocator, "my_reset_peak_status"), ctypes.c_void_p).value
msg = "reset_peak_status_fn_ is not define, please set by set_reset_peak_status_fn"
with self.assertRaisesRegex(RuntimeError, msg):
torch.npu.reset_peak_memory_stats()
TestPluggableAllocator.new_alloc.allocator().set_reset_peak_status_fn(reset_peak_status_fn)
torch.npu.reset_peak_memory_stats()
self.assertEqual(torch.npu.max_memory_allocated(), 0)
def test_set_snapshot_fn(self):
os_path = os.path.join(TestPluggableAllocator.build_directory, 'pluggable_allocator_extensions.so')
myallocator = ctypes.CDLL(os_path)
snapshot_fn = ctypes.cast(getattr(myallocator, "my_snapshot"), ctypes.c_void_p).value
msg = "snapshot_fn_ is not define, please set by set_snapshot_fn"
with self.assertRaisesRegex(RuntimeError, msg):
torch.npu.memory_snapshot()
TestPluggableAllocator.new_alloc.allocator().set_snapshot_fn(snapshot_fn)
self.assertEqual(torch.npu.memory_snapshot(), [])
def test_pluggable_allocator_after_init(self):
os_path = os.path.join(TestPluggableAllocator.build_directory, 'pluggable_allocator_extensions.so')
# Do an initial memory allocator
ori_tensor = torch.zeros(10, device='npu')
# Load the allocator
new_alloc = torch_npu.npu.memory.NPUPluggableAllocator(os_path, 'my_malloc', 'my_free')
msg = "Can't swap an already initialized allocator"
with self.assertRaisesRegex(RuntimeError, msg):
torch_npu.npu.memory.change_current_allocator(new_alloc)
if __name__ == "__main__":
run_tests()
File diff suppressed because it is too large Load Diff
+106
View File
@@ -0,0 +1,106 @@
# Owner(s): ["module: autograd"]
import torch
import torch_npu
import torch_npu.testing
from torch.testing._internal.common_utils import TestCase, run_tests, gradcheck
class TestAutogradComplex(TestCase):
def test_view_func_for_complex_views(self):
# case 1: both parent and child have view_func
x = torch.randn(2, 2, 2, dtype=torch.double, requires_grad=True)
y = x.detach().requires_grad_(True)
x0 = x.clone()
x1 = torch.view_as_complex(x0)
x2 = torch.view_as_real(x1)
x2.mul_(2)
x2.sum().abs().backward()
y0 = y.clone()
y0.mul_(2)
y0.sum().abs().backward()
self.assertEqual(x.grad, y.grad)
# case 2: parent has view_func but child does not
x = torch.randn(2, 2, 2, dtype=torch.double, requires_grad=True)
y = x.detach().requires_grad_(True)
def fn(a):
b = a.clone()
b1 = torch.view_as_complex(b)
b2 = b1.reshape(b1.numel())
return b2
x0 = fn(x)
x0.mul_(2)
x0.sum().abs().backward()
y0 = fn(y)
y1 = y0.mul(2)
y1.sum().abs().backward()
self.assertEqual(x.grad, y.grad)
# case 3: parent does not have a view_func but child does
x = torch.randn(10, dtype=torch.cdouble, requires_grad=True)
y = x.detach().requires_grad_(True)
def fn(a, dim0_size=5):
b = a.clone()
b1 = b.reshape(dim0_size, 2)
b2 = torch.view_as_real(b1)
return b2
x0 = fn(x)
x0.mul_(2)
x0.sum().abs().backward()
y0 = fn(y)
y1 = y0.mul(2)
y1.sum().abs().backward()
self.assertEqual(x.grad, y.grad)
def test_view_with_multi_output(self):
x = torch.randn(2, 2, 2, dtype=torch.double)
x1 = torch.view_as_complex(x)
# Taking an invalid view should always be allowed as long as it is not
# modified inplace
res = x1.unbind(0)
with self.assertRaisesRegex(RuntimeError, "output of a function that returns multiple views"):
res[0] += torch.rand(2, requires_grad=True)
x.requires_grad_(True)
x1 = torch.view_as_complex(x)
# Taking an invalid view should always be allowed as long as it is not
# modified inplace
res = x1.unbind(0)
with self.assertRaisesRegex(RuntimeError, "output of a function that returns multiple views"):
res[0] += torch.rand(2, requires_grad=True)
def as_identity(self):
# view_as_real and view_as_complex behavior should be like an identity
def func(z):
z_ = torch.view_as_complex(z)
z_select = torch.select(z_, z_.dim() - 1, 0)
z_select_real = torch.view_as_real(z_select)
return z_select_real.sum()
z = torch.randn(10, 2, 2, dtype=torch.double, requires_grad=True)
gradcheck(func, [z])
func(z).backward()
z1 = z.clone().detach().requires_grad_(True)
torch.select(z1, z1.dim() - 2, 0).sum().backward()
self.assertEqual(z.grad, z1.grad)
if __name__ == '__main__':
run_tests()
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
# Owner(s): ["module: unknown"]
import argparse
import torch
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# Required args.
parser.add_argument('--foo', help='foo', required=True)
parser.add_argument('--bar', help='bar', required=True)
_ = parser.parse_args()
x = torch.ones((3, 3), requires_grad=True)
(3 * x).sum().backward()
+6
View File
@@ -0,0 +1,6 @@
# Owner(s): ["module: unknown"]
import torch
x = torch.ones((3, 3), requires_grad=True)
(3 * x).sum().backward()
+30
View File
@@ -0,0 +1,30 @@
# Owner(s): ["module: unknown"]
import torch
import torch.nn as nn
import torch_npu
class Model(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(20, 20)
def forward(self, input_):
out = self.linear(input_[:, 10:30])
return out.sum()
def main():
data = torch.randn(10, 50).npu()
model = Model().npu()
optimizer = torch.optim.SGD(model.parameters(), lr=0.0001)
for i in range(10):
optimizer.zero_grad()
loss = model(data)
loss.backward()
optimizer.step()
if __name__ == '__main__':
main()
@@ -1,3 +1,4 @@
import unittest
import numpy as np
import torch
import torch.nn.functional as F
@@ -18,18 +19,16 @@ class TestActivations(TestCase):
"""
input1.requires_grad = True
res = input1 * torch.tanh(F.softplus(input1))
output = res.sum()
output.backward()
res.backward(torch.ones_like(res))
return res.detach(), input1.grad
def npu_mish(self, input1):
input1.requires_grad = True
model = Mish()
res = model(input1)
output = res.sum()
output.backward()
res.backward(torch.ones_like(res))
return res.detach().cpu(), input1.grad.cpu()
def test_mish(self):
dtype_list = [np.float16, np.float32]
format_list = [-1, 0, 2]
+71
View File
@@ -0,0 +1,71 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.contrib.function import npu_bbox_coder_encode_yolo, \
npu_bbox_coder_encode_xyxy2xywh, npu_bbox_coder_decode_xywh2xyxy
class TestBboxCoder(TestCase):
def test_npu_bbox_coder_encode_xyxy2xywh(self):
np.random.seed(123)
data1 = np.random.randint(low=0, high=512, size=(6, 4))
bboxes = torch.tensor(data1, dtype=torch.int64)
data2 = np.random.randint(low=0, high=512, size=(6, 4))
gt_bboxes = torch.tensor(data2, dtype=torch.int64)
bboxes = bboxes.npu()
gt_bboxes = gt_bboxes.npu()
npuout_1 = npu_bbox_coder_encode_xyxy2xywh(bboxes, gt_bboxes)
npuout_2 = npu_bbox_coder_encode_xyxy2xywh(bboxes / 512., gt_bboxes / 512.,
is_normalized=True, normalized_scale=512.)
expect_cpu = torch.tensor([[1.1807, -0.7979, -0.4014, 0.7285],
[1.1064, -2.4883, -2.2051, 0.2026],
[1.3047, -6.5430, 2.0156, 0.8291],
[0.7993, -0.1396, -0.9336, 0.9038],
[-4.6250, -17.8906, 1.8389, 3.0938],
[-0.3145, -0.5000, -2.7676, 0.2954]], dtype=torch.float32)
self.assertRtolEqual(expect_cpu.numpy(), npuout_1.cpu().numpy())
self.assertRtolEqual(expect_cpu.numpy(), npuout_2.cpu().numpy())
def test_npu_bbox_coder_encode_yolo(self):
np.random.seed(234)
data1 = np.random.randint(low=0, high=512, size=(6, 4))
bboxes = torch.tensor(data1, dtype=torch.int64)
data2 = np.random.randint(low=0, high=512, size=(6, 4))
gt_bboxes = torch.tensor(data2, dtype=torch.int64)
stride = torch.randint(0, 32, size=(6,))
bboxes = bboxes.npu()
gt_bboxes = gt_bboxes.npu()
stride = stride.npu()
npu_output = npu_bbox_coder_encode_yolo(bboxes, gt_bboxes, stride)
expect_cpu = torch.tensor([[1.0000e-06, 1.0000e-06, -1.1692e+00, -8.7373e-01],
[1.0000e+00, 1.0000e-06, -1.3816e+01, -1.3816e+01],
[1.0000e-06, 1.0000e-06, 7.8846e-01, -6.0799e-01],
[8.5000e-01, 1.0000e-06, -1.3816e+01, -2.2460e+00],
[1.0000e+00, 6.5000e-01, -1.3312e+00, -1.3816e+01],
[1.0000e+00, 1.0000e-06, 4.1058e-01, 2.4875e+00]], dtype=torch.float32)
self.assertRtolEqual(expect_cpu.numpy(), npu_output.cpu().numpy())
def test_npu_bbox_coder_decode_xywh2xyxy(self):
max_shape = 512
np.random.seed(345)
data1 = np.random.randint(low=0, high=max_shape, size=(6, 4))
bboxes = torch.tensor(data1, dtype=torch.int64)
data2 = np.random.randn(6, 4)
pred_bboxes = torch.tensor(data2, dtype=torch.float32)
bboxes = bboxes.npu()
pred_bboxes = pred_bboxes.npu()
npu_output = npu_bbox_coder_decode_xywh2xyxy(bboxes, pred_bboxes,
max_shape=(max_shape, max_shape))
expect_cpu = torch.tensor([[69.6262, 511.0000, 116.1755, 274.9286],
[50.0117, 511.0000, 28.3380, 456.6909],
[354.6850, 227.5013, 275.1128, 219.0241],
[0.0000, 301.9681, 0.0000, 291.4622],
[201.7177, 84.3664, 325.5544, 87.1693],
[283.7152, 407.1944, 0.0000, 511.0000]], dtype=torch.float32)
self.assertRtolEqual(expect_cpu.numpy(), npu_output.cpu().numpy())
if __name__ == "__main__":
run_tests()
+47
View File
@@ -0,0 +1,47 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.contrib.module import BiLSTM
class TestBidirectionalLstm(TestCase):
def npu_bidirectional_lstm(self, input1):
input1 = input1.npu()
input1.requires_grad = True
rnn = BiLSTM(8, 4).npu()
input1.retain_grad()
output = rnn(input1)
output.backward(torch.ones(input1.size(), dtype=torch.float).npu())
input_grad = input1.grad.cpu()
return output.detach().cpu(), input_grad.cpu()
def test_bidirectional_lstm(self):
np.random.seed(123)
data1 = np.random.randn(2, 2, 8)
cpu_input = torch.tensor(data1, dtype=torch.float32)
npu_input = cpu_input.npu()
npu_output, npu_inputgrad = self.npu_bidirectional_lstm(npu_input)
expect_cpu_output = torch.tensor([[[0.1078, 0.0723, 0.0158, 0.1555, -0.0975, 0.0867, -0.1653, -0.0974],
[0.1635, 0.3083, -0.2793, 0.0748, -0.1528, 0.1982, -0.0063, 0.1506]],
[[0.0743, 0.1489, -0.0777, 0.0052, -0.2747, 0.0872, -0.1923, -0.2612],
[-0.1760, 0.2629, -0.2959, 0.0299, 0.3979, 0.1146, -0.1663, 0.0682]]],
dtype=torch.float32)
expect_cpu_inputgrad = torch.tensor([[[0.5643, -0.2415, -0.7003, -0.1445, 0.3078, 0.0442, -0.5876, -0.3430],
[-0.1395, 0.2832, -0.3813, 0.0043, 0.0973, 0.0093, -0.2702, -0.0069]],
[[-0.0751, -0.0903, -0.4377, -0.2069, 0.0934, -0.1738, -0.1134, -0.0765],
[0.3855, -0.1033, -0.2906, -0.2387, -0.0037, 0.0606, -0.2736, -0.1440]]],
dtype=torch.float32)
self.assertRtolEqual(expect_cpu_output, npu_output)
self.assertRtolEqual(expect_cpu_inputgrad, npu_inputgrad)
if __name__ == "__main__":
run_tests()
+55
View File
@@ -0,0 +1,55 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.contrib.module import LabelSmoothingCrossEntropy
class TestCrossentropy(TestCase):
def test_npu_crossentropy_1(self):
np.random.seed(123)
data1 = np.random.randn(2, 10)
x = torch.tensor(data1, dtype=torch.float32)
data2 = np.random.randint(low=0, high=10, size=(2,))
y = torch.tensor(data2, dtype=torch.float32)
x = x.npu()
y = y.npu()
x.requires_grad = True
m = LabelSmoothingCrossEntropy(10)
npu_output = m(x, y)
npu_output.backward()
expect_cpu_xgrad = torch.tensor([[0.0112, 0.0899, 0.0440, 0.0074, 0.0186, 0.1729, 0.0029, 0.0216,
0.1176, -0.4861],
[0.0085, 0.0152, 0.0744, -0.4912, 0.0107, 0.0108, 0.1520, 0.1491,
0.0457, 0.0246]], dtype=torch.float32)
self.assertRtolEqual(torch.tensor(3.8078), npu_output.detach().cpu())
self.assertRtolEqual(expect_cpu_xgrad, x.grad.cpu())
def test_npu_crossentropy_2(self):
np.random.seed(234)
data1 = np.random.randn(2, 10)
x = torch.tensor(data1, dtype=torch.float32)
data2 = np.random.randint(low=0, high=10, size=(2,))
y = torch.tensor(data2, dtype=torch.float32)
x = x.npu()
y = y.npu()
x.requires_grad = True
m = LabelSmoothingCrossEntropy(10, 0.1)
npu_output = m(x, y)
npu_output.backward()
expect_cpu_xgrad = torch.tensor([[6.6930e-02, 5.7021e-03, 3.9844e-02, 7.4777e-02, 2.3734e-02,
-4.1566e-03, 6.5645e-03, 7.5835e-02, -4.1660e-01, 1.2737e-01],
[1.4708e-02, 8.3806e-02, 4.2438e-03, 1.0031e-01, -4.3430e-04,
5.1546e-02, 1.3015e-01, 2.4124e-02, 2.7007e-02, -4.3545e-01]],
dtype=torch.float32)
self.assertRtolEqual(torch.tensor(3.0848), npu_output.cpu())
self.assertRtolEqual(expect_cpu_xgrad, x.grad.cpu())
if __name__ == "__main__":
run_tests()
+108
View File
@@ -0,0 +1,108 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.contrib.module import DCNv2
class TestDeformConv(TestCase):
def test_npu_deform_conv_1(self):
np.random.seed(226)
data1 = np.random.randn(2, 2, 3, 3)
x = torch.tensor(data1, dtype=torch.float32)
model = DCNv2(2, 2, 3, 2, 1)
x = x.npu()
x.requires_grad = True
model = model.npu()
output = model(x)
output.sum().backward()
expect_cpu_output = torch.tensor([[[[0.0077, 0.0699],
[0.1435, -0.0298]],
[[0.0494, -0.1641],
[-0.4070, -0.0126]]],
[[[0.2375, -0.3983],
[-0.3438, 0.2228]],
[[-0.0948, -0.1294],
[-0.1455, -0.1956]]]], dtype=torch.float32)
expect_cpu_xgrad = torch.tensor([[[[0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355]],
[[-0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422]]],
[[[0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355]],
[[-0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422]]]], dtype=torch.float32)
self.assertRtolEqual(expect_cpu_output, output.detach().cpu())
self.assertRtolEqual(expect_cpu_xgrad, x.grad.cpu())
def test_npu_deform_conv_2(self):
np.random.seed(546)
data1 = np.random.randn(2, 2, 5, 5)
x = torch.tensor(data1, dtype=torch.float32)
model = DCNv2(2, 2, 3, 2, 1)
x = x.npu()
x.requires_grad = True
model = model.npu()
output = model(x)
output.sum().backward()
expect_cpu_output = torch.tensor([[[[-0.1421, -0.0099, -0.2894],
[-0.0360, -0.4846, 0.2676],
[-0.2791, 0.0011, -0.0440]],
[[0.0051, -0.1212, 0.0374],
[-0.0317, 0.0370, -0.0739],
[0.1564, 0.0738, -0.2175]]],
[[[-0.3272, -0.0703, 0.1305],
[-0.0163, 0.1823, -0.0286],
[-0.5419, 0.1746, 0.1011]],
[[-0.0256, 0.6328, 0.0427],
[-0.4237, 0.0432, 0.2582],
[0.3830, -0.0413, -0.0663]]]], dtype=torch.float32)
expect_cpu_xgrad = torch.tensor([[[[0.0355, 0.1740, 0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355, 0.1740, 0.0355]],
[[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422]]],
[[[0.0355, 0.1740, 0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355, 0.1740, 0.0355],
[0.1678, 0.0109, 0.1678, 0.0109, 0.1678],
[0.0355, 0.1740, 0.0355, 0.1740, 0.0355]],
[[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422],
[-0.0641, 0.2660, -0.0641, 0.2660, -0.0641],
[-0.1422, -0.2028, -0.1422, -0.2028, -0.1422]]]], dtype=torch.float32)
self.assertRtolEqual(expect_cpu_output, output.detach().cpu())
self.assertRtolEqual(expect_cpu_xgrad, x.grad.cpu())
if __name__ == "__main__":
run_tests()
+18
View File
@@ -0,0 +1,18 @@
from PIL import Image
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.contrib.module import FusedColorJitter
class TestFusedColorJitter(TestCase):
def test_fusedcolorjitter(self):
image = Image.fromarray(torch.randint(0, 256, size=(224, 224, 3)).numpy().astype(np.uint8))
fcj = FusedColorJitter(0.1, 0.1, 0.1, 0.1)
output = fcj(image)
self.assertEqual(output is not None, True)
if __name__ == "__main__":
run_tests()
@@ -14,8 +14,8 @@ class TestIou(TestCase):
box2 = box2.float().npu()
iou1 = npu_iou(box1, box2, mode="iou")
iou2 = npu_iou(box1, box2)
expedt_iou1 = torch.tensor([[0.5469, 0.2373]], dtype=torch.float32)
expedt_iou2 = torch.tensor([[0.5469, 0.2373]], dtype=torch.float32)
expedt_iou1 = torch.tensor([[0.5474, 0.2373]], dtype=torch.float32)
expedt_iou2 = torch.tensor([[0.5474, 0.2373]], dtype=torch.float32)
self.assertRtolEqual(expedt_iou1, iou1.cpu())
self.assertRtolEqual(expedt_iou2, iou2.cpu())
@@ -41,8 +41,8 @@ class TestIou(TestCase):
box2 = box2.float().npu() / 100.
iou1 = npu_iou(box1, box2, mode="iou", is_normalized=True, normalized_scale=100.)
iou2 = npu_iou(box1, box2, is_normalized=True, normalized_scale=100.)
expedt_iou1 = torch.tensor([[0.5469, 0.2373]], dtype=torch.float32)
expedt_iou2 = torch.tensor([[0.5469, 0.2373]], dtype=torch.float32)
expedt_iou1 = torch.tensor([[0.5474, 0.2373]], dtype=torch.float32)
expedt_iou2 = torch.tensor([[0.5474, 0.2373]], dtype=torch.float32)
self.assertRtolEqual(expedt_iou1, iou1.cpu())
self.assertRtolEqual(expedt_iou2, iou2.cpu())
+33
View File
@@ -0,0 +1,33 @@
import unittest
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.contrib.module import LinearA8W8Quant
DEVICE_NAME = torch_npu.npu.get_device_name(0)[:10]
class TestLinearA8W8Quant(TestCase):
def npu_linear_quant(self, in_features, out_features, x1, x2, scale):
model = LinearA8W8Quant(in_features, out_features, bias=False, pertoken_scale=False, offset=False)
model = model.npu()
model.weight.data = x2
model.scale.data = scale
output = model(x1)
return output
@unittest.skipIf(DEVICE_NAME == 'Ascend910A' or DEVICE_NAME == 'Ascend310P',
"OP `QuantBatchMatmulV3` is not only supported on 910A and 310P, skip this ut for this device type!")
def test_npu_linear_quant(self):
x1 = torch.randint(-1, 1, (1, 5), dtype=torch.int8).npu()
x2 = torch.randint(-1, 1, (127, 5), dtype=torch.int8).npu()
scale = torch.randn(1, dtype=torch.float32).npu()
supported_output = torch_npu.npu_quant_matmul(x1, x2.t(), scale)
in_features = 5
out_features = 127
npu_out = self.npu_linear_quant(in_features, out_features, x1, x2, scale)
self.assertRtolEqual(supported_output, npu_out, 0.001)
if __name__ == "__main__":
run_tests()
+71
View File
@@ -0,0 +1,71 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.contrib.module import LinearWeightQuant
DEVICE_NAME = torch_npu.npu.get_device_name(0)[:10]
def f32_2_s9(array):
array_round = np.round(array)
array_round_clip = np.clip(array_round, -256, 255)
return array_round_clip
class TestLinearWeightQuant(TestCase):
def cpu_linear_weight_quant(self, weight_cpu, x_cpu, antiquant_scale_cpu, antiquant_offset_cpu):
x_cpu = x_cpu.to(torch.float32)
antiquant_weight = (weight_cpu + antiquant_offset_cpu) * antiquant_scale_cpu
antiquant_weight = antiquant_weight.to(torch.float32)
cpu_out = torch.matmul(x_cpu, antiquant_weight).numpy()
cpu_out = cpu_out.astype("float16")
return cpu_out
def npu_linear_weight_quant(self, in_features, out_features, antiquant_scale, weight, x, antiquant_offset=None):
model = LinearWeightQuant(in_features,
out_features,
bias=False,
device=torch.device(f'npu:0'),
dtype=x.dtype,
antiquant_offset=True,
quant_scale=False,
quant_offset=False,
antiquant_group_size=0
)
model = model.npu()
model.weight.data = weight
model.antiquant_scale.data = antiquant_scale
model.antiquant_offset.data = antiquant_offset
npu_out = model(x)
return npu_out
@unittest.skipIf(DEVICE_NAME != 'Ascend910B',
"OP `WeightQuantBatchMatmulV2` is only supported on 910B, skip this ut for this device type!")
def test_npu_linear_weight_quant(self):
m = 1024
k = 11264
n = 1664
x_cpu = torch.randn((m, k), dtype=torch.float16)
weight_cpu = torch.randn((n, k), dtype=torch.float16)
weight_cpu = weight_cpu.to(torch.int8)
weight_cpu = weight_cpu.to(torch.float16)
weight_cpu_trans = weight_cpu.transpose(0, 1)
antiquant_scale_cpu = torch.randn((n), dtype=torch.float16)
antiquant_offset_cpu = torch.randn((n), dtype=torch.float16)
x_npu = x_cpu.npu()
weight_npu = weight_cpu_trans.to(torch.int8).npu()
antiquant_scale_npu = antiquant_scale_cpu.npu()
antiquant_offset_npu = antiquant_offset_cpu.npu()
npu_out = self.npu_linear_weight_quant(k, n, antiquant_scale_npu, weight_npu, x_npu, antiquant_offset_npu)
cpu_out = self.cpu_linear_weight_quant(weight_cpu_trans, x_cpu, antiquant_scale_cpu, antiquant_offset_cpu)
npu_out = npu_out.cpu()
self.assertRtolEqual(cpu_out, npu_out.numpy(), 0.01)
if __name__ == "__main__":
run_tests()
+76
View File
@@ -0,0 +1,76 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.contrib.function import npu_multiclass_nms, \
npu_batched_multiclass_nms
class TestMultiClassNms(TestCase):
def test_npu_multiclass_nms_1(self):
np.random.seed(123)
data1 = np.random.randint(low=1, high=255, size=(1000, 4))
boxes = torch.tensor(data1, dtype=torch.int64)
data2 = np.random.randn(1000, 81)
scores = torch.tensor(data2, dtype=torch.float32)
boxes = boxes.npu().half()
scores = scores.npu().half()
det_bboxes, det_labels = npu_multiclass_nms(boxes, scores, score_thr=0.3, nms_thr=0.5, max_num=3)
expect_det_bboxes = torch.tensor([[81.9375, 183.8750, 35.0000, 172.0000, 4.1797],
[52.0000, 47.0000, 196.8750, 67.0000, 3.8750],
[76.0000, 140.0000, 42.0000, 132.0000, 3.8613]], dtype=torch.float16)
expect_det_labels = torch.tensor([69., 31., 48.], dtype=torch.float16)
self.assertRtolEqual(expect_det_bboxes, det_bboxes.cpu())
self.assertRtolEqual(expect_det_labels, det_labels.cpu())
def test_npu_multiclass_nms_2(self):
np.random.seed(123)
data1 = np.random.randn(1000, 4)
boxes = torch.tensor(data1, dtype=torch.float32)
data2 = np.random.randn(1000, 81)
scores = torch.tensor(data2, dtype=torch.float32)
boxes = boxes.npu().half()
scores = scores.npu().half()
det_bboxes, det_labels = npu_multiclass_nms(boxes, scores, score_thr=0.3, nms_thr=0.5, max_num=3)
expect_det_bboxes = torch.tensor([[0.1643, 0.7480, 0.1807, -0.2734, 4.1836],
[-0.9736, -0.1373, 0.9473, 1.0938, 4.1641],
[1.5234, -0.6831, -1.8359, 1.1035, 4.0664]], dtype=torch.float16)
expect_det_labels = torch.tensor([46., 8., 69.], dtype=torch.float16)
self.assertRtolEqual(expect_det_bboxes, det_bboxes.cpu())
self.assertRtolEqual(expect_det_labels, det_labels.cpu())
def test_npu_batched_multiclass_nms_1(self):
np.random.seed(339)
data1 = np.random.randint(low=1, high=255, size=(4, 200, 80, 4))
boxes = torch.tensor(data1, dtype=torch.int64)
data2 = np.random.randn(4, 200, 81)
scores = torch.tensor(data2, dtype=torch.float32)
boxes = boxes.npu().half()
scores = scores.npu().half()
det_bboxes, det_labels = npu_batched_multiclass_nms(boxes, scores, score_thr=0.3, nms_thr=0.5, max_num=3)
expect_det_bboxes = torch.tensor([[[195.0000, 133.0000, 123.0000, 36.0000, 4.3984],
[70.0000, 113.0000, 149.0000, 22.9844, 3.8184],
[203.0000, 250.0000, 9.0000, 81.9375, 3.5996]],
[[60.0000, 19.0000, 233.8750, 142.0000, 3.7852],
[147.0000, 218.0000, 223.0000, 86.9375, 3.6426],
[19.0000, 113.0000, 91.9375, 238.8750, 3.5449]],
[[163.8750, 47.9688, 221.8750, 218.0000, 3.8281],
[5.9961, 81.9375, 110.0000, 171.0000, 3.7734],
[155.0000, 133.0000, 138.0000, 108.0000, 3.4844]],
[[238.8750, 78.0000, 188.0000, 17.0000, 3.9121],
[79.0000, 115.9375, 83.0000, 246.0000, 3.5879],
[11.0000, 94.0000, 243.0000, 226.8750, 3.4805]]], dtype=torch.float16)
expect_det_labels = torch.tensor([[27., 36., 78.],
[19., 27., 39.],
[54., 18., 27.],
[72., 43., 31.]], dtype=torch.float16)
self.assertRtolEqual(expect_det_bboxes, det_bboxes.cpu())
self.assertRtolEqual(expect_det_labels, det_labels.cpu())
if __name__ == "__main__":
run_tests()
@@ -1,8 +1,8 @@
import unittest
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.contrib.module import ROIAlign
@@ -12,7 +12,7 @@ class TestRoiAlign(TestCase):
input1.requires_grad_(True)
roi.requires_grad_(True)
model = ROIAlign(output_size, spatial_scale, sampling_ratio).npu()
model = ROIAlign(output_size, spatial_scale, sampling_ratio, aligned=aligned).npu()
output = model(input1, roi)
output.sum().backward()
return output.detach().cpu(), input1.grad.cpu()
@@ -41,12 +41,12 @@ class TestRoiAlign(TestCase):
[16.5000, 18.5000, 20.5000],
[28.5000, 30.5000, 32.5000]]]],
dtype=torch.float32)
expedt_cpu_inputgrad = torch.tensor([[[[0.2397, 0.2346, 0.2346, 0.2346, 0.2346, 0.2907],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2907, 0.2845, 0.2845, 0.2845, 0.2845, 0.3525]]]],
expedt_cpu_inputgrad = torch.tensor([[[[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500],
[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500],
[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500],
[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500],
[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500],
[0.2500, 0.2500, 0.2500, 0.2500, 0.2500, 0.2500]]]],
dtype=torch.float32)
self.assertRtolEqual(expedt_cpu_output, npu_output)
@@ -65,12 +65,12 @@ class TestRoiAlign(TestCase):
expedt_cpu_output = torch.tensor([[[[2.7500, 4.5000, 6.5000],
[13.2500, 15.0000, 17.0000],
[25.2500, 27.0000, 29.0000]]]], dtype=torch.float32)
expedt_cpu_inputgrad = torch.tensor([[[[0.2397, 0.2346, 0.2346, 0.2346, 0.2346, 0.2907],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2346, 0.2296, 0.2296, 0.2296, 0.2296, 0.2845],
[0.2907, 0.2845, 0.2845, 0.2845, 0.2845, 0.3525]]]],
expedt_cpu_inputgrad = torch.tensor([[[[0.5625, 0.3750, 0.3750, 0.3750, 0.3750, 0.1875],
[0.3750, 0.2500, 0.2500, 0.2500, 0.2500, 0.1250],
[0.3750, 0.2500, 0.2500, 0.2500, 0.2500, 0.1250],
[0.3750, 0.2500, 0.2500, 0.2500, 0.2500, 0.1250],
[0.3750, 0.2500, 0.2500, 0.2500, 0.2500, 0.1250],
[0.1875, 0.1250, 0.1250, 0.1250, 0.1250, 0.0625]]]],
dtype=torch.float32)
self.assertRtolEqual(expedt_cpu_output, npu_output)
@@ -1,10 +1,12 @@
import time
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.testing.common_utils import create_common_tensor, SupportedDevices
from torch_npu.contrib.function import roll
@@ -48,6 +50,23 @@ class TestRoll(TestCase):
slow_output, slow_time = self.npu_slow_roll_op_exec(npu_input, shift_size, (1, 2))
fast_output, fast_time = self.npu_fast_roll_op_exec(npu_input, shift_size, (1, 2))
self.assertRtolEqual(slow_output, fast_output)
if item[0] == np.uint8:
continue
self.assertTrue(slow_time > fast_time)
@SupportedDevices(['Ascend910B'])
def test_roll_shape_format_uint8(self):
dtype_list = [np.uint8]
format_list = [-1, 2]
shape_list = [[32, 56, 56, 16]]
shape_format = [
[i, j, k] for i in dtype_list for j in format_list for k in shape_list
]
for item in shape_format:
_, npu_input = create_common_tensor(item, -10, 10)
shift_size = 3
slow_output, slow_time = self.npu_slow_roll_op_exec(npu_input, shift_size, (1, 2))
fast_output, fast_time = self.npu_fast_roll_op_exec(npu_input, shift_size, (1, 2))
self.assertTrue(slow_time > fast_time)
@@ -40,6 +40,23 @@ class TestTransferToNpu(TestCase):
c = a.to(device_id)
d = torch.tensor(1, device=device_id)
def test_wrap_autocast(self):
a = torch.randn([3, 3], device='cuda')
b = torch.randn([3, 3], device='cuda')
c = a @ b
c_before_autocast = c.dtype
with torch.autocast('cuda'):
c = a @ b
c_after_autocast_args = c.dtype
with torch.autocast(device_type='cuda'):
c = a @ b
c_after_autocast_kwargs = c.dtype
self.assertNotEqual(c_before_autocast, c_after_autocast_args)
self.assertEqual(c_after_autocast_args, c_after_autocast_kwargs)
if __name__ == "__main__":
run_tests()
@@ -0,0 +1,11 @@
#include <torch/extension.h>
void foo() { }
TORCH_LIBRARY_IMPL(__test, CPU, m) {
m.impl("foo", foo);
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("bar", foo);
}
@@ -0,0 +1,56 @@
#include <sys/types.h>
#include <iostream>
#include <torch/extension.h>
#include "third_party/acl/inc/acl/acl_base.h"
#include "third_party/acl/inc/acl/acl_rt.h"
#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"
extern "C" {
using c10_npu::NPUCachingAllocator::DeviceStats;
using c10_npu::NPUCachingAllocator::SnapshotInfo;
static bool useflag = false;
void* my_malloc(ssize_t size, int device, aclrtStream stream)
{
void *ptr;
aclrtMallocAlign32(&ptr, size, aclrtMemMallocPolicy::ACL_MEM_MALLOC_HUGE_FIRST);
std::cout<<"alloc ptr = "<<ptr<<", size = "<<size<<std::endl;
useflag = true;
return ptr;
}
void my_free(void* ptr, ssize_t size, int device, aclrtStream stream)
{
std::cout<<"free ptr = "<<ptr<<std::endl;
aclrtFree(ptr);
}
bool check_custom_allocator_used()
{
return useflag;
}
DeviceStats my_get_device_stats(int device)
{
DeviceStats stats;
return stats;
}
void my_reset_peak_status(int device)
{
std::cout<<"resetPeakStatus success!"<<std::endl;
}
SnapshotInfo my_snapshot()
{
SnapshotInfo result;
return result;
}
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("my_malloc", &my_malloc, "");
m.def("my_free", &my_free, "");
m.def("check_custom_allocator_used", &check_custom_allocator_used, "");
}
@@ -1,15 +1,16 @@
import math
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
from torch_npu.testing.common_utils import SupportedDevices
class TestIncreFlashAttention(TestCase):
def supported_op_exec(self, query, key, value):
def supported_op_exec(self, query_states1, past_key, past_value, head_dim, hidden_size):
attn_weights1 = torch.matmul(query_states1, past_key.transpose(2, 3)) / 0.0078125
attn_weights1 = torch.max(attn_weights1, torch.full(
(1, 1), torch.finfo(attn_weights1.dtype).min, device=attn_weights1.device))
@@ -24,10 +25,11 @@ class TestIncreFlashAttention(TestCase):
tensor = torch.reshape(tensor, (tensor.shape[0], tensor.shape[1], -1))
return tensor
def custom_op_exec(self, query, key, value, head_dim):
def custom_op_exec(self, query, key, value, head_dim, hidden_size):
scale = 1 / 0.0078125
return torch_npu.npu_incre_flash_attention(q, k, v, num_heads=32, input_layout="BSH", scale_value=scale)
return torch_npu.npu_incre_flash_attention(query, key, value, num_heads=32, input_layout="BSH", scale_value=scale)
@SupportedDevices(['Ascend910B'])
def test_npu_incre_flash_attention(self, device="npu"):
q = torch.randn(1, 32, 1, 128, dtype=torch.float16).npu()
@@ -0,0 +1,33 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import SupportedDevices
class TestMaskedSoftmaxWithRelPosBias(TestCase):
def supported_op_exec(self, x, relative_pos_bias, atten_mask):
# add + add + softmax
y = torch.add(x, atten_mask)
y = torch.add(y, relative_pos_bias)
softmax_out = torch.nn.functional.softmax(y, dim=-1)
return softmax_out.cpu()
def custom_op_exec(self, x, relative_pos_bias, atten_mask):
return torch_npu.npu_masked_softmax_with_rel_pos_bias(x, atten_mask, relative_pos_bias).cpu()
@SupportedDevices(['Ascend910B'])
def test_npu_masked_softmax_with_rel_pos_bias(self, device="npu"):
x = torch.randn(1, 2, 3, 4, 4, dtype=torch.float)
relative_pos_bias = torch.randn(1, 1, 3, 4, 4, dtype=torch.float)
atten_mask = torch.randn(1, 2, 1, 4, 4, dtype=torch.float)
supported_output = self.supported_op_exec(x, relative_pos_bias, atten_mask)
custom_output = self.custom_op_exec(x.npu(), relative_pos_bias.npu(), atten_mask.npu())
self.assertRtolEqual(supported_output, custom_output)
if __name__ == "__main__":
run_tests()
+55
View File
@@ -0,0 +1,55 @@
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import create_common_tensor
DEVICE_NAME = torch_npu.npu.get_device_name(0)[:10]
class TestAntiQuant(TestCase):
def custom_op_exec(self, input_x, scale, offset, dst_dtype, src_dtype):
scale = torch.broadcast_to(scale, input_x.shape)
if offset is None:
offset = torch.zeros_like(scale)
x = input_x.to(torch.float32)
offset_temp = x + offset
output = offset_temp * scale
output = output.to(dst_dtype)
return output.cpu().detach()
def npu_op_exec(self, input_x, scale, offset, dst_dtype, src_dtype):
output = torch_npu.npu_anti_quant(input_x, scale, offset=offset, dst_dtype=dst_dtype, src_dtype=src_dtype)
return output.cpu().detach()
@unittest.skipIf(DEVICE_NAME != 'Ascend910B',
"OP `AntiQuant` is only supported on 910B, skip this ut for this device type!")
def test_anti_quant(self, device="npu"):
shape_format = [
[[np.int8, -1, [10, 100]], [np.float32, -1, [100]], [np.float32, -1, [100]], torch.float16, None],
[[np.int8, -1, [10, 100]], [np.float32, -1, [100]], [np.float32, -1, [100]], torch.bfloat16, None],
[[np.int8, -1, [10, 100]], [np.float32, -1, [100]], [np.float32, -1, [100]], torch.float16, torch.int8],
[[np.int8, -1, [10, 100]], [np.float32, -1, [100]], [np.float32, -1, [100]], torch.bfloat16, torch.int8],
]
for item in shape_format:
cpu_input_x, npu_input_x = create_common_tensor(item[0], -127, 127)
cpu_scale, npu_scale = create_common_tensor(item[1], -100, 100)
cpu_offset, npu_offset = (None, None) if item[2] is None else create_common_tensor(item[2], -100, 100)
npu_output = self.npu_op_exec(npu_input_x, npu_scale, npu_offset, *item[3:])
custom_output = self.custom_op_exec(cpu_input_x, cpu_scale, cpu_offset, *item[3:])
if item[3] == torch.bfloat16:
npu_output = npu_output.to(torch.float32)
custom_output = custom_output.to(torch.float32)
self.assertRtolEqual(npu_output, custom_output)
if __name__ == "__main__":
run_tests()
@@ -1,3 +1,4 @@
import unittest
import torch
import torch_npu
@@ -63,6 +64,7 @@ class TestBoundingBoxDecode(TestCase):
output = output.numpy()
return output
@unittest.skip("skip test_decode_shape_format_fp32 now")
def test_decode_shape_format_fp32(self):
input1 = torch.tensor([[1., 2., 3., 4.], [3., 4., 5., 6.]],
dtype=torch.float32).to("npu")
@@ -75,6 +77,7 @@ class TestBoundingBoxDecode(TestCase):
1, 1, 1, 1, (10, 10), 0.1)
self.assertRtolEqual(npu_output, custom_output)
@unittest.skip("skip test_decode_shape_format_fp16 now")
def test_decode_shape_format_fp16(self):
input1_fp16 = torch.tensor([[1., 2., 3., 4.], [3., 4., 5., 6.]],
dtype=torch.float16).to("npu")
@@ -19,7 +19,8 @@ class TestFusedAttentionQKV(TestCase):
v_kernel = torch_npu.npu_format_cast(v_kernel.t().contiguous(), 29)
norm_shape = (1024,)
norm, mean, variance = torch.native_layer_norm(ln_input, norm_shape, gamma, beta, eps=1e-05)
norm, mean, _ = torch.native_layer_norm(ln_input, norm_shape, gamma, beta, eps=1e-05)
variance = torch.var(ln_input, -1, keepdim=False, unbiased=False)
q_layer = self.confusion_transpose(torch.nn.functional.linear(norm, q_kernel, q_bias), (24, 512, 16, 64))
k_layer = self.confusion_transpose(torch.nn.functional.linear(norm, k_kernel, k_bias), (24, 512, 16, 64))
v_layer = self.confusion_transpose(torch.nn.functional.linear(norm, v_kernel, v_bias), (24, 512, 16, 64))
@@ -0,0 +1,89 @@
import math
import unittest
import numpy as np
import torch
import torch_npu
from torch_npu.testing.testcase import TestCase, run_tests
from torch_npu.testing.common_utils import SupportedDevices
class TestNPUFlashAttention(TestCase):
def supported_op_exec(self, query, key, value, atten_mask):
scale = 0.08838
qk = torch.matmul(query, key.transpose(2, 3)).mul(scale)
qk = qk + atten_mask * (-10000.0)
softmax_res = torch.nn.functional.softmax(qk, dim=-1, dtype=torch.float32).to(torch.float16)
attention_out = torch.matmul(softmax_res, value)
return attention_out
def custom_op_exec(self, query, key, value, sparse_params):
scale = 0.08838
atten_mask = None
if sparse_params[0] == 0:
shape = [1, 8, 256, 256]
atten_mask_u = np.triu(np.ones(shape), k=sparse_params[1] + 1)
atten_mask_l = np.tril(np.ones(shape), k=-sparse_params[2] - 1)
atten_masks = atten_mask_u + atten_mask_l
atten_mask = torch.tensor(atten_masks).to(torch.float16).bool().npu()
if sparse_params[0] == 2 or sparse_params[0] == 3 or sparse_params[0] == 4:
atten_masks = torch.from_numpy(np.triu(np.ones([2048, 2048]), k=1))
atten_mask = torch.tensor(atten_masks).to(torch.float16).bool().npu()
return torch_npu.npu_fusion_attention(
query, key, value, head_num=8, input_layout="BNSD", scale=scale, sparse_mode=sparse_params[0],
atten_mask=atten_mask, pre_tockens=sparse_params[1], next_tockens=sparse_params[2])
def get_atten_mask(self, sparse_mode=0, pre_tokens=65536, next_tokens=65536):
atten_masks = []
shape = [1, 8, 256, 256]
if sparse_mode == 0:
atten_mask_u = np.triu(np.ones(shape), k=next_tokens + 1)
atten_mask_l = np.tril(np.ones(shape), k=-pre_tokens - 1)
atten_masks = atten_mask_u + atten_mask_l
elif sparse_mode == 1:
atten_masks = np.zeros(shape)
pre_tokens = 65536
next_tokens = 65536
elif sparse_mode == 2:
atten_masks = np.triu(np.ones(shape), k=1)
elif sparse_mode == 3:
atten_masks = np.triu(np.ones(shape), k=1)
elif sparse_mode == 4:
atten_mask_u = np.triu(np.ones(shape), k=next_tokens + 1)
atten_mask_l = np.tril(np.ones(shape), k=-pre_tokens - 1)
atten_masks = atten_mask_u + atten_mask_l
atten_mask = torch.tensor(atten_masks).to(torch.float16)
return atten_mask
# sparse_params = [sparse_mode, pre_tokens, next_tokens]
def check_result(self, query, key, value, sparse_params):
atten_mask = self.get_atten_mask(sparse_params[0], sparse_params[1], sparse_params[2])
output = self.supported_op_exec(query, key, value, atten_mask)
fa_result = self.custom_op_exec(query.npu(), key.npu(), value.npu(), sparse_params)
self.assertRtolEqual(output, fa_result[0], prec=0.01, prec16=0.01)
@SupportedDevices(['Ascend910B'])
def test_npu_flash_attention(self, device="npu"):
query = torch.randn(1, 8, 256, 256, dtype=torch.float16)
key = torch.randn(1, 8, 256, 256, dtype=torch.float16)
value = torch.randn(1, 8, 256, 256, dtype=torch.float16)
# sparse_params: [sparse_mode, pre_tokens, next_tokens]
sparse_params_list = [
[0, 128, 128],
[1, 65536, 65536],
[2, 65536, 0],
[3, 65536, 0],
[4, 128, 128]
]
for sparse_params in sparse_params_list:
self.check_result(query, key, value, sparse_params)
if __name__ == "__main__":
run_tests()
@@ -53,7 +53,7 @@ class TestNpuIndexing(TestCase):
return out
def npu_op_exec(self, mat, begin, end, strides):
output = torch.npu_indexing(mat, begin, end, strides)
output = torch_npu.npu_indexing(mat, begin, end, strides)
return output
def split_op_exec(self, mat, begin, end, strides):
@@ -1,3 +1,4 @@
import unittest
import torch
import torch_npu
@@ -38,6 +39,7 @@ class TestNpuIou(TestCase):
output = output.numpy()
return output
@unittest.skip("skip test_iou_fp16 now")
def test_iou_fp16(self):
bboxes = torch.tensor([[0, 0, 10, 10],
[10, 10, 20, 20],
@@ -54,6 +56,7 @@ class TestNpuIou(TestCase):
output_custom = self.custom_op_exec(bboxes, gtboxes)
self.assertRtolEqual(output_npu, output_custom)
@unittest.skip("skip test_iou_fp16_pt now")
def test_iou_fp16_pt(self):
bboxes = torch.tensor([[1, 2, 3, 4],
[5, 6, 7, 8],

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