Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

config.yml 55 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
  1. version: 2.1
  2. parameters:
  3. ad_hoc_container_build:
  4. type: boolean
  5. default: false
  6. ad_hoc_container_build_code_only:
  7. type: boolean
  8. default: false
  9. remote_docker_version:
  10. type: string
  11. description: remote docker version
  12. default: "20.10.18"
  13. sg_docker_version:
  14. type: string
  15. description: the version of super gradients docker image
  16. default: "2.0.0"
  17. build_py_version:
  18. type: string
  19. description: Python version
  20. default: "3.8"
  21. run_sanity_tests_flow:
  22. type: boolean
  23. description: If true will run sanity_test flow
  24. default: false
  25. run_and_convert_notebooks_to_docs:
  26. type: boolean
  27. description: If true will run run_and_convert_notebooks_to_docs flow
  28. default: false
  29. skip_md_files:
  30. type: boolean
  31. default: true
  32. orb_version:
  33. type: string
  34. description: Deci ai ORB version https://circleci.com/developer/orbs/orb/deci-ai/circleci-common-orb
  35. default: "10.5.1"
  36. # default: "dev:alpha"
  37. orbs:
  38. deci-common: deci-ai/circleci-common-orb@<< pipeline.parameters.orb_version >>
  39. aws-ecr: circleci/aws-ecr@8.2.1
  40. docker: circleci/docker@2.2.0
  41. slack: circleci/slack@4.12.0 # see https://circleci.com/developer/orbs/orb/circleci/slack for examples and more
  42. # This filter operates on SemVer2 tags only
  43. release_tag_filter: &release_tag_filter
  44. filters:
  45. branches:
  46. ignore: /.*/
  47. tags:
  48. only: /^\d+\.\d+\.\d+$/
  49. release_candidate_filter: &release_candidate_filter
  50. filters:
  51. branches:
  52. # Apply to master branch and other branches that start with "master"
  53. only: /^master.*/
  54. release_candidate_tag_filter: &release_candidate_tag_filter
  55. filters:
  56. branches:
  57. ignore: /.*/
  58. tags:
  59. only: /^\d+\.\d+\.\d+rc\d+/
  60. commands:
  61. build_and_publish_command:
  62. parameters:
  63. repo_name:
  64. type: string
  65. docker_context:
  66. type: string
  67. image_tag:
  68. type: string
  69. additional_tags:
  70. type: string
  71. build_args:
  72. type: string
  73. default: ""
  74. dockerfile:
  75. type: string
  76. default: "Dockerfile"
  77. steps:
  78. - checkout
  79. - attach_workspace:
  80. at: ~/
  81. - run:
  82. name: Put config dir in repo context
  83. command: |
  84. if [ -d ~/.config ]; then
  85. echo "found a .config directory, copying to repo dir"
  86. cp -r ~/.config ~/project/<< parameters.docker_context >>
  87. fi
  88. - deci-common/ecr_login_dev
  89. - deci-common/container_image_build:
  90. context: << parameters.docker_context >>
  91. working_directory: "."
  92. repository_name: << parameters.repo_name >>
  93. image_tag: << parameters.image_tag >>
  94. dockerfile: << parameters.dockerfile >>
  95. build_args: << parameters.build_args >>
  96. # build_args: "PYTHON_VERSION=3.8 SG_VERSION=3.0.7"
  97. - deci-common/push_docker_image_aws_dev:
  98. repository_name: << parameters.repo_name >>
  99. image_tag: << parameters.image_tag >>
  100. additional_tags: << parameters.additional_tags >>
  101. get_beta_and_rc_tags:
  102. description: "getting beta and rc tag (if exist) according to ouir convention"
  103. steps:
  104. - attach_workspace:
  105. at: ~/
  106. - run:
  107. name: push BETA_TAG and RC_TAG variable to BASH_ENV
  108. command: |
  109. if [[ -f ~/BETA_TAG ]]; then
  110. echo 'export BETA_TAG="$(cat ~/BETA_TAG)"' >> "$BASH_ENV"
  111. source $BASH_ENV
  112. fi
  113. if [[ -f ~/RC_TAG ]]; then
  114. echo 'export RC_TAG="$(cat ~/RC_TAG)"' >> "$BASH_ENV"
  115. source $BASH_ENV
  116. fi
  117. echo "RC_TAG=$RC_TAG || BETA_TAG=$BETA_TAG"
  118. adding_tag_to_ecr_container_image:
  119. description: adding a tag to an existing container image
  120. parameters:
  121. image_repo:
  122. type: string
  123. new_image_tag:
  124. type: string
  125. source_image_tag:
  126. type: string
  127. steps:
  128. - deci-common/run_on_dev_account:
  129. command: |
  130. MANIFEST=$(aws ecr batch-get-image --repository-name << parameters.image_repo >> --image-ids imageTag=<< parameters.source_image_tag >> --query 'images[].imageManifest' --output text)
  131. aws ecr put-image --repository-name << parameters.image_repo >> --image-tag << parameters.new_image_tag >> --image-manifest "$MANIFEST"
  132. echo "added tag: << parameters.new_image_tag >> to image: << parameters.image_repo >>:<< parameters.new_image_tag >>"
  133. jobs:
  134. build:
  135. parallelism: 16 # Adjust based on your needs
  136. environment:
  137. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  138. parameters:
  139. py_version:
  140. type: string
  141. default: latest
  142. package_name:
  143. type: string
  144. docker:
  145. - image: cimg/python:<< parameters.py_version >>
  146. resource_class: large
  147. steps:
  148. - deci-common/checkout_and_skip_build:
  149. check_version_file: true
  150. skip_md_files: << pipeline.parameters.skip_md_files >>
  151. - deci-common/get_persisted_version_info
  152. - unless:
  153. condition:
  154. equal: [ master, << pipeline.git.branch >> ]
  155. steps:
  156. - run:
  157. name: install Black Flake8 python linter
  158. command: |
  159. pip install --user -r requirements.dev.txt
  160. - run:
  161. name: Lint all python files changed since develop branch
  162. command: |
  163. flake8 --statistics --config scripts/flake8-config setup.py $(git diff --diff-filter ACM origin/master --name-only | grep 'py$' | grep -v 'experimental/' | grep -v 'experimental_models/')
  164. - run:
  165. name: Run Black on changed files against master branch
  166. command: |
  167. black --check setup.py $(git diff --diff-filter ACM origin/master --name-only | grep 'py$' | grep -v 'experimental/' | grep -v 'experimental_models/')
  168. - run:
  169. name: add requirements.txt and requirements.pro.txt to source code
  170. command: |
  171. cp requirements.txt src/super_gradients/requirements.txt
  172. cp requirements.pro.txt src/super_gradients/requirements.pro.txt
  173. - run:
  174. name: install python dependencies
  175. command: |
  176. python3 -m venv venv
  177. . venv/bin/activate
  178. python3 -m pip install pip==23.1.2
  179. python3 -m pip install -r requirements.txt
  180. python3 -m pip install -r requirements.dev.txt
  181. - run:
  182. name: edit package version
  183. command: |
  184. echo "${NEW_VERSION}" > version.txt
  185. cat version.txt
  186. - run:
  187. name: setup custom environment variables
  188. command: |
  189. echo 'export UPLOAD_LOGS=FALSE' >> $BASH_ENV
  190. - run:
  191. name: install package
  192. no_output_timeout: 30m
  193. command: |
  194. . venv/bin/activate
  195. python3 -m pip uninstall -y super_gradients
  196. python3 -m pip install -e .[pro] --extra-index-url https://pypi.ngc.nvidia.com
  197. - run:
  198. name: install pytorch quantization package
  199. no_output_timeout: 30m
  200. command: |
  201. . venv/bin/activate
  202. python3 -m pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com
  203. python3 -m pip install onnx_graphsurgeon==0.3.27 --extra-index-url https://pypi.ngc.nvidia.com
  204. - run:
  205. name: run tests with coverage in parallel
  206. no_output_timeout: 30m
  207. command: |
  208. . venv/bin/activate
  209. # Split test files across parallel containers
  210. TEST_FILES=$(circleci tests glob "tests/unit_tests/*test*.py" | circleci tests split --split-by=timings)
  211. # Run tests with coverage for the assigned subset of files
  212. echo "Running tests on the following files: $TEST_FILES"
  213. for file in $TEST_FILES; do
  214. echo "Running $file"
  215. coverage run --source=super_gradients -m unittest $file
  216. done
  217. # If needed, each container can generate a partial coverage report
  218. coverage report -m
  219. - store_artifacts:
  220. path: htmlcov
  221. - store_artifacts:
  222. path: ~/sg_logs
  223. breaking_change_check:
  224. parameters:
  225. py_version:
  226. type: string
  227. default: latest
  228. docker:
  229. - image: cimg/python:<< parameters.py_version >>
  230. resource_class: small
  231. steps:
  232. - checkout
  233. - run:
  234. name: Detect breaking changes
  235. no_output_timeout: 30m
  236. command: |
  237. python3 -m venv venv
  238. . venv/bin/activate
  239. python3 -m pip install pip==23.1.2
  240. python3 -m pip install -e .
  241. python3 -m pip install -r requirements.dev.txt
  242. python3 -m pip install gitpython==3.1.0
  243. # GET THE BRANCH THAT THE CURRENT PR IS BEING MERGED INTO.
  244. # THIS IS ONLY RELEVANT FOR CI RUNS, WHICH IS WHY IT'S NOT PART OF THE PYTHON CODE.
  245. if [ -n "${CIRCLE_PULL_REQUEST}" ]; then
  246. PR_NUMBER=$(basename ${CIRCLE_PULL_REQUEST})
  247. echo "Pull Request Number: ${PR_NUMBER}"
  248. # Use GitHub API to get the target branch name of the PR using GITHUB_CLI_TOKEN
  249. BRANCH_MERGED_INTO=$(curl -s -H "Authorization: token ${GITHUB_CLI_TOKEN}" \
  250. "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUMBER}" \
  251. | jq -r '.base.ref')
  252. echo "Branch merged into: ${BRANCH_MERGED_INTO}"
  253. # This is required since it's possible this branch would not be available locally
  254. git fetch origin ${BRANCH_MERGED_INTO}:${BRANCH_MERGED_INTO}
  255. else
  256. echo "This job does not appear to be running as part of a pull request."
  257. BRANCH_MERGED_INTO="master"
  258. fi
  259. # TESTS
  260. coverage run --source=super_gradients -m unittest tests/breaking_change_tests/unit_test.py
  261. BRANCH_MERGED_INTO=${BRANCH_MERGED_INTO} coverage run --source=super_gradients -m unittest tests/breaking_change_tests/test_detect_breaking_change.py
  262. make check_notebooks_version_match
  263. - run:
  264. name: Remove new environment when failed
  265. command: "rm -r venv"
  266. when: on_fail
  267. - slack/notify:
  268. channel: "sg-integration-tests"
  269. event: fail
  270. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  271. change_rc_to_b:
  272. description: "change rc in the tag to b"
  273. docker:
  274. - image: cimg/base:stable-20.04
  275. resource_class: small
  276. steps:
  277. - run:
  278. name: change the rc to b
  279. command:
  280. |
  281. BETA_TAG=$(echo ${CIRCLE_TAG} | sed -e 's|rc|b|'); echo ${BETA_TAG} >> ~/BETA_TAG
  282. cat ~/BETA_TAG
  283. - persist_to_workspace:
  284. root: ~/
  285. paths:
  286. - "BETA_TAG"
  287. build_and_publish_sg_container:
  288. description : "building the temp image and pushing to dev ecr"
  289. parameters:
  290. repo_name:
  291. type: string
  292. default: 'deci/super-gradients'
  293. sg_python_version:
  294. type: string
  295. default: $CIRCLE_TAG
  296. docker:
  297. - image: cimg/base:stable-20.04
  298. resource_class: small
  299. steps:
  300. - checkout
  301. - get_beta_and_rc_tags
  302. - run:
  303. command: echo *$BETA_TAG*
  304. - setup_remote_docker:
  305. version: << pipeline.parameters.remote_docker_version >>
  306. docker_layer_caching: true
  307. - deci-common/container_image_build:
  308. dockerfile: scripts/Dockerfile
  309. repository_name: << parameters.repo_name >>
  310. image_tag: "$BETA_TAG"
  311. build_args: 'SG_VERSION=<< parameters.sg_python_version >>'
  312. extra_flags: ' --compress'
  313. - deci-common/push_docker_image_aws_dev:
  314. repository_name: << parameters.repo_name >>
  315. image_tag: "$BETA_TAG"
  316. additional_tags: "latest"
  317. find_rc_tag_per_sha:
  318. description: this command will take the sha of the last commit and find the rc tag it belongs to as ${RC_TAG} variale
  319. docker:
  320. - image: cimg/aws:2022.11.1
  321. resource_class: small
  322. steps:
  323. - checkout
  324. - run:
  325. name: get rc tag of the final tag
  326. command: |
  327. if [[ $(RC_TAG=$(git tag --contains ${CIRCLE_SHA1} | grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+rc[[:digit:]]+' | head -n 1)) ]] ; then
  328. echo "Found RC version: ${RC_TAG}"
  329. echo $RC_TAG >> ~/RC_TAG
  330. else
  331. echo "No Rc Tag found for commit"
  332. circleci-agent step halt
  333. fi
  334. - persist_to_workspace:
  335. root: ~/
  336. paths:
  337. - "RC_TAG"
  338. add_rc_tag_to_beta:
  339. description: in the event of successful test promote beta to rc
  340. parameters:
  341. image_repo:
  342. type: string
  343. default: "deci/super-gradients"
  344. docker:
  345. - image: cimg/base:stable-20.04
  346. resource_class: small
  347. steps:
  348. - get_beta_and_rc_tags
  349. - run:
  350. command: |
  351. echo $BETA_TAG
  352. - adding_tag_to_ecr_container_image:
  353. image_repo: << parameters.image_repo >>
  354. source_image_tag: $BETA_TAG
  355. new_image_tag: $CIRCLE_TAG
  356. add_release_tag_to_rc:
  357. description: in the event of successful test promote rc to release and latest
  358. parameters:
  359. image_repo:
  360. type: string
  361. default: "deci/super-gradients"
  362. docker:
  363. - image: cimg/base:stable-20.04
  364. resource_class: small
  365. steps:
  366. - get_beta_and_rc_tags
  367. - run:
  368. command: |
  369. if [ -z $RC_TAG ] ; then
  370. circleci-agent step halt
  371. else
  372. echo $RC_TAG
  373. fi
  374. - adding_tag_to_ecr_container_image:
  375. image_repo: << parameters.image_repo >>
  376. source_image_tag: $RC_TAG
  377. new_image_tag: ${CIRCLE_TAG}
  378. testing_supergradients_docker_image:
  379. description: "running integration test on the code"
  380. parameters:
  381. image_repo:
  382. type: string
  383. #reserved for testing when will be done
  384. #machine: true
  385. #resource_class: deci-ai/research-standard
  386. docker:
  387. - image: cimg/base:stable-20.04
  388. steps:
  389. - deci-common/ecr_login_dev
  390. - get_beta_and_rc_tags
  391. # - run:
  392. # name: integration test
  393. # #command: sudo docker run -it -e ENVIRONMENT_NAME=production -v ${PWD}:/SG -v /data:/data deciai/super-gradients:3.0.0 python3 ./tests/integration_tests/pretrained_models_test.py
  394. # command: docker run --rm -it --shm-size=2gb --gpus all -v ${PWD}:/SG -v /data:/data << parameters.image_repo >>:<< parameters.image_tag >> python3 -c 'print("it works!")'
  395. - run:
  396. command: echo Hello world
  397. release_candidate:
  398. environment:
  399. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  400. parameters:
  401. py_version:
  402. type: string
  403. docker:
  404. - image: cimg/python:<< parameters.py_version >>
  405. steps:
  406. - deci-common/checkout_and_skip_build:
  407. check_version_file: true
  408. skip_md_files: true
  409. - deci-common/get_persisted_version_info
  410. - run:
  411. name: edit package version
  412. command: |
  413. echo $NEW_VERSION > version.txt
  414. - deci-common/pip_upload_package_codeartifact_dev:
  415. codeartifact_repository: "deci-packages"
  416. - deci-common/pip_test_package_installation_codeartifact_dev:
  417. package_name: "super-gradients"
  418. version: $NEW_VERSION
  419. - deci-common/git_config_automation_user
  420. - run:
  421. name: "commit version file"
  422. command: |
  423. git commit version.txt -m "Deci Services - Changed version to $NEW_VERSION"
  424. - deci-common/git_commit_and_tag:
  425. version: $NEW_VERSION
  426. release_version:
  427. environment:
  428. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  429. parameters:
  430. py_version:
  431. type: string
  432. dev_venv_name:
  433. type: string
  434. default: "dev-sg-${CIRCLE_BUILD_NUM}"
  435. docker:
  436. - image: cimg/python:<< parameters.py_version >>
  437. steps:
  438. - deci-common/checkout_and_skip_build:
  439. check_version_file: true
  440. skip_md_files: false
  441. - run:
  442. name: add requirements.txt and requirements.pro.txt to source code
  443. command: |
  444. cp requirements.txt src/super_gradients/requirements.txt
  445. cp requirements.pro.txt src/super_gradients/requirements.pro.txt
  446. - run:
  447. name: edit package version
  448. command: |
  449. echo $CIRCLE_TAG > version.txt
  450. - deci-common/pip_upload_package_codeartifact_all_accounts:
  451. codeartifact_repository: "deci-packages"
  452. - deci-common/pip_test_package_installation_codeartifact_dev:
  453. package_name: "super-gradients"
  454. version: $CIRCLE_TAG
  455. venv_name: << parameters.dev_venv_name >>
  456. - run:
  457. name: verify that the output of __version__ is what we expect
  458. command: |
  459. . << parameters.dev_venv_name >>-super-gradients-$CIRCLE_TAG/bin/activate
  460. python3 tests/verify_version.py $CIRCLE_TAG
  461. - deci-common/pip_test_package_installation_codeartifact_prod:
  462. package_name: "super-gradients"
  463. version: $CIRCLE_TAG
  464. - deci-common/pip_upload_package_codeartifact_prod:
  465. codeartifact_repository: "deci-toolkit"
  466. - deci-common/git_commit_and_tag:
  467. version: $CIRCLE_TAG
  468. delete_remote_tag_before_tagging: true
  469. - deci-common/tag_as:
  470. tag_name: "stable"
  471. delete_remote: true
  472. - deci-common/github_create_release:
  473. github_cli_token: $GITHUB_CLI_TOKEN
  474. directory_to_cd_into: "."
  475. tag: $CIRCLE_TAG
  476. notes: "This GitHub Release was done automatically by CircleCI"
  477. sg_core_integration_tests_coverage:
  478. docker:
  479. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  480. resource_class: deci-ai/sg-gpu-on-premise
  481. parameters:
  482. sg_existing_env_path:
  483. type: string
  484. default: "/env/persistent_env"
  485. sg_new_env_name:
  486. type: string
  487. default: "${CIRCLE_BUILD_NUM}"
  488. sg_new_env_python_version:
  489. type: string
  490. default: "python3.8"
  491. steps:
  492. - checkout
  493. - run:
  494. name: install requirements and run recipe tests
  495. command: |
  496. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  497. source << parameters.sg_new_env_name >>/bin/activate
  498. python3.8 -m pip install --upgrade setuptools pip wheel
  499. python3.8 -m pip install -r requirements.txt
  500. python3.8 -m pip install -r requirements.dev.txt
  501. python3.8 -m pip install .
  502. coverage run --source=super_gradients -m unittest tests/deci_core_integration_test_suite_runner.py
  503. hydra_sweeper_test:
  504. docker:
  505. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  506. resource_class: deci-ai/sg-gpu-on-premise
  507. parameters:
  508. sg_existing_env_path:
  509. type: string
  510. default: "/env/persistent_env"
  511. sg_new_env_name:
  512. type: string
  513. default: "${CIRCLE_BUILD_NUM}"
  514. sg_new_env_python_version:
  515. type: string
  516. default: "python3.8"
  517. steps:
  518. - checkout
  519. - run:
  520. name: install requirements and run recipe tests
  521. command: |
  522. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  523. source << parameters.sg_new_env_name >>/bin/activate
  524. python3.8 -m pip install --upgrade setuptools pip wheel
  525. python3.8 -m pip install -r requirements.txt
  526. python3.8 -m pip install -r requirements.dev.txt
  527. python3.8 -m pip install .
  528. make sweeper_test
  529. - run:
  530. name: Remove new environment when failed
  531. command: "rm -r << parameters.sg_new_env_name >>"
  532. when: on_fail
  533. - slack/notify:
  534. channel: "sg-integration-tests"
  535. event: fail
  536. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  537. recipe_accuracy_tests:
  538. docker:
  539. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  540. resource_class: deci-ai/sg-gpu-on-premise
  541. parameters:
  542. sg_existing_env_path:
  543. type: string
  544. default: "/env/persistent_env"
  545. sg_new_env_name:
  546. type: string
  547. default: "${CIRCLE_BUILD_NUM}"
  548. sg_new_env_python_version:
  549. type: string
  550. default: "python3.8"
  551. steps:
  552. - checkout
  553. - run:
  554. name: install requirements and run recipe tests
  555. command: |
  556. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  557. source << parameters.sg_new_env_name >>/bin/activate
  558. python3.8 -m pip install --upgrade setuptools pip wheel
  559. python3.8 -m pip install -r requirements.txt
  560. python3.8 -m pip install -r requirements.dev.txt
  561. python3.8 -m pip install .
  562. python3.8 -m pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com
  563. python3.8 tests/verify_min_samples_ddp.py
  564. python3.8 tests/verify_distributed_sampler_wrapper.py
  565. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_pose_dekr_w32_no_dc experiment_name=shortened_coco2017_pose_dekr_w32_ap_test batch_size=4 val_batch_size=8 epochs=1 training_hyperparams.lr_warmup_steps=0 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=1000 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  566. python3.8 src/super_gradients/train_from_recipe.py --config-name=cifar10_resnet experiment_name=shortened_cifar10_resnet_accuracy_test epochs=100 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  567. python3.8 src/super_gradients/examples/convert_recipe_example/convert_recipe_example.py --config-name=cifar10_conversion_params experiment_name=shortened_cifar10_resnet_accuracy_test
  568. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox experiment_name=shortened_coco2017_yolox_n_map_test architecture=yolox_n training_hyperparams.loss=YoloXFastDetectionLoss epochs=10 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  569. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_regseg48 experiment_name=shortened_cityscapes_regseg48_iou_test epochs=10 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  570. coverage run --source=super_gradients -m unittest tests/deci_core_recipe_test_suite_runner.py
  571. - run:
  572. name: Remove new environment when failed
  573. command: "rm -r << parameters.sg_new_env_name >>"
  574. when: on_fail
  575. - slack/notify:
  576. channel: "sg-integration-tests"
  577. event: fail
  578. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  579. run_and_convert_notebooks_to_docs:
  580. parallelism: 11 # Adjust based on your needs and available resources
  581. docker:
  582. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  583. resource_class: deci-ai/sg-gpu-on-premise
  584. parameters:
  585. sg_existing_env_path:
  586. type: string
  587. default: "/env/persistent_env"
  588. sg_new_env_name:
  589. type: string
  590. default: "${CIRCLE_BUILD_NUM}"
  591. sg_new_env_python_version:
  592. type: string
  593. default: "python3.8"
  594. steps:
  595. - checkout
  596. - run:
  597. name: Setup Environment
  598. command: |
  599. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  600. source << parameters.sg_new_env_name >>/bin/activate
  601. # Upgrade pip, setuptools, and wheel
  602. pip install --upgrade pip setuptools wheel
  603. # Install project-specific dependencies from requirements files
  604. pip install -r requirements.txt
  605. pip install -r requirements.dev.txt
  606. # Install your project (if it's a package)
  607. pip install .
  608. # Install PyTorch, torchvision, and torchaudio
  609. pip install torch torchvision torchaudio
  610. # Install additional specific dependencies
  611. pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com
  612. pip install onnx_graphsurgeon==0.3.27 --extra-index-url https://pypi.ngc.nvidia.com
  613. # Install Jupyter and nbconvert for notebook execution
  614. pip install jupyter nbconvert
  615. # Install the IPython kernel
  616. python -m ipykernel install --name myenv --user
  617. - run:
  618. name: Find and Run Notebooks
  619. no_output_timeout: 180m
  620. command: |
  621. NOTEBOOKS=$(find notebooks -name '*.ipynb' \
  622. | grep -v 'notebooks/DEKR_PoseEstimationFineTuning.ipynb' \
  623. | grep -v 'notebooks/yolo_nas_pose_eval_with_pycocotools.ipynb' \
  624. | grep -v 'notebooks/albumentations_tutorial.ipynb' \
  625. | grep -v 'notebooks/dataloader_adapter.ipynb')
  626. TOTAL=$(echo "$NOTEBOOKS" | wc -l)
  627. echo "Total notebooks: $TOTAL"
  628. SLICE=$((TOTAL / CIRCLE_NODE_TOTAL))
  629. EXTRA=$((TOTAL % CIRCLE_NODE_TOTAL))
  630. OFFSET=$((SLICE * CIRCLE_NODE_INDEX))
  631. OFFSET=$((OFFSET + (CIRCLE_NODE_INDEX < EXTRA ? CIRCLE_NODE_INDEX : EXTRA)))
  632. COUNT=$((SLICE + (CIRCLE_NODE_INDEX < EXTRA ? 1 : 0)))
  633. echo "Offset for this node: $OFFSET, Count: $COUNT"
  634. if [ "$COUNT" -eq "0" ]; then
  635. echo "No notebooks to process on this node."
  636. exit 0
  637. fi
  638. PART=$(echo "$NOTEBOOKS" | tail -n +$((OFFSET + 1)) | head -n $COUNT)
  639. echo "Notebooks to process by this node:"
  640. echo "$PART"
  641. for NOTEBOOK in $PART; do
  642. echo "Processing $NOTEBOOK"
  643. chmod +x scripts/run_and_convert_notebook.sh
  644. ./scripts/run_and_convert_notebook.sh "$NOTEBOOK" "<< parameters.sg_new_env_name >>"
  645. done
  646. recipe_sanity_tests_classification_pt1:
  647. docker:
  648. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  649. resource_class: deci-ai/sg-gpu-on-premise
  650. parameters:
  651. sg_existing_env_path:
  652. type: string
  653. default: "/env/persistent_env"
  654. sg_new_env_name:
  655. type: string
  656. default: "${CIRCLE_BUILD_NUM}"
  657. sg_new_env_python_version:
  658. type: string
  659. default: "python3.8"
  660. steps:
  661. - checkout
  662. - run:
  663. name: install requirements and run classification sanity tests
  664. command: |
  665. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  666. source << parameters.sg_new_env_name >>/bin/activate
  667. ls /data/
  668. python3.8 -m pip install --upgrade setuptools pip wheel
  669. python3.8 -m pip install -r requirements.txt
  670. python3.8 -m pip install .
  671. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY600 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  672. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY800 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  673. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_repvgg batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  674. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_resnet50 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  675. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_vit_base batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  676. python3.8 src/super_gradients/train_from_kd_recipe.py --config-name=imagenet_resnet50_kd batch_size=8 val_batch_size=8 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  677. python3.8 src/super_gradients/convert_recipe_to_code.py cifar10_resnet.yaml train_cifar10_resnet.py && python3.8 train_cifar10_resnet.py
  678. - run:
  679. name: Remove new environment when failed
  680. command: "rm -r << parameters.sg_new_env_name >>"
  681. when: on_fail
  682. - slack/notify:
  683. channel: "sg-integration-tests"
  684. event: fail
  685. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  686. recipe_sanity_tests_classification_pt2:
  687. docker:
  688. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  689. resource_class: deci-ai/sg-gpu-on-premise
  690. parameters:
  691. sg_existing_env_path:
  692. type: string
  693. default: "/env/persistent_env"
  694. sg_new_env_name:
  695. type: string
  696. default: "${CIRCLE_BUILD_NUM}"
  697. sg_new_env_python_version:
  698. type: string
  699. default: "python3.8"
  700. steps:
  701. - checkout
  702. - run:
  703. name: install requirements and run classification sanity tests
  704. command: |
  705. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  706. source << parameters.sg_new_env_name >>/bin/activate
  707. python3.8 -m pip install --upgrade setuptools pip wheel
  708. python3.8 -m pip install -r requirements.txt
  709. python3.8 -m pip install .
  710. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_efficientnet batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  711. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_mobilenetv2 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  712. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_mobilenetv3_large batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  713. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_mobilenetv3_small batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  714. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY200 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  715. python3.8 src/super_gradients/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY400 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4 dataset_params.train_dataset_params.root=/data/Imagenet/train dataset_params.val_dataset_params.root=/data/Imagenet/val
  716. - run:
  717. name: Remove new environment when failed
  718. command: "rm -r << parameters.sg_new_env_name >>"
  719. when: on_fail
  720. - slack/notify:
  721. channel: "sg-integration-tests"
  722. event: fail
  723. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  724. recipe_sanity_tests_segmentation:
  725. docker:
  726. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  727. resource_class: deci-ai/sg-gpu-on-premise
  728. parameters:
  729. sg_existing_env_path:
  730. type: string
  731. default: "/env/persistent_env"
  732. sg_new_env_name:
  733. type: string
  734. default: "${CIRCLE_BUILD_NUM}"
  735. sg_new_env_python_version:
  736. type: string
  737. default: "python3.8"
  738. steps:
  739. - checkout
  740. - run:
  741. name: install requirements and run segmentation sanity tests
  742. command: |
  743. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  744. source << parameters.sg_new_env_name >>/bin/activate
  745. python3.8 -m pip install --upgrade setuptools pip wheel
  746. python3.8 -m pip install -r requirements.txt
  747. python3.8 -m pip install .
  748. wget -O $(pwd)/checkpoints/ddrnet23_slim_bb_imagenet.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet23_slim_bb_imagenet.pth
  749. wget -O $(pwd)/checkpoints/ddrnet23_bb_imagenet.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet23_bb_imagenet.pth
  750. wget -O $(pwd)/checkpoints/ddrnet39_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet39_bb_imagenet.pth
  751. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_ddrnet checkpoint_params.checkpoint_path=$(pwd)/checkpoints/ddrnet23_bb_imagenet.pth batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  752. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_ddrnet architecture=ddrnet_23_slim checkpoint_params.checkpoint_path=$(pwd)/checkpoints/ddrnet23_slim_bb_imagenet.pth batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  753. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_ddrnet checkpoint_params.checkpoint_path=$(pwd)/checkpoints/ddrnet39_imagenet_pretrained.pth architecture=ddrnet_39 batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  754. wget -O $(pwd)/checkpoints/stdc1_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc1_imagenet_pretrained.pth
  755. wget -O $(pwd)/checkpoints/stdc2_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc2_imagenet_pretrained.pth
  756. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth architecture=pp_lite_t_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  757. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=pp_lite_b_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  758. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_pplite_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth architecture=pp_lite_t_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  759. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_pplite_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=pp_lite_b_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  760. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_stdc_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  761. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_stdc_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=stdc2_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  762. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_stdc_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  763. python3.8 src/super_gradients/train_from_recipe.py --config-name=cityscapes_stdc_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=stdc2_seg batch_size=3 val_batch_size=3 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  764. - run:
  765. name: Remove new environment when failed
  766. command: "rm -r << parameters.sg_new_env_name >>"
  767. when: on_fail
  768. - slack/notify:
  769. channel: "sg-integration-tests"
  770. event: fail
  771. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  772. recipe_sanity_tests_detection:
  773. docker:
  774. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  775. resource_class: deci-ai/sg-gpu-on-premise
  776. parameters:
  777. sg_existing_env_path:
  778. type: string
  779. default: "/env/persistent_env"
  780. sg_new_env_name:
  781. type: string
  782. default: "${CIRCLE_BUILD_NUM}"
  783. sg_new_env_python_version:
  784. type: string
  785. default: "python3.8"
  786. steps:
  787. - checkout
  788. - run:
  789. name: install requirements and run detection sanity tests
  790. command: |
  791. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  792. source << parameters.sg_new_env_name >>/bin/activate
  793. python3.8 -m pip install --upgrade setuptools pip wheel
  794. python3.8 -m pip install -r requirements.txt
  795. python3.8 -m pip install .
  796. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_ssd_lite_mobilenet_v2 batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  797. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_n batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  798. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_t batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  799. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_s batch_size=8 val_batch_size=16 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  800. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_m batch_size=8 val_batch_size=8 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  801. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_l batch_size=4 val_batch_size=8 epochs=1 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=100 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  802. - run:
  803. name: Remove new environment when failed
  804. command: "rm -r << parameters.sg_new_env_name >>"
  805. when: on_fail
  806. - slack/notify:
  807. channel: "sg-integration-tests"
  808. event: fail
  809. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  810. recipe_sanity_tests_pose_estimation:
  811. docker:
  812. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  813. resource_class: deci-ai/sg-gpu-on-premise
  814. parameters:
  815. sg_existing_env_path:
  816. type: string
  817. default: "/env/persistent_env"
  818. sg_new_env_name:
  819. type: string
  820. default: "${CIRCLE_BUILD_NUM}"
  821. sg_new_env_python_version:
  822. type: string
  823. default: "python3.8"
  824. steps:
  825. - checkout
  826. - run:
  827. name: install requirements and run pose estimation sanity tests
  828. command: |
  829. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  830. source << parameters.sg_new_env_name >>/bin/activate
  831. python3.8 -m pip install --upgrade setuptools pip wheel
  832. python3.8 -m pip install -r requirements.txt
  833. python3.8 -m pip install .
  834. python3.8 src/super_gradients/train_from_recipe.py --config-name=coco2017_pose_dekr_w32_no_dc experiment_name=shortened_coco2017_pose_dekr_w32_ap_test batch_size=4 val_batch_size=8 epochs=1 training_hyperparams.lr_warmup_steps=0 training_hyperparams.average_best_models=False training_hyperparams.max_train_batches=1000 training_hyperparams.max_valid_batches=100 multi_gpu=DDP num_gpus=4
  835. - run:
  836. name: Remove new environment when failed
  837. command: "rm -r << parameters.sg_new_env_name >>"
  838. when: on_fail
  839. - slack/notify:
  840. channel: "sg-integration-tests"
  841. event: fail
  842. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  843. docker-build-and-publish-branch:
  844. docker:
  845. - image: cimg/base:stable-20.04
  846. parameters:
  847. repo_name:
  848. type: string
  849. default: "deci/super-gradients"
  850. docker_context:
  851. type: string
  852. default: "."
  853. additional_tags:
  854. type: string
  855. default: ''
  856. steps:
  857. - setup_remote_docker:
  858. version: 20.10.7
  859. docker_layer_caching: true
  860. - deci-common/container_image_lint_tag:
  861. image_tag: "${CIRCLE_BRANCH}"
  862. - run:
  863. command: |
  864. ADDITIONAL_TAGS="<< parameters.additional_tags >>"
  865. echo "export ADDITIONAL_TAGS=${ADDITIONAL_TAGS}" >> $BASH_ENV
  866. - run:
  867. command: |
  868. source $BASH_ENV
  869. echo "$CONTAINER_LINT_TAG"
  870. echo "$ADDITIONAL_TAGS"
  871. - when:
  872. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  873. steps:
  874. - build_and_publish_command:
  875. repo_name: << parameters.repo_name >>
  876. docker_context: << parameters.docker_context >>
  877. image_tag: $CONTAINER_LINT_TAG
  878. additional_tags: $ADDITIONAL_TAGS
  879. dockerfile: 'scripts/Dockerfile.branch.code'
  880. build_args: "BASE_TAG=$CONTAINER_LINT_TAG"
  881. - unless:
  882. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  883. steps:
  884. - build_and_publish_command:
  885. repo_name: << parameters.repo_name >>
  886. docker_context: << parameters.docker_context >>
  887. image_tag: $CONTAINER_LINT_TAG
  888. additional_tags: $ADDITIONAL_TAGS
  889. dockerfile: 'scripts/Dockerfile.branch'
  890. workflows:
  891. sanity_tests:
  892. when: << pipeline.parameters.run_sanity_tests_flow >>
  893. jobs:
  894. - sg_core_integration_tests_coverage:
  895. context:
  896. - slack
  897. - hydra_sweeper_test:
  898. context:
  899. - slack
  900. - recipe_sanity_tests_classification_pt1:
  901. context:
  902. - slack
  903. - recipe_sanity_tests_classification_pt2:
  904. context:
  905. - slack
  906. - recipe_sanity_tests_segmentation:
  907. context:
  908. - slack
  909. - recipe_sanity_tests_detection:
  910. context:
  911. - slack
  912. - recipe_sanity_tests_pose_estimation:
  913. context:
  914. - slack
  915. - recipe_accuracy_tests:
  916. context:
  917. - slack
  918. - run_and_convert_notebooks_to_docs:
  919. context:
  920. - slack
  921. run_and_convert_notebooks_to_docs:
  922. when: << pipeline.parameters.run_and_convert_notebooks_to_docs >>
  923. jobs:
  924. - run_and_convert_notebooks_to_docs:
  925. context:
  926. - slack
  927. release:
  928. unless:
  929. or:
  930. - << pipeline.parameters.ad_hoc_container_build >>
  931. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  932. jobs:
  933. - deci-common/persist_version_info:
  934. version_override: $CIRCLE_TAG
  935. <<: *release_tag_filter
  936. - deci-common/codeartifact_login:
  937. name: "login_to_codeartifact_release"
  938. repo_name: "deci-packages"
  939. <<: *release_tag_filter
  940. - build:
  941. name: "build3.8"
  942. py_version: "3.8"
  943. package_name: "super-gradients"
  944. requires:
  945. - deci-common/persist_version_info
  946. - login_to_codeartifact_release
  947. <<: *release_tag_filter
  948. - sg_core_integration_tests_coverage:
  949. context:
  950. - slack
  951. <<: *release_tag_filter
  952. - hydra_sweeper_test:
  953. context:
  954. - slack
  955. <<: *release_tag_filter
  956. - recipe_sanity_tests_classification_pt1:
  957. context:
  958. - slack
  959. <<: *release_tag_filter
  960. - recipe_sanity_tests_classification_pt2:
  961. context:
  962. - slack
  963. <<: *release_tag_filter
  964. - recipe_sanity_tests_segmentation:
  965. context:
  966. - slack
  967. <<: *release_tag_filter
  968. - recipe_sanity_tests_detection:
  969. context:
  970. - slack
  971. <<: *release_tag_filter
  972. - recipe_sanity_tests_pose_estimation:
  973. context:
  974. - slack
  975. <<: *release_tag_filter
  976. - recipe_accuracy_tests:
  977. context:
  978. - slack
  979. <<: *release_tag_filter
  980. - run_and_convert_notebooks_to_docs:
  981. context:
  982. - slack
  983. <<: *release_tag_filter
  984. - release_version:
  985. py_version: "3.8"
  986. requires:
  987. - "build3.8"
  988. - sg_core_integration_tests_coverage
  989. - hydra_sweeper_test
  990. - recipe_accuracy_tests
  991. - recipe_sanity_tests_classification_pt1
  992. - recipe_sanity_tests_classification_pt2
  993. - recipe_sanity_tests_segmentation
  994. - recipe_sanity_tests_detection
  995. - recipe_sanity_tests_pose_estimation
  996. - run_and_convert_notebooks_to_docs
  997. <<: *release_tag_filter
  998. - deci-common/pip_upload_package_from_codeartifact_to_global_pypi:
  999. package_name: "super-gradients"
  1000. name: "upload_super_gradients_to_pypi"
  1001. version: $CIRCLE_TAG
  1002. requires:
  1003. - "release_version"
  1004. context:
  1005. - pypi-supergradients
  1006. <<: *release_tag_filter
  1007. build_and_deploy:
  1008. unless:
  1009. or:
  1010. - << pipeline.parameters.ad_hoc_container_build >>
  1011. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  1012. jobs:
  1013. - deci-common/persist_version_info:
  1014. use_rc: true
  1015. use_beta: false
  1016. version_override: ""
  1017. - build:
  1018. name: "build<< pipeline.parameters.build_py_version >>"
  1019. py_version: << pipeline.parameters.build_py_version >>
  1020. package_name: "super-gradients"
  1021. requires:
  1022. - deci-common/persist_version_info
  1023. - breaking_change_check:
  1024. name: "breaking-change-check"
  1025. py_version: << pipeline.parameters.build_py_version >>
  1026. requires:
  1027. - deci-common/persist_version_info
  1028. - deci-common/codeartifact_login:
  1029. repo_name: "deci-packages"
  1030. <<: *release_candidate_filter
  1031. - release_candidate: # happens on merge
  1032. py_version: "<< pipeline.parameters.build_py_version >>"
  1033. requires:
  1034. - "build<< pipeline.parameters.build_py_version >>"
  1035. - deci-common/codeartifact_login
  1036. <<: *release_candidate_filter
  1037. SG_docker:
  1038. unless:
  1039. or:
  1040. - << pipeline.parameters.ad_hoc_container_build >>
  1041. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  1042. jobs:
  1043. - change_rc_to_b: # works on release candidate creation
  1044. <<: *release_candidate_tag_filter
  1045. - build_and_publish_sg_container: # works on release candidate creation
  1046. requires:
  1047. - "change_rc_to_b"
  1048. <<: *release_candidate_tag_filter
  1049. - testing_supergradients_docker_image: # works on release candidate creation
  1050. image_repo: '307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/super-gradients'
  1051. requires:
  1052. - "build_and_publish_sg_container"
  1053. - "change_rc_to_b"
  1054. <<: *release_candidate_tag_filter
  1055. - add_rc_tag_to_beta: # works on release candidate creation for ECR Repo
  1056. requires:
  1057. - "testing_supergradients_docker_image"
  1058. - "change_rc_to_b"
  1059. <<: *release_candidate_tag_filter
  1060. - find_rc_tag_per_sha: # works on release
  1061. <<: *release_tag_filter
  1062. - add_release_tag_to_rc: # works on release
  1063. requires:
  1064. - "find_rc_tag_per_sha"
  1065. <<: *release_tag_filter
  1066. - slack/on-hold:
  1067. context: slack
  1068. channel: "sg-integration-tests"
  1069. requires:
  1070. - "add_release_tag_to_rc"
  1071. <<: *release_tag_filter
  1072. - hold-sg-public-release: # works on release
  1073. type: approval
  1074. requires:
  1075. - "slack/on-hold"
  1076. <<: *release_tag_filter
  1077. - docker/publish: # works on release
  1078. executor:
  1079. image: cimg/base
  1080. tag: stable-20.04
  1081. name: docker/docker
  1082. image: deciai/super-gradients
  1083. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1084. update-description: true
  1085. use-buildkit: true
  1086. use-remote-docker: true
  1087. use-docker-credentials-store: true
  1088. path: ./scripts
  1089. readme: ../README.md
  1090. tag: latest,${CIRCLE_TAG}
  1091. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG}' #building from scratch as it faster and cheaper than download and retag
  1092. requires:
  1093. - "hold-sg-public-release"
  1094. <<: *release_tag_filter
  1095. - docker/publish: # works on release
  1096. executor:
  1097. image: cimg/base
  1098. tag: stable-20.04
  1099. name: docker/docker
  1100. image: deciai/super-gradients
  1101. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1102. update-description: false
  1103. use-buildkit: true
  1104. use-remote-docker: true
  1105. use-docker-credentials-store: true
  1106. path: ./scripts
  1107. tag: ${CIRCLE_TAG}-runtime
  1108. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG} --build-arg DOCKER_IMAGE_TAG=11.3.1-runtime-ubuntu20.04'
  1109. requires:
  1110. - "hold-sg-public-release"
  1111. <<: *release_tag_filter
  1112. build-and-push-container-flow:
  1113. when: << pipeline.parameters.ad_hoc_container_build >>
  1114. jobs:
  1115. - docker-build-and-publish-branch
  1116. build-and-push-container-code-only-flow:
  1117. when: << pipeline.parameters.ad_hoc_container_build_code_only >>
  1118. jobs:
  1119. - docker-build-and-publish-branch
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...