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 54 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
  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: run tests with coverage in parallel
  199. no_output_timeout: 30m
  200. command: |
  201. . venv/bin/activate
  202. # Split test files across parallel containers
  203. TEST_FILES=$(circleci tests glob "tests/unit_tests/*test*.py" | circleci tests split --split-by=timings)
  204. # Run tests with coverage for the assigned subset of files
  205. echo "Running tests on the following files: $TEST_FILES"
  206. for file in $TEST_FILES; do
  207. echo "Running $file"
  208. coverage run --source=super_gradients -m unittest $file
  209. done
  210. # If needed, each container can generate a partial coverage report
  211. coverage report -m
  212. - store_artifacts:
  213. path: htmlcov
  214. - store_artifacts:
  215. path: ~/sg_logs
  216. breaking_change_check:
  217. parameters:
  218. py_version:
  219. type: string
  220. default: latest
  221. docker:
  222. - image: cimg/python:<< parameters.py_version >>
  223. resource_class: small
  224. steps:
  225. - checkout
  226. - run:
  227. name: Detect breaking changes
  228. no_output_timeout: 30m
  229. command: |
  230. python3 -m venv venv
  231. . venv/bin/activate
  232. python3 -m pip install pip==23.1.2
  233. python3 -m pip install -e .
  234. python3 -m pip install -r requirements.dev.txt
  235. python3 -m pip install gitpython==3.1.0
  236. # GET THE BRANCH THAT THE CURRENT PR IS BEING MERGED INTO.
  237. # THIS IS ONLY RELEVANT FOR CI RUNS, WHICH IS WHY IT'S NOT PART OF THE PYTHON CODE.
  238. if [ -n "${CIRCLE_PULL_REQUEST}" ]; then
  239. PR_NUMBER=$(basename ${CIRCLE_PULL_REQUEST})
  240. echo "Pull Request Number: ${PR_NUMBER}"
  241. # Use GitHub API to get the target branch name of the PR using GITHUB_CLI_TOKEN
  242. BRANCH_MERGED_INTO=$(curl -s -H "Authorization: token ${GITHUB_CLI_TOKEN}" \
  243. "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUMBER}" \
  244. | jq -r '.base.ref')
  245. echo "Branch merged into: ${BRANCH_MERGED_INTO}"
  246. # This is required since it's possible this branch would not be available locally
  247. git fetch origin ${BRANCH_MERGED_INTO}:${BRANCH_MERGED_INTO}
  248. else
  249. echo "This job does not appear to be running as part of a pull request."
  250. BRANCH_MERGED_INTO="master"
  251. fi
  252. # TESTS
  253. coverage run --source=super_gradients -m unittest tests/breaking_change_tests/unit_test.py
  254. BRANCH_MERGED_INTO=${BRANCH_MERGED_INTO} coverage run --source=super_gradients -m unittest tests/breaking_change_tests/test_detect_breaking_change.py
  255. make check_notebooks_version_match
  256. - run:
  257. name: Remove new environment when failed
  258. command: "rm -r venv"
  259. when: on_fail
  260. - slack/notify:
  261. channel: "sg-integration-tests"
  262. event: fail
  263. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  264. change_rc_to_b:
  265. description: "change rc in the tag to b"
  266. docker:
  267. - image: cimg/base:stable-20.04
  268. resource_class: small
  269. steps:
  270. - run:
  271. name: change the rc to b
  272. command:
  273. |
  274. BETA_TAG=$(echo ${CIRCLE_TAG} | sed -e 's|rc|b|'); echo ${BETA_TAG} >> ~/BETA_TAG
  275. cat ~/BETA_TAG
  276. - persist_to_workspace:
  277. root: ~/
  278. paths:
  279. - "BETA_TAG"
  280. build_and_publish_sg_container:
  281. description : "building the temp image and pushing to dev ecr"
  282. parameters:
  283. repo_name:
  284. type: string
  285. default: 'deci/super-gradients'
  286. sg_python_version:
  287. type: string
  288. default: $CIRCLE_TAG
  289. docker:
  290. - image: cimg/base:stable-20.04
  291. resource_class: small
  292. steps:
  293. - checkout
  294. - get_beta_and_rc_tags
  295. - run:
  296. command: echo *$BETA_TAG*
  297. - setup_remote_docker:
  298. version: << pipeline.parameters.remote_docker_version >>
  299. docker_layer_caching: true
  300. - deci-common/container_image_build:
  301. dockerfile: scripts/Dockerfile
  302. repository_name: << parameters.repo_name >>
  303. image_tag: "$BETA_TAG"
  304. build_args: 'SG_VERSION=<< parameters.sg_python_version >>'
  305. extra_flags: ' --compress'
  306. - deci-common/push_docker_image_aws_dev:
  307. repository_name: << parameters.repo_name >>
  308. image_tag: "$BETA_TAG"
  309. additional_tags: "latest"
  310. find_rc_tag_per_sha:
  311. description: this command will take the sha of the last commit and find the rc tag it belongs to as ${RC_TAG} variale
  312. docker:
  313. - image: cimg/aws:2022.11.1
  314. resource_class: small
  315. steps:
  316. - checkout
  317. - run:
  318. name: get rc tag of the final tag
  319. command: |
  320. if [[ $(RC_TAG=$(git tag --contains ${CIRCLE_SHA1} | grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+rc[[:digit:]]+' | head -n 1)) ]] ; then
  321. echo "Found RC version: ${RC_TAG}"
  322. echo $RC_TAG >> ~/RC_TAG
  323. else
  324. echo "No Rc Tag found for commit"
  325. circleci-agent step halt
  326. fi
  327. - persist_to_workspace:
  328. root: ~/
  329. paths:
  330. - "RC_TAG"
  331. add_rc_tag_to_beta:
  332. description: in the event of successful test promote beta to rc
  333. parameters:
  334. image_repo:
  335. type: string
  336. default: "deci/super-gradients"
  337. docker:
  338. - image: cimg/base:stable-20.04
  339. resource_class: small
  340. steps:
  341. - get_beta_and_rc_tags
  342. - run:
  343. command: |
  344. echo $BETA_TAG
  345. - adding_tag_to_ecr_container_image:
  346. image_repo: << parameters.image_repo >>
  347. source_image_tag: $BETA_TAG
  348. new_image_tag: $CIRCLE_TAG
  349. add_release_tag_to_rc:
  350. description: in the event of successful test promote rc to release and latest
  351. parameters:
  352. image_repo:
  353. type: string
  354. default: "deci/super-gradients"
  355. docker:
  356. - image: cimg/base:stable-20.04
  357. resource_class: small
  358. steps:
  359. - get_beta_and_rc_tags
  360. - run:
  361. command: |
  362. if [ -z $RC_TAG ] ; then
  363. circleci-agent step halt
  364. else
  365. echo $RC_TAG
  366. fi
  367. - adding_tag_to_ecr_container_image:
  368. image_repo: << parameters.image_repo >>
  369. source_image_tag: $RC_TAG
  370. new_image_tag: ${CIRCLE_TAG}
  371. testing_supergradients_docker_image:
  372. description: "running integration test on the code"
  373. parameters:
  374. image_repo:
  375. type: string
  376. #reserved for testing when will be done
  377. #machine: true
  378. #resource_class: deci-ai/research-standard
  379. docker:
  380. - image: cimg/base:stable-20.04
  381. steps:
  382. - deci-common/ecr_login_dev
  383. - get_beta_and_rc_tags
  384. # - run:
  385. # name: integration test
  386. # #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
  387. # 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!")'
  388. - run:
  389. command: echo Hello world
  390. release_candidate:
  391. environment:
  392. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  393. parameters:
  394. py_version:
  395. type: string
  396. docker:
  397. - image: cimg/python:<< parameters.py_version >>
  398. steps:
  399. - deci-common/checkout_and_skip_build:
  400. check_version_file: true
  401. skip_md_files: true
  402. - deci-common/get_persisted_version_info
  403. - run:
  404. name: edit package version
  405. command: |
  406. echo $NEW_VERSION > version.txt
  407. - deci-common/pip_upload_package_codeartifact_dev:
  408. codeartifact_repository: "deci-packages"
  409. - deci-common/pip_test_package_installation_codeartifact_dev:
  410. package_name: "super-gradients"
  411. version: $NEW_VERSION
  412. - deci-common/git_config_automation_user
  413. - run:
  414. name: "commit version file"
  415. command: |
  416. git commit version.txt -m "Deci Services - Changed version to $NEW_VERSION"
  417. - deci-common/git_commit_and_tag:
  418. version: $NEW_VERSION
  419. release_version:
  420. environment:
  421. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  422. parameters:
  423. py_version:
  424. type: string
  425. dev_venv_name:
  426. type: string
  427. default: "dev-sg-${CIRCLE_BUILD_NUM}"
  428. docker:
  429. - image: cimg/python:<< parameters.py_version >>
  430. steps:
  431. - deci-common/checkout_and_skip_build:
  432. check_version_file: true
  433. skip_md_files: false
  434. - run:
  435. name: add requirements.txt and requirements.pro.txt to source code
  436. command: |
  437. cp requirements.txt src/super_gradients/requirements.txt
  438. cp requirements.pro.txt src/super_gradients/requirements.pro.txt
  439. - run:
  440. name: edit package version
  441. command: |
  442. echo $CIRCLE_TAG > version.txt
  443. - deci-common/pip_upload_package_codeartifact_all_accounts:
  444. codeartifact_repository: "deci-packages"
  445. - deci-common/pip_test_package_installation_codeartifact_dev:
  446. package_name: "super-gradients"
  447. version: $CIRCLE_TAG
  448. venv_name: << parameters.dev_venv_name >>
  449. - run:
  450. name: verify that the output of __version__ is what we expect
  451. command: |
  452. . << parameters.dev_venv_name >>-super-gradients-$CIRCLE_TAG/bin/activate
  453. python3 tests/verify_version.py $CIRCLE_TAG
  454. - deci-common/pip_test_package_installation_codeartifact_prod:
  455. package_name: "super-gradients"
  456. version: $CIRCLE_TAG
  457. - deci-common/pip_upload_package_codeartifact_prod:
  458. codeartifact_repository: "deci-toolkit"
  459. - deci-common/git_commit_and_tag:
  460. version: $CIRCLE_TAG
  461. delete_remote_tag_before_tagging: true
  462. - deci-common/tag_as:
  463. tag_name: "stable"
  464. delete_remote: true
  465. - deci-common/github_create_release:
  466. github_cli_token: $GITHUB_CLI_TOKEN
  467. directory_to_cd_into: "."
  468. tag: $CIRCLE_TAG
  469. notes: "This GitHub Release was done automatically by CircleCI"
  470. sg_core_integration_tests_coverage:
  471. docker:
  472. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  473. resource_class: deci-ai/sg-gpu-on-premise
  474. parameters:
  475. sg_existing_env_path:
  476. type: string
  477. default: "/env/persistent_env"
  478. sg_new_env_name:
  479. type: string
  480. default: "${CIRCLE_BUILD_NUM}"
  481. sg_new_env_python_version:
  482. type: string
  483. default: "python3.8"
  484. steps:
  485. - checkout
  486. - run:
  487. name: install requirements and run recipe tests
  488. command: |
  489. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  490. source << parameters.sg_new_env_name >>/bin/activate
  491. python3.8 -m pip install --upgrade setuptools pip wheel
  492. python3.8 -m pip install -r requirements.txt
  493. python3.8 -m pip install -r requirements.dev.txt
  494. python3.8 -m pip install .
  495. coverage run --source=super_gradients -m unittest tests/deci_core_integration_test_suite_runner.py
  496. hydra_sweeper_test:
  497. docker:
  498. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  499. resource_class: deci-ai/sg-gpu-on-premise
  500. parameters:
  501. sg_existing_env_path:
  502. type: string
  503. default: "/env/persistent_env"
  504. sg_new_env_name:
  505. type: string
  506. default: "${CIRCLE_BUILD_NUM}"
  507. sg_new_env_python_version:
  508. type: string
  509. default: "python3.8"
  510. steps:
  511. - checkout
  512. - run:
  513. name: install requirements and run recipe tests
  514. command: |
  515. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  516. source << parameters.sg_new_env_name >>/bin/activate
  517. python3.8 -m pip install --upgrade setuptools pip wheel
  518. python3.8 -m pip install -r requirements.txt
  519. python3.8 -m pip install -r requirements.dev.txt
  520. python3.8 -m pip install .
  521. make sweeper_test
  522. - run:
  523. name: Remove new environment when failed
  524. command: "rm -r << parameters.sg_new_env_name >>"
  525. when: on_fail
  526. - slack/notify:
  527. channel: "sg-integration-tests"
  528. event: fail
  529. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  530. recipe_accuracy_tests:
  531. docker:
  532. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  533. resource_class: deci-ai/sg-gpu-on-premise
  534. parameters:
  535. sg_existing_env_path:
  536. type: string
  537. default: "/env/persistent_env"
  538. sg_new_env_name:
  539. type: string
  540. default: "${CIRCLE_BUILD_NUM}"
  541. sg_new_env_python_version:
  542. type: string
  543. default: "python3.8"
  544. steps:
  545. - checkout
  546. - run:
  547. name: install requirements and run recipe tests
  548. command: |
  549. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  550. source << parameters.sg_new_env_name >>/bin/activate
  551. python3.8 -m pip install --upgrade setuptools pip wheel
  552. python3.8 -m pip install -r requirements.txt
  553. python3.8 -m pip install -r requirements.dev.txt
  554. python3.8 -m pip install .
  555. python3.8 tests/verify_min_samples_ddp.py
  556. python3.8 tests/verify_distributed_sampler_wrapper.py
  557. 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
  558. 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
  559. 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
  560. 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
  561. 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
  562. coverage run --source=super_gradients -m unittest tests/deci_core_recipe_test_suite_runner.py
  563. - run:
  564. name: Remove new environment when failed
  565. command: "rm -r << parameters.sg_new_env_name >>"
  566. when: on_fail
  567. - slack/notify:
  568. channel: "sg-integration-tests"
  569. event: fail
  570. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  571. run_and_convert_notebooks_to_docs:
  572. parallelism: 12 # Adjust based on your needs and available resources
  573. docker:
  574. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  575. resource_class: deci-ai/sg-gpu-on-premise
  576. parameters:
  577. sg_existing_env_path:
  578. type: string
  579. default: "/env/persistent_env"
  580. sg_new_env_name:
  581. type: string
  582. default: "${CIRCLE_BUILD_NUM}"
  583. sg_new_env_python_version:
  584. type: string
  585. default: "python3.8"
  586. steps:
  587. - checkout
  588. - run:
  589. name: Setup Environment
  590. command: |
  591. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  592. source << parameters.sg_new_env_name >>/bin/activate
  593. # Upgrade pip, setuptools, and wheel
  594. pip install --upgrade pip setuptools wheel
  595. # Install project-specific dependencies from requirements files
  596. pip install -r requirements.txt
  597. pip install -r requirements.dev.txt
  598. # Install your project (if it's a package)
  599. pip install .
  600. # Install the IPython kernel
  601. python -m ipykernel install --name << parameters.sg_new_env_name >> --user
  602. - run:
  603. name: Find and Run Notebooks
  604. no_output_timeout: 180m
  605. command: |
  606. NOTEBOOKS=$(find notebooks -name '*.ipynb' \
  607. | grep -v 'notebooks/DEKR_PoseEstimationFineTuning.ipynb' \
  608. | grep -v 'notebooks/yolo_nas_pose_eval_with_pycocotools.ipynb' \
  609. | grep -v 'notebooks/albumentations_tutorial.ipynb' \
  610. | grep -v 'notebooks/dataloader_adapter.ipynb')
  611. TOTAL=$(echo "$NOTEBOOKS" | wc -l)
  612. echo "Total notebooks: $TOTAL"
  613. SLICE=$((TOTAL / CIRCLE_NODE_TOTAL))
  614. EXTRA=$((TOTAL % CIRCLE_NODE_TOTAL))
  615. OFFSET=$((SLICE * CIRCLE_NODE_INDEX))
  616. OFFSET=$((OFFSET + (CIRCLE_NODE_INDEX < EXTRA ? CIRCLE_NODE_INDEX : EXTRA)))
  617. COUNT=$((SLICE + (CIRCLE_NODE_INDEX < EXTRA ? 1 : 0)))
  618. echo "Offset for this node: $OFFSET, Count: $COUNT"
  619. if [ "$COUNT" -eq "0" ]; then
  620. echo "No notebooks to process on this node."
  621. exit 0
  622. fi
  623. PART=$(echo "$NOTEBOOKS" | tail -n +$((OFFSET + 1)) | head -n $COUNT)
  624. echo "Notebooks to process by this node:"
  625. echo "$PART"
  626. for NOTEBOOK in $PART; do
  627. echo "Processing $NOTEBOOK"
  628. chmod +x scripts/run_and_convert_notebook.sh
  629. ./scripts/run_and_convert_notebook.sh "$NOTEBOOK" "<< parameters.sg_new_env_name >>"
  630. done
  631. recipe_sanity_tests_classification_pt1:
  632. docker:
  633. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  634. resource_class: deci-ai/sg-gpu-on-premise
  635. parameters:
  636. sg_existing_env_path:
  637. type: string
  638. default: "/env/persistent_env"
  639. sg_new_env_name:
  640. type: string
  641. default: "${CIRCLE_BUILD_NUM}"
  642. sg_new_env_python_version:
  643. type: string
  644. default: "python3.8"
  645. steps:
  646. - checkout
  647. - run:
  648. name: install requirements and run classification sanity tests
  649. command: |
  650. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  651. source << parameters.sg_new_env_name >>/bin/activate
  652. ls /data/
  653. python3.8 -m pip install --upgrade setuptools pip wheel
  654. python3.8 -m pip install -r requirements.txt
  655. python3.8 -m pip install .
  656. 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
  657. 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
  658. 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
  659. 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
  660. 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
  661. 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
  662. python3.8 src/super_gradients/convert_recipe_to_code.py cifar10_resnet.yaml train_cifar10_resnet.py && python3.8 train_cifar10_resnet.py
  663. - run:
  664. name: Remove new environment when failed
  665. command: "rm -r << parameters.sg_new_env_name >>"
  666. when: on_fail
  667. - slack/notify:
  668. channel: "sg-integration-tests"
  669. event: fail
  670. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  671. recipe_sanity_tests_classification_pt2:
  672. docker:
  673. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  674. resource_class: deci-ai/sg-gpu-on-premise
  675. parameters:
  676. sg_existing_env_path:
  677. type: string
  678. default: "/env/persistent_env"
  679. sg_new_env_name:
  680. type: string
  681. default: "${CIRCLE_BUILD_NUM}"
  682. sg_new_env_python_version:
  683. type: string
  684. default: "python3.8"
  685. steps:
  686. - checkout
  687. - run:
  688. name: install requirements and run classification sanity tests
  689. command: |
  690. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  691. source << parameters.sg_new_env_name >>/bin/activate
  692. python3.8 -m pip install --upgrade setuptools pip wheel
  693. python3.8 -m pip install -r requirements.txt
  694. python3.8 -m pip install .
  695. 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
  696. 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
  697. 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
  698. 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
  699. 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
  700. 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
  701. - run:
  702. name: Remove new environment when failed
  703. command: "rm -r << parameters.sg_new_env_name >>"
  704. when: on_fail
  705. - slack/notify:
  706. channel: "sg-integration-tests"
  707. event: fail
  708. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  709. recipe_sanity_tests_segmentation:
  710. docker:
  711. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  712. resource_class: deci-ai/sg-gpu-on-premise
  713. parameters:
  714. sg_existing_env_path:
  715. type: string
  716. default: "/env/persistent_env"
  717. sg_new_env_name:
  718. type: string
  719. default: "${CIRCLE_BUILD_NUM}"
  720. sg_new_env_python_version:
  721. type: string
  722. default: "python3.8"
  723. steps:
  724. - checkout
  725. - run:
  726. name: install requirements and run segmentation sanity tests
  727. command: |
  728. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  729. source << parameters.sg_new_env_name >>/bin/activate
  730. python3.8 -m pip install --upgrade setuptools pip wheel
  731. python3.8 -m pip install -r requirements.txt
  732. python3.8 -m pip install .
  733. 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
  734. wget -O $(pwd)/checkpoints/ddrnet23_bb_imagenet.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet23_bb_imagenet.pth
  735. wget -O $(pwd)/checkpoints/ddrnet39_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet39_bb_imagenet.pth
  736. 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
  737. 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
  738. 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
  739. wget -O $(pwd)/checkpoints/stdc1_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc1_imagenet_pretrained.pth
  740. wget -O $(pwd)/checkpoints/stdc2_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc2_imagenet_pretrained.pth
  741. 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
  742. 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
  743. 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
  744. 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
  745. 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
  746. 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
  747. 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
  748. 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
  749. - run:
  750. name: Remove new environment when failed
  751. command: "rm -r << parameters.sg_new_env_name >>"
  752. when: on_fail
  753. - slack/notify:
  754. channel: "sg-integration-tests"
  755. event: fail
  756. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  757. recipe_sanity_tests_detection:
  758. docker:
  759. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  760. resource_class: deci-ai/sg-gpu-on-premise
  761. parameters:
  762. sg_existing_env_path:
  763. type: string
  764. default: "/env/persistent_env"
  765. sg_new_env_name:
  766. type: string
  767. default: "${CIRCLE_BUILD_NUM}"
  768. sg_new_env_python_version:
  769. type: string
  770. default: "python3.8"
  771. steps:
  772. - checkout
  773. - run:
  774. name: install requirements and run detection sanity tests
  775. command: |
  776. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  777. source << parameters.sg_new_env_name >>/bin/activate
  778. python3.8 -m pip install --upgrade setuptools pip wheel
  779. python3.8 -m pip install -r requirements.txt
  780. python3.8 -m pip install .
  781. 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
  782. 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
  783. 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
  784. 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
  785. 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
  786. 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
  787. - run:
  788. name: Remove new environment when failed
  789. command: "rm -r << parameters.sg_new_env_name >>"
  790. when: on_fail
  791. - slack/notify:
  792. channel: "sg-integration-tests"
  793. event: fail
  794. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  795. recipe_sanity_tests_pose_estimation:
  796. docker:
  797. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  798. resource_class: deci-ai/sg-gpu-on-premise
  799. parameters:
  800. sg_existing_env_path:
  801. type: string
  802. default: "/env/persistent_env"
  803. sg_new_env_name:
  804. type: string
  805. default: "${CIRCLE_BUILD_NUM}"
  806. sg_new_env_python_version:
  807. type: string
  808. default: "python3.8"
  809. steps:
  810. - checkout
  811. - run:
  812. name: install requirements and run pose estimation sanity tests
  813. command: |
  814. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  815. source << parameters.sg_new_env_name >>/bin/activate
  816. python3.8 -m pip install --upgrade setuptools pip wheel
  817. python3.8 -m pip install -r requirements.txt
  818. python3.8 -m pip install .
  819. 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
  820. - run:
  821. name: Remove new environment when failed
  822. command: "rm -r << parameters.sg_new_env_name >>"
  823. when: on_fail
  824. - slack/notify:
  825. channel: "sg-integration-tests"
  826. event: fail
  827. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  828. docker-build-and-publish-branch:
  829. docker:
  830. - image: cimg/base:stable-20.04
  831. parameters:
  832. repo_name:
  833. type: string
  834. default: "deci/super-gradients"
  835. docker_context:
  836. type: string
  837. default: "."
  838. additional_tags:
  839. type: string
  840. default: ''
  841. steps:
  842. - setup_remote_docker:
  843. version: 20.10.7
  844. docker_layer_caching: true
  845. - deci-common/container_image_lint_tag:
  846. image_tag: "${CIRCLE_BRANCH}"
  847. - run:
  848. command: |
  849. ADDITIONAL_TAGS="<< parameters.additional_tags >>"
  850. echo "export ADDITIONAL_TAGS=${ADDITIONAL_TAGS}" >> $BASH_ENV
  851. - run:
  852. command: |
  853. source $BASH_ENV
  854. echo "$CONTAINER_LINT_TAG"
  855. echo "$ADDITIONAL_TAGS"
  856. - when:
  857. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  858. steps:
  859. - build_and_publish_command:
  860. repo_name: << parameters.repo_name >>
  861. docker_context: << parameters.docker_context >>
  862. image_tag: $CONTAINER_LINT_TAG
  863. additional_tags: $ADDITIONAL_TAGS
  864. dockerfile: 'scripts/Dockerfile.branch.code'
  865. build_args: "BASE_TAG=$CONTAINER_LINT_TAG"
  866. - unless:
  867. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  868. steps:
  869. - build_and_publish_command:
  870. repo_name: << parameters.repo_name >>
  871. docker_context: << parameters.docker_context >>
  872. image_tag: $CONTAINER_LINT_TAG
  873. additional_tags: $ADDITIONAL_TAGS
  874. dockerfile: 'scripts/Dockerfile.branch'
  875. workflows:
  876. sanity_tests:
  877. when: << pipeline.parameters.run_sanity_tests_flow >>
  878. jobs:
  879. - sg_core_integration_tests_coverage:
  880. context:
  881. - slack
  882. - hydra_sweeper_test:
  883. context:
  884. - slack
  885. - recipe_sanity_tests_classification_pt1:
  886. context:
  887. - slack
  888. - recipe_sanity_tests_classification_pt2:
  889. context:
  890. - slack
  891. - recipe_sanity_tests_segmentation:
  892. context:
  893. - slack
  894. - recipe_sanity_tests_detection:
  895. context:
  896. - slack
  897. - recipe_sanity_tests_pose_estimation:
  898. context:
  899. - slack
  900. - recipe_accuracy_tests:
  901. context:
  902. - slack
  903. - run_and_convert_notebooks_to_docs:
  904. context:
  905. - slack
  906. run_and_convert_notebooks_to_docs:
  907. when: << pipeline.parameters.run_and_convert_notebooks_to_docs >>
  908. jobs:
  909. - run_and_convert_notebooks_to_docs:
  910. context:
  911. - slack
  912. release:
  913. unless:
  914. or:
  915. - << pipeline.parameters.ad_hoc_container_build >>
  916. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  917. jobs:
  918. - deci-common/persist_version_info:
  919. version_override: $CIRCLE_TAG
  920. <<: *release_tag_filter
  921. - deci-common/codeartifact_login:
  922. name: "login_to_codeartifact_release"
  923. repo_name: "deci-packages"
  924. <<: *release_tag_filter
  925. - build:
  926. name: "build3.8"
  927. py_version: "3.8"
  928. package_name: "super-gradients"
  929. requires:
  930. - deci-common/persist_version_info
  931. - login_to_codeartifact_release
  932. <<: *release_tag_filter
  933. - sg_core_integration_tests_coverage:
  934. context:
  935. - slack
  936. <<: *release_tag_filter
  937. - hydra_sweeper_test:
  938. context:
  939. - slack
  940. <<: *release_tag_filter
  941. - recipe_sanity_tests_classification_pt1:
  942. context:
  943. - slack
  944. <<: *release_tag_filter
  945. - recipe_sanity_tests_classification_pt2:
  946. context:
  947. - slack
  948. <<: *release_tag_filter
  949. - recipe_sanity_tests_segmentation:
  950. context:
  951. - slack
  952. <<: *release_tag_filter
  953. - recipe_sanity_tests_detection:
  954. context:
  955. - slack
  956. <<: *release_tag_filter
  957. - recipe_sanity_tests_pose_estimation:
  958. context:
  959. - slack
  960. <<: *release_tag_filter
  961. - recipe_accuracy_tests:
  962. context:
  963. - slack
  964. <<: *release_tag_filter
  965. # Temporary disabled until we figure out why it is failing at `release` workflow
  966. # but not at `sanity_check` or `run_and_convert_notebooks_to_docs` workflows
  967. # - run_and_convert_notebooks_to_docs:
  968. # context:
  969. # - slack
  970. # <<: *release_tag_filter
  971. - release_version:
  972. py_version: "3.8"
  973. requires:
  974. - "build3.8"
  975. - sg_core_integration_tests_coverage
  976. - hydra_sweeper_test
  977. - recipe_accuracy_tests
  978. - recipe_sanity_tests_classification_pt1
  979. - recipe_sanity_tests_classification_pt2
  980. - recipe_sanity_tests_segmentation
  981. - recipe_sanity_tests_detection
  982. - recipe_sanity_tests_pose_estimation
  983. # Temporary disabled until we figure out why it is failing at `release` workflow
  984. # but not at `sanity_check` or `run_and_convert_notebooks_to_docs` workflows
  985. # - run_and_convert_notebooks_to_docs
  986. <<: *release_tag_filter
  987. - deci-common/pip_upload_package_from_codeartifact_to_global_pypi:
  988. package_name: "super-gradients"
  989. name: "upload_super_gradients_to_pypi"
  990. version: $CIRCLE_TAG
  991. requires:
  992. - "release_version"
  993. context:
  994. - pypi-supergradients
  995. <<: *release_tag_filter
  996. build_and_deploy:
  997. unless:
  998. or:
  999. - << pipeline.parameters.ad_hoc_container_build >>
  1000. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  1001. jobs:
  1002. - deci-common/persist_version_info:
  1003. use_rc: true
  1004. use_beta: false
  1005. version_override: ""
  1006. - build:
  1007. name: "build<< pipeline.parameters.build_py_version >>"
  1008. py_version: << pipeline.parameters.build_py_version >>
  1009. package_name: "super-gradients"
  1010. requires:
  1011. - deci-common/persist_version_info
  1012. - breaking_change_check:
  1013. name: "breaking-change-check"
  1014. py_version: << pipeline.parameters.build_py_version >>
  1015. requires:
  1016. - deci-common/persist_version_info
  1017. - deci-common/codeartifact_login:
  1018. repo_name: "deci-packages"
  1019. <<: *release_candidate_filter
  1020. - release_candidate: # happens on merge
  1021. py_version: "<< pipeline.parameters.build_py_version >>"
  1022. requires:
  1023. - "build<< pipeline.parameters.build_py_version >>"
  1024. - deci-common/codeartifact_login
  1025. <<: *release_candidate_filter
  1026. SG_docker:
  1027. unless:
  1028. or:
  1029. - << pipeline.parameters.ad_hoc_container_build >>
  1030. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  1031. jobs:
  1032. - change_rc_to_b: # works on release candidate creation
  1033. <<: *release_candidate_tag_filter
  1034. - build_and_publish_sg_container: # works on release candidate creation
  1035. requires:
  1036. - "change_rc_to_b"
  1037. <<: *release_candidate_tag_filter
  1038. - testing_supergradients_docker_image: # works on release candidate creation
  1039. image_repo: '307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/super-gradients'
  1040. requires:
  1041. - "build_and_publish_sg_container"
  1042. - "change_rc_to_b"
  1043. <<: *release_candidate_tag_filter
  1044. - add_rc_tag_to_beta: # works on release candidate creation for ECR Repo
  1045. requires:
  1046. - "testing_supergradients_docker_image"
  1047. - "change_rc_to_b"
  1048. <<: *release_candidate_tag_filter
  1049. - find_rc_tag_per_sha: # works on release
  1050. <<: *release_tag_filter
  1051. - add_release_tag_to_rc: # works on release
  1052. requires:
  1053. - "find_rc_tag_per_sha"
  1054. <<: *release_tag_filter
  1055. - slack/on-hold:
  1056. context: slack
  1057. channel: "sg-integration-tests"
  1058. requires:
  1059. - "add_release_tag_to_rc"
  1060. <<: *release_tag_filter
  1061. - hold-sg-public-release: # works on release
  1062. type: approval
  1063. requires:
  1064. - "slack/on-hold"
  1065. <<: *release_tag_filter
  1066. - docker/publish: # works on release
  1067. executor:
  1068. image: cimg/base
  1069. tag: stable-20.04
  1070. name: docker/docker
  1071. image: deciai/super-gradients
  1072. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1073. update-description: true
  1074. use-buildkit: true
  1075. use-remote-docker: true
  1076. use-docker-credentials-store: true
  1077. path: ./scripts
  1078. readme: ../README.md
  1079. tag: latest,${CIRCLE_TAG}
  1080. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG}' #building from scratch as it faster and cheaper than download and retag
  1081. requires:
  1082. - "hold-sg-public-release"
  1083. <<: *release_tag_filter
  1084. - docker/publish: # works on release
  1085. executor:
  1086. image: cimg/base
  1087. tag: stable-20.04
  1088. name: docker/docker
  1089. image: deciai/super-gradients
  1090. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1091. update-description: false
  1092. use-buildkit: true
  1093. use-remote-docker: true
  1094. use-docker-credentials-store: true
  1095. path: ./scripts
  1096. tag: ${CIRCLE_TAG}-runtime
  1097. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG} --build-arg DOCKER_IMAGE_TAG=11.3.1-runtime-ubuntu20.04'
  1098. requires:
  1099. - "hold-sg-public-release"
  1100. <<: *release_tag_filter
  1101. build-and-push-container-flow:
  1102. when: << pipeline.parameters.ad_hoc_container_build >>
  1103. jobs:
  1104. - docker-build-and-publish-branch
  1105. build-and-push-container-code-only-flow:
  1106. when: << pipeline.parameters.ad_hoc_container_build_code_only >>
  1107. jobs:
  1108. - docker-build-and-publish-branch
Tip!

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

Comments

Loading...