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

#634 Feature/sg 573 pose estimation

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-573-pose-estimation
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
  1. version: 2.1
  2. parameters:
  3. remote_docker_version:
  4. type: string
  5. description: remote docker version
  6. default: "20.10.18"
  7. orb_version:
  8. type: string
  9. description: Deci ai ORB version https://circleci.com/developer/orbs/orb/deci-ai/circleci-common-orb
  10. default: "10.5.0"
  11. # default: "dev:alpha"
  12. orbs:
  13. deci-common: deci-ai/circleci-common-orb@<< pipeline.parameters.orb_version >>
  14. aws-ecr: circleci/aws-ecr@8.2.1
  15. docker: circleci/docker@2.2.0
  16. slack: circleci/slack@4.12.0 # see https://circleci.com/developer/orbs/orb/circleci/slack for examples and more
  17. # This filter operates on SemVer2 tags only
  18. release_tag_filter: &release_tag_filter
  19. filters:
  20. branches:
  21. ignore: /.*/
  22. tags:
  23. only: /^\d+\.\d+\.\d+$/
  24. release_candidate_filter: &release_candidate_filter
  25. filters:
  26. branches:
  27. only: master
  28. release_candidate_tag_filter: &release_candidate_tag_filter
  29. filters:
  30. branches:
  31. ignore: /.*/
  32. tags:
  33. only: /^\d+\.\d+\.\d+rc\d+/
  34. commands:
  35. get_beta_and_rc_tags:
  36. description: "getting beta and rc tag (if exist) according to ouir convention"
  37. steps:
  38. - attach_workspace:
  39. at: ~/
  40. - run:
  41. name: push BETA_TAG and RC_TAG variable to BASH_ENV
  42. command: |
  43. if [[ -f ~/BETA_TAG ]]; then
  44. echo 'export BETA_TAG="$(cat ~/BETA_TAG)"' >> "$BASH_ENV"
  45. source $BASH_ENV
  46. fi
  47. if [[ -f ~/RC_TAG ]]; then
  48. echo 'export RC_TAG="$(cat ~/RC_TAG)"' >> "$BASH_ENV"
  49. source $BASH_ENV
  50. fi
  51. echo "RC_TAG=$RC_TAG || BETA_TAG=$BETA_TAG"
  52. adding_tag_to_ecr_container_image:
  53. description: adding a tag to an existing container image
  54. parameters:
  55. image_repo:
  56. type: string
  57. new_image_tag:
  58. type: string
  59. source_image_tag:
  60. type: string
  61. steps:
  62. - deci-common/run_on_dev_account:
  63. command: |
  64. MANIFEST=$(aws ecr batch-get-image --repository-name << parameters.image_repo >> --image-ids imageTag=<< parameters.source_image_tag >> --query 'images[].imageManifest' --output text)
  65. aws ecr put-image --repository-name << parameters.image_repo >> --image-tag << parameters.new_image_tag >> --image-manifest "$MANIFEST"
  66. echo "added tag: << parameters.new_image_tag >> to image: << parameters.image_repo >>:<< parameters.new_image_tag >>"
  67. jobs:
  68. build:
  69. environment:
  70. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  71. parameters:
  72. py_version:
  73. type: string
  74. default: latest
  75. package_name:
  76. type: string
  77. docker:
  78. - image: cimg/python:<< parameters.py_version >>
  79. resource_class: large
  80. steps:
  81. - deci-common/checkout_and_skip_build:
  82. check_version_file: true
  83. skip_md_files: true
  84. - deci-common/get_persisted_version_info
  85. - when:
  86. condition:
  87. and:
  88. - not:
  89. equal: [ develop, << pipeline.git.branch >> ]
  90. - not:
  91. equal: [ staging, << pipeline.git.branch >> ]
  92. - not:
  93. equal: [ master, << pipeline.git.branch >> ]
  94. steps:
  95. - run:
  96. name: install Black Flake8 python linter
  97. command: |
  98. pip install --user -r requirements.dev.txt
  99. - run:
  100. name: Lint all python files changed since develop branch
  101. command: |
  102. 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/')
  103. - run:
  104. name: Run Black on changed files against master branch
  105. command: |
  106. black --check setup.py $(git diff --diff-filter ACM origin/master --name-only | grep 'py$' | grep -v 'experimental/' | grep -v 'experimental_models/')
  107. - run:
  108. name: add requirements.txt and requirements.pro.txt to source code
  109. command: |
  110. cp requirements.txt src/super_gradients/requirements.txt
  111. cp requirements.pro.txt src/super_gradients/requirements.pro.txt
  112. - run:
  113. name: install python dependencies
  114. command: |
  115. python3 -m venv venv
  116. . venv/bin/activate
  117. python3 -m pip install pip==22.0.4
  118. cat requirements.txt | cut -f1 -d"#" | xargs -n 1 -L 1 pip install --progress-bar off
  119. - run:
  120. name: edit package version
  121. command: |
  122. echo "${NEW_VERSION}" > version.txt
  123. cat version.txt
  124. - run:
  125. name: setup custom environment variables
  126. command: |
  127. echo 'export PYTHONPATH=/home/circleci/super_gradients' >> $BASH_ENV
  128. echo 'export UPLOAD_LOGS=FALSE' >> $BASH_ENV
  129. - run:
  130. name: install package
  131. no_output_timeout: 30m
  132. command: |
  133. . venv/bin/activate
  134. python3 -m pip install --extra-index-url https://pypi.ngc.nvidia.com .[pro]
  135. - run:
  136. name: run tests with coverage
  137. no_output_timeout: 30m
  138. command: |
  139. . venv/bin/activate
  140. coverage run --source=super_gradients -m unittest tests/deci_core_unit_test_suite_runner.py
  141. coverage report
  142. coverage html # open htmlcov/index.html in a browser
  143. - store_artifacts:
  144. path: htmlcov
  145. - store_artifacts:
  146. path: ~/sg_logs
  147. change_rc_to_b:
  148. description: "change rc in the tag to b"
  149. docker:
  150. - image: cimg/base:stable-20.04
  151. resource_class: small
  152. steps:
  153. - run:
  154. name: change the rc to b
  155. command:
  156. |
  157. BETA_TAG=$(echo ${CIRCLE_TAG} | sed -e 's|rc|b|'); echo ${BETA_TAG} >> ~/BETA_TAG
  158. cat ~/BETA_TAG
  159. - persist_to_workspace:
  160. root: ~/
  161. paths:
  162. - "BETA_TAG"
  163. build_and_publish_sg_container:
  164. description : "building the temp image and pushing to dev ecr"
  165. parameters:
  166. repo_name:
  167. type: string
  168. default: 'deci/super-gradients'
  169. sg_python_version:
  170. type: string
  171. default: $CIRCLE_TAG
  172. docker:
  173. - image: cimg/base:stable-20.04
  174. resource_class: small
  175. steps:
  176. - checkout
  177. - get_beta_and_rc_tags
  178. - run:
  179. command: echo *$BETA_TAG*
  180. - setup_remote_docker:
  181. version: << pipeline.parameters.remote_docker_version >>
  182. docker_layer_caching: true
  183. - deci-common/container_image_build:
  184. dockerfile: scripts/Dockerfile
  185. repository_name: << parameters.repo_name >>
  186. image_tag: "$BETA_TAG"
  187. build_args: 'SG_VERSION=<< parameters.sg_python_version >>'
  188. extra_flags: ' --compress'
  189. - deci-common/push_docker_image_aws_dev:
  190. repository_name: << parameters.repo_name >>
  191. image_tag: "$BETA_TAG"
  192. additional_tags: "latest"
  193. find_rc_tag_per_sha:
  194. description: this command will take the sha of the last commit and find the rc tag it belongs to as ${RC_TAG} variale
  195. docker:
  196. - image: cimg/aws:2022.11.1
  197. resource_class: small
  198. steps:
  199. - checkout
  200. - run:
  201. name: get rc tag of the final tag
  202. command: |
  203. if [[ $(RC_TAG=$(git tag --contains ${CIRCLE_SHA1} | grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+rc[[:digit:]]+' | head -n 1)) ]] ; then
  204. echo "Found RC version: ${RC_TAG}"
  205. echo $RC_TAG >> ~/RC_TAG
  206. else
  207. echo "No Rc Tag found for commit"
  208. circleci-agent step halt
  209. fi
  210. - persist_to_workspace:
  211. root: ~/
  212. paths:
  213. - "RC_TAG"
  214. add_rc_tag_to_beta:
  215. description: in the event of successful test promote beta to rc
  216. parameters:
  217. image_repo:
  218. type: string
  219. default: "deci/super-gradients"
  220. docker:
  221. - image: cimg/base:stable-20.04
  222. resource_class: small
  223. steps:
  224. - get_beta_and_rc_tags
  225. - run:
  226. command: |
  227. echo $BETA_TAG
  228. - adding_tag_to_ecr_container_image:
  229. image_repo: << parameters.image_repo >>
  230. source_image_tag: $BETA_TAG
  231. new_image_tag: $CIRCLE_TAG
  232. add_release_tag_to_rc:
  233. description: in the event of successful test promote rc to release and latest
  234. parameters:
  235. image_repo:
  236. type: string
  237. default: "deci/super-gradients"
  238. docker:
  239. - image: cimg/base:stable-20.04
  240. resource_class: small
  241. steps:
  242. - get_beta_and_rc_tags
  243. - run:
  244. command: |
  245. if [ -z $RC_TAG ] ; then
  246. circleci-agent step halt
  247. else
  248. echo $RC_TAG
  249. fi
  250. - adding_tag_to_ecr_container_image:
  251. image_repo: << parameters.image_repo >>
  252. source_image_tag: $RC_TAG
  253. new_image_tag: ${CIRCLE_TAG}
  254. testing_supergradients_docker_image:
  255. description: "running integration test on the code"
  256. parameters:
  257. image_repo:
  258. type: string
  259. #reserved for testing when will be done
  260. #machine: true
  261. #resource_class: deci-ai/research-standard
  262. docker:
  263. - image: cimg/base:stable-20.04
  264. steps:
  265. - deci-common/ecr_login_dev
  266. - get_beta_and_rc_tags
  267. # - run:
  268. # name: integration test
  269. # #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
  270. # 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!")'
  271. - run:
  272. command: echo Hello world
  273. release_candidate:
  274. environment:
  275. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  276. parameters:
  277. py_version:
  278. type: string
  279. docker:
  280. - image: cimg/python:<< parameters.py_version >>
  281. steps:
  282. - deci-common/checkout_and_skip_build:
  283. check_version_file: true
  284. skip_md_files: true
  285. - deci-common/get_persisted_version_info
  286. - run:
  287. name: edit package version
  288. command: |
  289. echo $NEW_VERSION > version.txt
  290. - deci-common/pip_upload_package_codeartifact_dev:
  291. codeartifact_repository: "deci-packages"
  292. - deci-common/pip_test_package_installation_codeartifact_dev:
  293. package_name: "super-gradients"
  294. version: $NEW_VERSION
  295. - deci-common/git_config_automation_user
  296. - run:
  297. name: "commit version file"
  298. command: |
  299. git commit version.txt -m "Deci Services - Changed version to $NEW_VERSION"
  300. - deci-common/git_commit_and_tag:
  301. version: $NEW_VERSION
  302. release_version:
  303. environment:
  304. CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
  305. parameters:
  306. py_version:
  307. type: string
  308. dev_venv_name:
  309. type: string
  310. default: "dev-sg-${CIRCLE_BUILD_NUM}"
  311. docker:
  312. - image: cimg/python:<< parameters.py_version >>
  313. steps:
  314. - deci-common/checkout_and_skip_build:
  315. check_version_file: true
  316. skip_md_files: true
  317. - run:
  318. name: add requirements.txt and requirements.pro.txt to source code
  319. command: |
  320. cp requirements.txt src/super_gradients/requirements.txt
  321. cp requirements.pro.txt src/super_gradients/requirements.pro.txt
  322. - run:
  323. name: edit package version
  324. command: |
  325. echo $CIRCLE_TAG > version.txt
  326. - deci-common/pip_upload_package_codeartifact_all_accounts:
  327. codeartifact_repository: "deci-packages"
  328. - deci-common/pip_test_package_installation_codeartifact_dev:
  329. package_name: "super-gradients"
  330. version: $CIRCLE_TAG
  331. venv_name: << parameters.dev_venv_name >>
  332. - run:
  333. name: verify that the output of __version__ is what we expect
  334. command: |
  335. . << parameters.dev_venv_name >>-super-gradients-$CIRCLE_TAG/bin/activate
  336. python3 tests/verify_version.py $CIRCLE_TAG
  337. - deci-common/pip_test_package_installation_codeartifact_prod:
  338. package_name: "super-gradients"
  339. version: $CIRCLE_TAG
  340. - deci-common/pip_upload_package_codeartifact_prod:
  341. codeartifact_repository: "deci-toolkit"
  342. - deci-common/git_commit_and_tag:
  343. version: $CIRCLE_TAG
  344. delete_remote_tag_before_tagging: true
  345. - deci-common/tag_as:
  346. tag_name: "stable"
  347. delete_remote: true
  348. - deci-common/github_create_release:
  349. github_cli_token: $GITHUB_CLI_TOKEN
  350. directory_to_cd_into: "."
  351. tag: $CIRCLE_TAG
  352. notes: "This GitHub Release was done automatically by CircleCI"
  353. recipe_accuracy_tests:
  354. machine: true
  355. resource_class: deci-ai/sg-gpu-on-premise
  356. parameters:
  357. sg_existing_env_path:
  358. type: string
  359. default: "/env/persistent_env"
  360. sg_new_env_name:
  361. type: string
  362. default: "${CIRCLE_BUILD_NUM}"
  363. sg_new_env_python_version:
  364. type: string
  365. default: "python3.8"
  366. steps:
  367. - checkout
  368. - run:
  369. name: install requirements and run recipe tests
  370. command: |
  371. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  372. source << parameters.sg_new_env_name >>/bin/activate
  373. python3.8 -m pip install --upgrade setuptools pip wheel
  374. python3.8 -m pip install -r requirements.txt
  375. python3.8 -m pip install .
  376. python3.8 -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
  377. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cifar10_resnet experiment_name=shortened_cifar10_resnet_accuracy_test training_hyperparams.max_epochs=100 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  378. 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
  379. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox experiment_name=shortened_coco2017_yolox_n_map_test architecture=yolox_n training_hyperparams.loss=yolox_fast_loss training_hyperparams.max_epochs=10 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  380. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_regseg48 experiment_name=shortened_cityscapes_regseg48_iou_test training_hyperparams.max_epochs=10 training_hyperparams.average_best_models=False multi_gpu=DDP num_gpus=4
  381. coverage run --source=super_gradients -m unittest tests/deci_core_recipe_test_suite_runner.py
  382. - run:
  383. name: Remove new environment when failed
  384. command: "rm -r << parameters.sg_new_env_name >>"
  385. when: on_fail
  386. recipe_sanity_tests_classification:
  387. machine: true
  388. resource_class: deci-ai/sg-gpu-on-premise
  389. parameters:
  390. sg_existing_env_path:
  391. type: string
  392. default: "/env/persistent_env"
  393. sg_new_env_name:
  394. type: string
  395. default: "${CIRCLE_BUILD_NUM}"
  396. sg_new_env_python_version:
  397. type: string
  398. default: "python3.8"
  399. steps:
  400. - checkout
  401. - run:
  402. name: install requirements and run classification sanity tests
  403. command: |
  404. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  405. source << parameters.sg_new_env_name >>/bin/activate
  406. python3.8 -m pip install --upgrade setuptools pip wheel
  407. python3.8 -m pip install -r requirements.txt
  408. python3.8 -m pip install .
  409. python3.8 -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
  410. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_efficientnet dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  411. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_mobilenetv2 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  412. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_mobilenetv3_large dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  413. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_mobilenetv3_small dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  414. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY200 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  415. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY400 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  416. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY600 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  417. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_regnetY architecture=regnetY800 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  418. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_repvgg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  419. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_resnet50 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  420. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=imagenet_vit_base dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  421. python3.8 src/super_gradients/examples/train_from_kd_recipe_example/train_from_kd_recipe.py --config-name=imagenet_resnet50_kd dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  422. - run:
  423. name: Remove new environment when failed
  424. command: "rm -r << parameters.sg_new_env_name >>"
  425. when: on_fail
  426. recipe_sanity_tests_segmentation:
  427. machine: true
  428. resource_class: deci-ai/sg-gpu-on-premise
  429. parameters:
  430. sg_existing_env_path:
  431. type: string
  432. default: "/env/persistent_env"
  433. sg_new_env_name:
  434. type: string
  435. default: "${CIRCLE_BUILD_NUM}"
  436. sg_new_env_python_version:
  437. type: string
  438. default: "python3.8"
  439. steps:
  440. - checkout
  441. - run:
  442. name: install requirements and run segmentation sanity tests
  443. command: |
  444. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  445. source << parameters.sg_new_env_name >>/bin/activate
  446. python3.8 -m pip install --upgrade setuptools pip wheel
  447. python3.8 -m pip install -r requirements.txt
  448. python3.8 -m pip install .
  449. python3.8 -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
  450. 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
  451. wget -O $(pwd)/checkpoints/ddrnet23_bb_imagenet.pth https://deci-pretrained-models.s3.amazonaws.com/ddrnet/imagenet_pt_backbones/ddrnet23_bb_imagenet.pth
  452. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_ddrnet checkpoint_params.checkpoint_path=$(pwd)/checkpoints/ddrnet23_bb_imagenet.pth dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  453. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_ddrnet architecture=ddrnet_23_slim checkpoint_params.checkpoint_path=$(pwd)/checkpoints/ddrnet23_slim_bb_imagenet.pth dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  454. wget -O $(pwd)/checkpoints/stdc1_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc1_imagenet_pretrained.pth
  455. wget -O $(pwd)/checkpoints/stdc2_imagenet_pretrained.pth https://deci-pretrained-models.s3.amazonaws.com/stdc_backbones/stdc2_imagenet_pretrained.pth
  456. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth architecture=pp_lite_t_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  457. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_pplite_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=pp_lite_b_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  458. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_pplite_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth architecture=pp_lite_t_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  459. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_pplite_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=pp_lite_b_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  460. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_stdc_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  461. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_stdc_seg50 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=stdc2_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  462. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_stdc_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc1_imagenet_pretrained.pth dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  463. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=cityscapes_stdc_seg75 checkpoint_params.checkpoint_path=$(pwd)/checkpoints/stdc2_imagenet_pretrained.pth architecture=stdc2_seg dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  464. - run:
  465. name: Remove new environment when failed
  466. command: "rm -r << parameters.sg_new_env_name >>"
  467. when: on_fail
  468. recipe_sanity_tests_detection:
  469. machine: true
  470. resource_class: deci-ai/sg-gpu-on-premise
  471. parameters:
  472. sg_existing_env_path:
  473. type: string
  474. default: "/env/persistent_env"
  475. sg_new_env_name:
  476. type: string
  477. default: "${CIRCLE_BUILD_NUM}"
  478. sg_new_env_python_version:
  479. type: string
  480. default: "python3.8"
  481. steps:
  482. - checkout
  483. - run:
  484. name: install requirements and run detection sanity tests
  485. command: |
  486. << parameters.sg_new_env_python_version >> -m venv << parameters.sg_new_env_name >>
  487. source << parameters.sg_new_env_name >>/bin/activate
  488. python3.8 -m pip install --upgrade setuptools pip wheel
  489. python3.8 -m pip install -r requirements.txt
  490. python3.8 -m pip install .
  491. python3.8 -m pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116
  492. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_ssd_lite_mobilenet_v2 dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  493. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_n dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  494. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_t dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  495. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_s dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  496. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_m dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  497. python3.8 src/super_gradients/examples/train_from_recipe_example/train_from_recipe.py --config-name=coco2017_yolox architecture=yolox_l dataset_params.train_dataloader_params.batch_size=3 dataset_params.val_dataloader_params.batch_size=3 training_hyperparams.max_epochs=1 training_hyperparams.average_best_models=False num_gpus=4
  498. - run:
  499. name: Remove new environment when failed
  500. command: "rm -r << parameters.sg_new_env_name >>"
  501. when: on_fail
  502. workflows:
  503. release:
  504. jobs:
  505. - deci-common/persist_version_info:
  506. version_override: $CIRCLE_TAG
  507. <<: *release_tag_filter
  508. - deci-common/codeartifact_login:
  509. name: "login_to_codeartifact_release"
  510. repo_name: "deci-packages"
  511. <<: *release_tag_filter
  512. - build:
  513. name: "build3.7"
  514. py_version: "3.7"
  515. package_name: "super-gradients"
  516. requires:
  517. - deci-common/persist_version_info
  518. - login_to_codeartifact_release
  519. <<: *release_tag_filter
  520. - recipe_accuracy_tests:
  521. <<: *release_tag_filter
  522. - recipe_sanity_tests_classification:
  523. <<: *release_tag_filter
  524. - recipe_sanity_tests_segmentation:
  525. <<: *release_tag_filter
  526. - recipe_sanity_tests_detection:
  527. <<: *release_tag_filter
  528. - release_version:
  529. py_version: "3.7"
  530. requires:
  531. - "build3.7"
  532. - recipe_accuracy_tests
  533. - recipe_sanity_tests_classification
  534. - recipe_sanity_tests_segmentation
  535. - recipe_sanity_tests_detection
  536. <<: *release_tag_filter
  537. - deci-common/pip_upload_package_from_codeartifact_to_global_pypi:
  538. package_name: "super-gradients"
  539. name: "upload_super_gradients_to_pypi"
  540. version: $CIRCLE_TAG
  541. requires:
  542. - "release_version"
  543. context:
  544. - pypi-supergradients
  545. <<: *release_tag_filter
  546. build_and_deploy:
  547. jobs:
  548. - deci-common/persist_version_info:
  549. use_rc: true
  550. use_beta: false
  551. version_override: ""
  552. - deci-common/codeartifact_login:
  553. repo_name: "deci-packages"
  554. - build:
  555. name: "build3.7"
  556. py_version: "3.7"
  557. package_name: "super-gradients"
  558. requires:
  559. - deci-common/persist_version_info
  560. - deci-common/codeartifact_login
  561. - release_candidate: # happens on merge
  562. py_version: "3.7"
  563. requires:
  564. - "build3.7"
  565. <<: *release_candidate_filter
  566. SG_docker:
  567. jobs:
  568. - change_rc_to_b: # works on release candidate creation
  569. <<: *release_candidate_tag_filter
  570. - build_and_publish_sg_container: # works on release candidate creation
  571. requires:
  572. - "change_rc_to_b"
  573. <<: *release_candidate_tag_filter
  574. - testing_supergradients_docker_image: # works on release candidate creation
  575. image_repo: '307629990626.dkr.ecr.us-east-1.amazonaws.com/deci/super-gradients'
  576. requires:
  577. - "build_and_publish_sg_container"
  578. - "change_rc_to_b"
  579. <<: *release_candidate_tag_filter
  580. - add_rc_tag_to_beta: # works on release candidate creation for ECR Repo
  581. requires:
  582. - "testing_supergradients_docker_image"
  583. - "change_rc_to_b"
  584. <<: *release_candidate_tag_filter
  585. - find_rc_tag_per_sha: # works on release
  586. <<: *release_tag_filter
  587. - add_release_tag_to_rc: # works on release
  588. requires:
  589. - "find_rc_tag_per_sha"
  590. <<: *release_tag_filter
  591. - slack/on-hold:
  592. context: slack
  593. channel: "sg-integration-tests"
  594. requires:
  595. - "add_release_tag_to_rc"
  596. <<: *release_tag_filter
  597. - hold-sg-public-release: # works on release
  598. type: approval
  599. requires:
  600. - "slack/on-hold"
  601. <<: *release_tag_filter
  602. - docker/publish: # works on release
  603. image: deciai/super-gradients
  604. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  605. update-description: true
  606. use-buildkit: true
  607. use-remote-docker: true
  608. use-docker-credentials-store: true
  609. tag: latest,${CIRCLE_TAG}
  610. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG} --compress' #building from scratch as it faster and cheaper than download and retag
  611. requires:
  612. - "hold-sg-public-release"
  613. <<: *release_tag_filter
  614. - docker/publish: # works on release
  615. image: deciai/super-gradients
  616. remote-docker-version: << pipeline.parameters.remote_docker_version >>
  617. update-description: true
  618. use-buildkit: true
  619. use-remote-docker: true
  620. use-docker-credentials-store: true
  621. tag: ${CIRCLE_TAG}-runtime
  622. extra_build_args: '--build-arg VERSION=${CIRCLE_TAG} --build-arg DOCKER_IMAGE_TAG=11.3.1-runtime-ubuntu20.04 --compress'
  623. requires:
  624. - "hold-sg-public-release"
  625. <<: *release_tag_filter
Discard
Tip!

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