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

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

Comments

Loading...