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
  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. hydra_sweeper_test:
  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. python3.8 -m pip install torch torchvision torchaudio
  503. make sweeper_test
  504. - run:
  505. name: Remove new environment when failed
  506. command: "rm -r << parameters.sg_new_env_name >>"
  507. when: on_fail
  508. - slack/notify:
  509. channel: "sg-integration-tests"
  510. event: fail
  511. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  512. recipe_accuracy_tests:
  513. docker:
  514. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  515. resource_class: deci-ai/sg-gpu-on-premise
  516. parameters:
  517. sg_existing_env_path:
  518. type: string
  519. default: "/env/persistent_env"
  520. sg_new_env_name:
  521. type: string
  522. default: "${CIRCLE_BUILD_NUM}"
  523. sg_new_env_python_version:
  524. type: string
  525. default: "python3.8"
  526. steps:
  527. - checkout
  528. - run:
  529. name: install requirements and run recipe tests
  530. command: |
  531. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  532. source << parameters.sg_new_env_name >>/bin/activate
  533. python3.8 -m pip install --upgrade setuptools pip wheel
  534. python3.8 -m pip install -r requirements.txt
  535. python3.8 -m pip install -r requirements.dev.txt
  536. python3.8 -m pip install .
  537. python3.8 -m pip install torch torchvision torchaudio
  538. python3.8 -m pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com
  539. python3.8 tests/verify_min_samples_ddp.py
  540. 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
  541. 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
  542. 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
  543. 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
  544. 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
  545. coverage run --source=super_gradients -m unittest tests/deci_core_recipe_test_suite_runner.py
  546. - run:
  547. name: Remove new environment when failed
  548. command: "rm -r << parameters.sg_new_env_name >>"
  549. when: on_fail
  550. - slack/notify:
  551. channel: "sg-integration-tests"
  552. event: fail
  553. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  554. run_and_convert_notebooks_to_docs:
  555. parallelism: 11 # Adjust based on your needs and available resources
  556. docker:
  557. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  558. resource_class: deci-ai/sg-gpu-on-premise
  559. parameters:
  560. sg_existing_env_path:
  561. type: string
  562. default: "/env/persistent_env"
  563. sg_new_env_name:
  564. type: string
  565. default: "${CIRCLE_BUILD_NUM}"
  566. sg_new_env_python_version:
  567. type: string
  568. default: "python3.8"
  569. steps:
  570. - checkout
  571. - run:
  572. name: Setup Environment
  573. command: |
  574. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  575. source << parameters.sg_new_env_name >>/bin/activate
  576. # Upgrade pip, setuptools, and wheel
  577. pip install --upgrade pip setuptools wheel
  578. # Install project-specific dependencies from requirements files
  579. pip install -r requirements.txt
  580. pip install -r requirements.dev.txt
  581. # Install your project (if it's a package)
  582. pip install .
  583. # Install PyTorch, torchvision, and torchaudio
  584. pip install torch torchvision torchaudio
  585. # Install additional specific dependencies
  586. pip install pytorch-quantization==2.1.2 --extra-index-url https://pypi.ngc.nvidia.com
  587. pip install onnx_graphsurgeon==0.3.27 --extra-index-url https://pypi.ngc.nvidia.com
  588. # Install Jupyter and nbconvert for notebook execution
  589. pip install jupyter nbconvert
  590. # Install the IPython kernel
  591. python -m ipykernel install --name myenv --user
  592. - run:
  593. name: Find and Run Notebooks
  594. no_output_timeout: 180m
  595. command: |
  596. NOTEBOOKS=$(find notebooks -name '*.ipynb' \
  597. | grep -v 'notebooks/DEKR_PoseEstimationFineTuning.ipynb' \
  598. | grep -v 'notebooks/yolo_nas_pose_eval_with_pycocotools.ipynb' \
  599. | grep -v 'notebooks/albumentations_tutorial.ipynb' \
  600. | grep -v 'notebooks/dataloader_adapter.ipynb')
  601. TOTAL=$(echo "$NOTEBOOKS" | wc -l)
  602. echo "Total notebooks: $TOTAL"
  603. SLICE=$((TOTAL / CIRCLE_NODE_TOTAL))
  604. EXTRA=$((TOTAL % CIRCLE_NODE_TOTAL))
  605. OFFSET=$((SLICE * CIRCLE_NODE_INDEX))
  606. OFFSET=$((OFFSET + (CIRCLE_NODE_INDEX < EXTRA ? CIRCLE_NODE_INDEX : EXTRA)))
  607. COUNT=$((SLICE + (CIRCLE_NODE_INDEX < EXTRA ? 1 : 0)))
  608. echo "Offset for this node: $OFFSET, Count: $COUNT"
  609. if [ "$COUNT" -eq "0" ]; then
  610. echo "No notebooks to process on this node."
  611. exit 0
  612. fi
  613. PART=$(echo "$NOTEBOOKS" | tail -n +$((OFFSET + 1)) | head -n $COUNT)
  614. echo "Notebooks to process by this node:"
  615. echo "$PART"
  616. for NOTEBOOK in $PART; do
  617. echo "Processing $NOTEBOOK"
  618. chmod +x scripts/run_and_convert_notebook.sh
  619. ./scripts/run_and_convert_notebook.sh "$NOTEBOOK" "<< parameters.sg_new_env_name >>"
  620. done
  621. recipe_sanity_tests_classification_pt1:
  622. docker:
  623. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  624. resource_class: deci-ai/sg-gpu-on-premise
  625. parameters:
  626. sg_existing_env_path:
  627. type: string
  628. default: "/env/persistent_env"
  629. sg_new_env_name:
  630. type: string
  631. default: "${CIRCLE_BUILD_NUM}"
  632. sg_new_env_python_version:
  633. type: string
  634. default: "python3.8"
  635. steps:
  636. - checkout
  637. - run:
  638. name: install requirements and run classification sanity tests
  639. command: |
  640. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  641. source << parameters.sg_new_env_name >>/bin/activate
  642. ls /data/
  643. python3.8 -m pip install --upgrade setuptools pip wheel
  644. python3.8 -m pip install -r requirements.txt
  645. python3.8 -m pip install .
  646. python3.8 -m pip install torch torchvision torchaudio
  647. 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
  648. 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
  649. 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
  650. 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
  651. 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
  652. 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
  653. python3.8 src/super_gradients/convert_recipe_to_code.py cifar10_resnet.yaml train_cifar10_resnet.py && python3.8 train_cifar10_resnet.py
  654. - run:
  655. name: Remove new environment when failed
  656. command: "rm -r << parameters.sg_new_env_name >>"
  657. when: on_fail
  658. - slack/notify:
  659. channel: "sg-integration-tests"
  660. event: fail
  661. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  662. recipe_sanity_tests_classification_pt2:
  663. docker:
  664. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  665. resource_class: deci-ai/sg-gpu-on-premise
  666. parameters:
  667. sg_existing_env_path:
  668. type: string
  669. default: "/env/persistent_env"
  670. sg_new_env_name:
  671. type: string
  672. default: "${CIRCLE_BUILD_NUM}"
  673. sg_new_env_python_version:
  674. type: string
  675. default: "python3.8"
  676. steps:
  677. - checkout
  678. - run:
  679. name: install requirements and run classification sanity tests
  680. command: |
  681. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  682. source << parameters.sg_new_env_name >>/bin/activate
  683. python3.8 -m pip install --upgrade setuptools pip wheel
  684. python3.8 -m pip install -r requirements.txt
  685. python3.8 -m pip install .
  686. python3.8 -m pip install torch torchvision torchaudio
  687. 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
  688. 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
  689. 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
  690. 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
  691. 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
  692. 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
  693. - run:
  694. name: Remove new environment when failed
  695. command: "rm -r << parameters.sg_new_env_name >>"
  696. when: on_fail
  697. - slack/notify:
  698. channel: "sg-integration-tests"
  699. event: fail
  700. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  701. recipe_sanity_tests_segmentation:
  702. docker:
  703. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  704. resource_class: deci-ai/sg-gpu-on-premise
  705. parameters:
  706. sg_existing_env_path:
  707. type: string
  708. default: "/env/persistent_env"
  709. sg_new_env_name:
  710. type: string
  711. default: "${CIRCLE_BUILD_NUM}"
  712. sg_new_env_python_version:
  713. type: string
  714. default: "python3.8"
  715. steps:
  716. - checkout
  717. - run:
  718. name: install requirements and run segmentation sanity tests
  719. command: |
  720. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  721. source << parameters.sg_new_env_name >>/bin/activate
  722. python3.8 -m pip install --upgrade setuptools pip wheel
  723. python3.8 -m pip install -r requirements.txt
  724. python3.8 -m pip install .
  725. python3.8 -m pip install torch torchvision torchaudio
  726. 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
  727. wget -O $(pwd)/checkpoints/ddrnet23_bb_imagenet.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet23_bb_imagenet.pth
  728. wget -O $(pwd)/checkpoints/ddrnet39_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet39_bb_imagenet.pth
  729. 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
  730. 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
  731. 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
  732. wget -O $(pwd)/checkpoints/stdc1_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc1_imagenet_pretrained.pth
  733. wget -O $(pwd)/checkpoints/stdc2_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc2_imagenet_pretrained.pth
  734. 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
  735. 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
  736. 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
  737. 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
  738. 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
  739. 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
  740. 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
  741. 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
  742. - run:
  743. name: Remove new environment when failed
  744. command: "rm -r << parameters.sg_new_env_name >>"
  745. when: on_fail
  746. - slack/notify:
  747. channel: "sg-integration-tests"
  748. event: fail
  749. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  750. recipe_sanity_tests_detection:
  751. docker:
  752. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  753. resource_class: deci-ai/sg-gpu-on-premise
  754. parameters:
  755. sg_existing_env_path:
  756. type: string
  757. default: "/env/persistent_env"
  758. sg_new_env_name:
  759. type: string
  760. default: "${CIRCLE_BUILD_NUM}"
  761. sg_new_env_python_version:
  762. type: string
  763. default: "python3.8"
  764. steps:
  765. - checkout
  766. - run:
  767. name: install requirements and run detection sanity tests
  768. command: |
  769. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  770. source << parameters.sg_new_env_name >>/bin/activate
  771. python3.8 -m pip install --upgrade setuptools pip wheel
  772. python3.8 -m pip install -r requirements.txt
  773. python3.8 -m pip install .
  774. python3.8 -m pip install torch torchvision torchaudio
  775. 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
  776. 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
  777. 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
  778. 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
  779. 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
  780. 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
  781. - run:
  782. name: Remove new environment when failed
  783. command: "rm -r << parameters.sg_new_env_name >>"
  784. when: on_fail
  785. - slack/notify:
  786. channel: "sg-integration-tests"
  787. event: fail
  788. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  789. recipe_sanity_tests_pose_estimation:
  790. docker:
  791. - image: 307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/infra/circleci/runner/sg-gpu:<< pipeline.parameters.sg_docker_version >>
  792. resource_class: deci-ai/sg-gpu-on-premise
  793. parameters:
  794. sg_existing_env_path:
  795. type: string
  796. default: "/env/persistent_env"
  797. sg_new_env_name:
  798. type: string
  799. default: "${CIRCLE_BUILD_NUM}"
  800. sg_new_env_python_version:
  801. type: string
  802. default: "python3.8"
  803. steps:
  804. - checkout
  805. - run:
  806. name: install requirements and run pose estimation sanity tests
  807. command: |
  808. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  809. source << parameters.sg_new_env_name >>/bin/activate
  810. python3.8 -m pip install --upgrade setuptools pip wheel
  811. python3.8 -m pip install -r requirements.txt
  812. python3.8 -m pip install .
  813. python3.8 -m pip install torch torchvision torchaudio
  814. 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
  815. - run:
  816. name: Remove new environment when failed
  817. command: "rm -r << parameters.sg_new_env_name >>"
  818. when: on_fail
  819. - slack/notify:
  820. channel: "sg-integration-tests"
  821. event: fail
  822. template: basic_fail_1 # see https://github.com/CircleCI-Public/slack-orb/wiki#templates.
  823. docker-build-and-publish-branch:
  824. docker:
  825. - image: cimg/base:stable-20.04
  826. parameters:
  827. repo_name:
  828. type: string
  829. default: "deci/super-gradients"
  830. docker_context:
  831. type: string
  832. default: "."
  833. additional_tags:
  834. type: string
  835. default: ''
  836. steps:
  837. - setup_remote_docker:
  838. version: 20.10.7
  839. docker_layer_caching: true
  840. - deci-common/container_image_lint_tag:
  841. image_tag: "${CIRCLE_BRANCH}"
  842. - run:
  843. command: |
  844. ADDITIONAL_TAGS="<< parameters.additional_tags >>"
  845. echo "export ADDITIONAL_TAGS=${ADDITIONAL_TAGS}" >> $BASH_ENV
  846. - run:
  847. command: |
  848. source $BASH_ENV
  849. echo "$CONTAINER_LINT_TAG"
  850. echo "$ADDITIONAL_TAGS"
  851. - when:
  852. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  853. steps:
  854. - build_and_publish_command:
  855. repo_name: << parameters.repo_name >>
  856. docker_context: << parameters.docker_context >>
  857. image_tag: $CONTAINER_LINT_TAG
  858. additional_tags: $ADDITIONAL_TAGS
  859. dockerfile: 'scripts/Dockerfile.branch.code'
  860. build_args: "BASE_TAG=$CONTAINER_LINT_TAG"
  861. - unless:
  862. condition: << pipeline.parameters.ad_hoc_container_build_code_only >>
  863. steps:
  864. - build_and_publish_command:
  865. repo_name: << parameters.repo_name >>
  866. docker_context: << parameters.docker_context >>
  867. image_tag: $CONTAINER_LINT_TAG
  868. additional_tags: $ADDITIONAL_TAGS
  869. dockerfile: 'scripts/Dockerfile.branch'
  870. workflows:
  871. sanity_tests:
  872. when: << pipeline.parameters.run_sanity_tests_flow >>
  873. jobs:
  874. - hydra_sweeper_test:
  875. context:
  876. - slack
  877. - recipe_sanity_tests_classification_pt1:
  878. context:
  879. - slack
  880. - recipe_sanity_tests_classification_pt2:
  881. context:
  882. - slack
  883. - recipe_sanity_tests_segmentation:
  884. context:
  885. - slack
  886. - recipe_sanity_tests_detection:
  887. context:
  888. - slack
  889. - recipe_sanity_tests_pose_estimation:
  890. context:
  891. - slack
  892. - recipe_accuracy_tests:
  893. context:
  894. - slack
  895. - run_and_convert_notebooks_to_docs:
  896. context:
  897. - slack
  898. run_and_convert_notebooks_to_docs:
  899. when: << pipeline.parameters.run_and_convert_notebooks_to_docs >>
  900. jobs:
  901. - run_and_convert_notebooks_to_docs:
  902. context:
  903. - slack
  904. release:
  905. unless:
  906. or:
  907. - << pipeline.parameters.ad_hoc_container_build >>
  908. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  909. jobs:
  910. - deci-common/persist_version_info:
  911. version_override: $CIRCLE_TAG
  912. <<: *release_tag_filter
  913. - deci-common/codeartifact_login:
  914. name: "login_to_codeartifact_release"
  915. repo_name: "deci-packages"
  916. <<: *release_tag_filter
  917. - build:
  918. name: "build3.8"
  919. py_version: "3.8"
  920. package_name: "super-gradients"
  921. requires:
  922. - deci-common/persist_version_info
  923. - login_to_codeartifact_release
  924. <<: *release_tag_filter
  925. - hydra_sweeper_test:
  926. context:
  927. - slack
  928. <<: *release_tag_filter
  929. - recipe_sanity_tests_classification_pt1:
  930. context:
  931. - slack
  932. <<: *release_tag_filter
  933. - recipe_sanity_tests_classification_pt2:
  934. context:
  935. - slack
  936. <<: *release_tag_filter
  937. - recipe_sanity_tests_segmentation:
  938. context:
  939. - slack
  940. <<: *release_tag_filter
  941. - recipe_sanity_tests_detection:
  942. context:
  943. - slack
  944. <<: *release_tag_filter
  945. - recipe_sanity_tests_pose_estimation:
  946. context:
  947. - slack
  948. <<: *release_tag_filter
  949. - recipe_accuracy_tests:
  950. context:
  951. - slack
  952. <<: *release_tag_filter
  953. - run_and_convert_notebooks_to_docs:
  954. context:
  955. - slack
  956. <<: *release_tag_filter
  957. - release_version:
  958. py_version: "3.8"
  959. requires:
  960. - "build3.8"
  961. - hydra_sweeper_test
  962. - recipe_accuracy_tests
  963. - recipe_sanity_tests_classification_pt1
  964. - recipe_sanity_tests_classification_pt2
  965. - recipe_sanity_tests_segmentation
  966. - recipe_sanity_tests_detection
  967. - recipe_sanity_tests_pose_estimation
  968. - run_and_convert_notebooks_to_docs
  969. <<: *release_tag_filter
  970. - deci-common/pip_upload_package_from_codeartifact_to_global_pypi:
  971. package_name: "super-gradients"
  972. name: "upload_super_gradients_to_pypi"
  973. version: $CIRCLE_TAG
  974. requires:
  975. - "release_version"
  976. context:
  977. - pypi-supergradients
  978. <<: *release_tag_filter
  979. build_and_deploy:
  980. unless:
  981. or:
  982. - << pipeline.parameters.ad_hoc_container_build >>
  983. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  984. jobs:
  985. - deci-common/persist_version_info:
  986. use_rc: true
  987. use_beta: false
  988. version_override: ""
  989. - build:
  990. name: "build<< pipeline.parameters.build_py_version >>"
  991. py_version: << pipeline.parameters.build_py_version >>
  992. package_name: "super-gradients"
  993. requires:
  994. - deci-common/persist_version_info
  995. - breaking_change_check:
  996. name: "breaking-change-check"
  997. py_version: << pipeline.parameters.build_py_version >>
  998. requires:
  999. - deci-common/persist_version_info
  1000. - deci-common/codeartifact_login:
  1001. repo_name: "deci-packages"
  1002. <<: *release_candidate_filter
  1003. - release_candidate: # happens on merge
  1004. py_version: "<< pipeline.parameters.build_py_version >>"
  1005. requires:
  1006. - "build<< pipeline.parameters.build_py_version >>"
  1007. - deci-common/codeartifact_login
  1008. <<: *release_candidate_filter
  1009. SG_docker:
  1010. unless:
  1011. or:
  1012. - << pipeline.parameters.ad_hoc_container_build >>
  1013. - << pipeline.parameters.ad_hoc_container_build_code_only >>
  1014. jobs:
  1015. - change_rc_to_b: # works on release candidate creation
  1016. <<: *release_candidate_tag_filter
  1017. - build_and_publish_sg_container: # works on release candidate creation
  1018. requires:
  1019. - "change_rc_to_b"
  1020. <<: *release_candidate_tag_filter
  1021. - testing_supergradients_docker_image: # works on release candidate creation
  1022. image_repo: '307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/super-gradients'
  1023. requires:
  1024. - "build_and_publish_sg_container"
  1025. - "change_rc_to_b"
  1026. <<: *release_candidate_tag_filter
  1027. - add_rc_tag_to_beta: # works on release candidate creation for ECR Repo
  1028. requires:
  1029. - "testing_supergradients_docker_image"
  1030. - "change_rc_to_b"
  1031. <<: *release_candidate_tag_filter
  1032. - find_rc_tag_per_sha: # works on release
  1033. <<: *release_tag_filter
  1034. - add_release_tag_to_rc: # works on release
  1035. requires:
  1036. - "find_rc_tag_per_sha"
  1037. <<: *release_tag_filter
  1038. - slack/on-hold:
  1039. context: slack
  1040. channel: "sg-integration-tests"
  1041. requires:
  1042. - "add_release_tag_to_rc"
  1043. <<: *release_tag_filter
  1044. - hold-sg-public-release: # works on release
  1045. type: approval
  1046. requires:
  1047. - "slack/on-hold"
  1048. <<: *release_tag_filter
  1049. - docker/publish: # works on release
  1050. executor:
  1051. image: cimg/base
  1052. tag: stable-20.04
  1053. name: docker/docker
  1054. image: deciai/super-gradients
  1055. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1056. update-description: true
  1057. use-buildkit: true
  1058. use-remote-docker: true
  1059. use-docker-credentials-store: true
  1060. path: ./scripts
  1061. readme: ../README.md
  1062. tag: latest,${CIRCLE_TAG}
  1063. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG}' #building from scratch as it faster and cheaper than download and retag
  1064. requires:
  1065. - "hold-sg-public-release"
  1066. <<: *release_tag_filter
  1067. - docker/publish: # works on release
  1068. executor:
  1069. image: cimg/base
  1070. tag: stable-20.04
  1071. name: docker/docker
  1072. image: deciai/super-gradients
  1073. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  1074. update-description: false
  1075. use-buildkit: true
  1076. use-remote-docker: true
  1077. use-docker-credentials-store: true
  1078. path: ./scripts
  1079. tag: ${CIRCLE_TAG}-runtime
  1080. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG} --build-arg DOCKER_IMAGE_TAG=11.3.1-runtime-ubuntu20.04'
  1081. requires:
  1082. - "hold-sg-public-release"
  1083. <<: *release_tag_filter
  1084. build-and-push-container-flow:
  1085. when: << pipeline.parameters.ad_hoc_container_build >>
  1086. jobs:
  1087. - docker-build-and-publish-branch
  1088. build-and-push-container-code-only-flow:
  1089. when: << pipeline.parameters.ad_hoc_container_build_code_only >>
  1090. jobs:
  1091. - docker-build-and-publish-branch
Tip!

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

Comments

Loading...