{"id":21105152,"url":"https://github.com/tchaton/sagemaker-pytorch-boilerplate","last_synced_at":"2025-09-11T20:33:02.468Z","repository":{"id":134496110,"uuid":"287823926","full_name":"tchaton/sagemaker-pytorch-boilerplate","owner":"tchaton","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-20T09:07:42.000Z","size":500,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T07:51:29.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tchaton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-15T20:58:45.000Z","updated_at":"2024-06-10T09:09:31.000Z","dependencies_parsed_at":"2023-06-16T12:15:43.991Z","dependency_job_id":null,"html_url":"https://github.com/tchaton/sagemaker-pytorch-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchaton%2Fsagemaker-pytorch-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchaton%2Fsagemaker-pytorch-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchaton%2Fsagemaker-pytorch-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tchaton%2Fsagemaker-pytorch-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tchaton","download_url":"https://codeload.github.com/tchaton/sagemaker-pytorch-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232665935,"owners_count":18557949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T00:03:53.353Z","updated_at":"2025-01-06T02:46:42.500Z","avatar_url":"https://github.com/tchaton.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sagemaker-pytorch-boilerplate\n\nProduction ML, as a field, has matured. It’s increasingly common for companies to have at least one model in production. As more teams deploy models, the conversation around tooling has shifted from “What gets the job done?” to “What does it take to deploy a model at production scale?”\n\nThis project is a boilerplate codebase to `train / serve / publish` Pytorch Model using AWS Sagemaker.\n\nWe aim at simplifying MLOps worflow by providing a template for production ready development, allowing ML engineer to focus uniquely on their models and datasets. \n\nWe rely on [Hydra](https://hydra.cc) for elegantly configuring our application and [Pytorch Lightning](https://pytorch-lightning.readthedocs.io/en/latest/), a lightweight PyTorch wrapper for ML researchers to scale their experiments with less boilerplate.\n\n# How to use this project\n\nThis project implements a 1-layer MLP on iris dataset as a baby demo.\n\n```bash\nsh build_local_env.sh 3.7.8 # It will create a local env to ease local dev\n```\n\n```bash\nsh build_and_push.sh {IMAGE_NAME} {MODEL} {DATASET}\n# It will build the folder container and push the image to AWS Elastic Container Registry (ECR)\n```\n\n# Local development\n\n## Training\n\nUsed to make quick dev.\n\n```bash\nsource .venv/bin/activate\npython src/train model={MODEL} dataset={DATASET}\n```\n\nor within docker image\n\nUsed to make sure the docker image is correcly working\n\n```bash\nsh local_test/train_local.sh ${IMAGE_NAME} ${ARGS_1} ${ARGS_2} ${ARGS_3} ...\n```\n\n## Local Serving\n\nTerminal 1\n```bash \nIn:\nsh build_and_push.sh {IMAGE_NAME} {MODEL} {DATASET}.\ncd local_test\nsh serve_local.sh {IMAGE_NAME}\n```\n\n``` bash\nOut:\nStarting the inference server with 4 workers.\n[2020-08-19 11:41:31 +0000] [9] [INFO] Starting gunicorn 20.0.4\n[2020-08-19 11:41:31 +0000] [9] [INFO] Listening at: unix:/tmp/gunicorn.sock (9)\n[2020-08-19 11:41:31 +0000] [9] [INFO] Using worker: gevent\n[2020-08-19 11:41:31 +0000] [13] [INFO] Booting worker with pid: 13\n[2020-08-19 11:41:31 +0000] [14] [INFO] Booting worker with pid: 14\n[2020-08-19 11:41:31 +0000] [15] [INFO] Booting worker with pid: 15\n[2020-08-19 11:41:31 +0000] [16] [INFO] Booting worker with pid: 16\n```\n\nTerminal 2\n```bash \nIn:\ncd local_test\nsh predict.sh {SAMPLE_DATA} # Currently support only 'text/csv'\n```\n\n\nTrain on AWS:\nRun workflow.ipynb notebook\n\n```\njupyter lab\n```\n\n# CAREFUL: Work in progress\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchaton%2Fsagemaker-pytorch-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftchaton%2Fsagemaker-pytorch-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftchaton%2Fsagemaker-pytorch-boilerplate/lists"}