{"id":15642871,"url":"https://github.com/guanhuawang/sensai","last_synced_at":"2025-04-15T00:06:31.975Z","repository":{"id":71770869,"uuid":"173848023","full_name":"GuanhuaWang/sensAI","owner":"GuanhuaWang","description":"sensAI: ConvNets Decomposition via Class Parallelism for Fast Inference on Live Data","archived":false,"fork":false,"pushed_at":"2024-07-25T11:01:35.000Z","size":1327,"stargazers_count":64,"open_issues_count":4,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-15T00:06:12.597Z","etag":null,"topics":["cifar-10","cifar-100","cifar10","cifar100","cnn-classification","deep-learning","deep-neural-networks","distributed-deep-learning","distributed-machine-learning","distributed-systems","imagenet","imagenet1k","machine-learning","mlsys","mobilenet-v2","resnet","shufflenet-v2","sysml","vgg"],"latest_commit_sha":null,"homepage":"https://rise.cs.berkeley.edu/projects/sensai/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuanhuaWang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-03-05T01:11:37.000Z","updated_at":"2024-06-14T16:27:53.000Z","dependencies_parsed_at":"2024-10-22T20:15:58.470Z","dependency_job_id":null,"html_url":"https://github.com/GuanhuaWang/sensAI","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/GuanhuaWang%2FsensAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuanhuaWang%2FsensAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuanhuaWang%2FsensAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuanhuaWang%2FsensAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuanhuaWang","download_url":"https://codeload.github.com/GuanhuaWang/sensAI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981261,"owners_count":21193147,"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":["cifar-10","cifar-100","cifar10","cifar100","cnn-classification","deep-learning","deep-neural-networks","distributed-deep-learning","distributed-machine-learning","distributed-systems","imagenet","imagenet1k","machine-learning","mlsys","mobilenet-v2","resnet","shufflenet-v2","sysml","vgg"],"created_at":"2024-10-03T11:57:56.174Z","updated_at":"2025-04-15T00:06:31.959Z","avatar_url":"https://github.com/GuanhuaWang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"sensAI-logo.png\"  width=\"250\" height=\"250\"\u003e\n\u003c/p\u003e\n\n# sensAI: ConvNets Decomposition via Class Parallelism for Fast Inference on Live Data\n\n## Environment\n\nLinux, python 3.6+\n\n## Setup\n\n```bash\npip install -r requirements.txt\n```\n\n## Instruction\n\nSupported CNN architectures and datasets:\n\n| Dataset        | Architecture(`ARCH`) |\n| -------------  |:-------------:|\n| CIFAR-10       | vgg19_bn, resnet110, resnet164, mobilenetv2, shufflenetv2|\n| CIFAR-100      | vgg19_bn, resnet110, resnet164|\n| ImageNet-1K    | vgg19_bn, resnet50|\n\n\n### 1. Generate class groups\n   \n   For CIFAR-10/CIFAR-100:\n   ```bash\n   python3 group_selection.py \\\n           --arch $ARCH \\\n           --resume $pretrained_model \\\n           --dataset $DATASET \\\n           --ngroups $number_of_groups \\\n           --gpu_num $number_of_gpu \n   ```\n   For ImageNet-1K:\n   ```bash\n   python3 group_selection.py \\\n           --arch $ARCH \\\n           --dataset imagenet \\\n           --ngroups $number_of_groups \\\n           --gpu_num $number_of_gpu \\\n           --data /{path_to_imagenet_dataset}/\n   ```\n   \n   Pruning candidate now stored in `./prune_candidate_logs/`\n   \n### 2. Prune models\n    \n   For CIFAR-10/CIFAR-100:\n   ```bash\n   python3 prune_and_get_model.py \\\n           -a $ARCH \\\n           --dataset $DATASET \\\n           --resume $pretrained_model \\\n           -c ./prune_candidate_logs/ \\\n           -s ./{TO_SAVE_PRUNED_MODEL_DIR}/\n   ```\n   For ImageNet-1K:\n   ```bash\n   python3 prune_and_get_model.py \\\n           -a $ARCH \\\n           --dataset imagenet \\\n           -c ./prune_candidate_logs/ \\\n           -s ./{TO_SAVE_PRUNED_MODEL_DIR}/ \\\n           --pretrained\n   ```\n   \n   Pruned models are now saved in `./{TO_SAVE_PRUNED_MODEL_DIR}/$ARCH/`\n   \n### 3. Retrain pruned models\n  \n   For CIFAR-10/CIFAR-100:\n   ```bash\n   python3 retrain_grouped_model.py \\\n           -a $ARCH \\\n           --dataset $DATASET \\\n           --resume ./{TO_SAVE_PRUNED_MODEL_DIR}/ \\\n           --train_batch $batch_size \\\n           --epochs $number_of_epochs \\\n           --num_gpus $number_of_gpus\n   ```\n   For ImageNet-1K:\n   ```bash\n   python3 retrain_grouped_model.py \\\n           -a $ARCH \\\n           --dataset imagenet \\\n           --resume ./{TO_SAVE_PRUNED_MODEL_DIR}/ \\\n           --epochs $number_of_epochs \\\n           --num_gpus $number_of_gpus \\\n           --train_batch $batch_size \\\n           --data /{path_to_imagenet_dataset}/\n   ```\n   \n   Retrained models now saved in `./{TO_SAVE_PRUNED_MODEL_DIR}_retrained/$ARCH/`\n   \n### 4. Evaluate\n\n   For CIFAR-10/CIFAR-100:\n   ```bash\n   python3 evaluate.py \\\n           -a $ARCH \\\n           --dataset=$DATASET \\\n           --retrained_dir ./{TO_SAVE_PRUNED_MODEL_DIR}_retrained/ \\\n           --test-batch $batch_size\n   ```\n   For ImageNet-1K:\n   ```bash\n   python3 evaluate.py \\\n           -d imagenet \\\n           -a $ARCH \\\n           --retrained_dir ./{TO_SAVE_PRUNED_MODEL_DIR}_retrained/ \\\n           --data /{path_to_imagenet_dataset}/\n   ```\n\n## Contributors\n\nThanks for all the main contributors to this repository:\n\n* [Brandon Hsieh](https://github.com/hsiehbrandon) \n\n* [Zhuang Liu](https://github.com/liuzhuang13)\n\n* [Kenan Jiang](https://github.com/Kenan-Jiang) \n\n* [Kehan Wang](https://github.com/Jason-Khan)\n\n* [Siyuan Zhuang](https://github.com/suquark)\n\nAnd many others [Zihao Fan](https://github.com/zihao-fan), [Hank O'Brien](https://github.com/hjobrien) , [Yaoqing Yang](https://github.com/nsfzyzz), [Adarsh Karnati](https://github.com/akarnati11), [Jichan Chung](https://github.com/jichan3751), [Yingxin Kang](https://github.com/Miiira), [\nBalaji Veeramani](https://github.com/bveeramani), [Sahil Rao](https://github.com/sahilrao21).\n\n\n\n\n## Citation\n\n```text\n@inproceedings{wang2021sensAI,\n author = {Guanhua Wang and Zhuang Liu and Brandon Hsieh and Siyuan Zhuang and Joseph Gonzalez and Trevor Darrell and Ion Stoica},\n title = {{sensAI: ConvNets Decomposition via Class Parallelism for Fast Inference on Live Data}},\n booktitle = {Proceedings of Fourth Conference on Machine Learning and Systems (MLSys'21)},\n year = {2021}\n} \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanhuawang%2Fsensai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguanhuawang%2Fsensai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanhuawang%2Fsensai/lists"}