{"id":27874604,"url":"https://github.com/jinzcdev/occupied-gpus","last_synced_at":"2025-05-05T01:36:41.088Z","repository":{"id":57447696,"uuid":"430066416","full_name":"jinzcdev/occupied-gpus","owner":"jinzcdev","description":"The program used to occupy GPUs.","archived":false,"fork":false,"pushed_at":"2023-03-24T10:43:45.000Z","size":15,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-13T18:18:42.502Z","etag":null,"topics":["deep-learning","gpu"],"latest_commit_sha":null,"homepage":"","language":"Python","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/jinzcdev.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}},"created_at":"2021-11-20T09:59:37.000Z","updated_at":"2024-09-21T04:02:41.000Z","dependencies_parsed_at":"2023-02-15T11:10:48.444Z","dependency_job_id":null,"html_url":"https://github.com/jinzcdev/occupied-gpus","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/jinzcdev%2Foccupied-gpus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinzcdev%2Foccupied-gpus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinzcdev%2Foccupied-gpus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinzcdev%2Foccupied-gpus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinzcdev","download_url":"https://codeload.github.com/jinzcdev/occupied-gpus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252424675,"owners_count":21745791,"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":["deep-learning","gpu"],"created_at":"2025-05-05T01:36:40.500Z","updated_at":"2025-05-05T01:36:41.074Z","avatar_url":"https://github.com/jinzcdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Occupied GPUs\n\nThe program used to occupy GPUs.\n\n## Preparation\n\n```shell\npip install -r requirements.txt\n```\n\n\u003e Note: Please make sure that `cuda` is avaliable. \n\n## Usage\n\n### Python Module\n\nThis repository has been packaged and published in [PyPI](https://pypi.org). Please run the following command to install it.\n\n```shell\npip install occupiedgpus\n```\n\nAnd happy to occupy GPUs:\n\n```python\npython -m occupiedgpus.core --gpu-ids 0,1,2,3 --epochs 120 --options 0\n```\n\nwhere `--options` can be assigned 0 or 1 ( `0` means to occupy the GPU when it is not used, and `1` means to occupy the remaining GPU memory at any time).\n\n### Source Code\n\nClone this repository to your local and activate your Python environment.\n\n```shell\ngit clone https://github.com/jinzcdev/occupied-gpus.git\n```\n\n**single processing**\n\nTo occupy the corresponding GPUs in single processing, run:\n\n```shell\nsh train.sh 0,1,2,3 [option]\n```\n\nor\n\n```shell\nchmod u+x ./train.sh\n./train.sh 0,1,2,3 [option]\n```\n\nwhere `0,1,2,3` stands for the GPU0-3 to be occpied. `[option]` can be assigned 0 or 1 as mentioned above, and the default is 0.\n\n**multi-processing**\n\nTo occupy GPUs faster with multi-processing, run in **bash (NOT sh):**\n\n```shell\nbash ./multi_train.sh 0,1,2,3 [option] [port]\n```\n\nwhere `[option]` can be assigned 0 or 1 as mentioned above, and the default is 0. The default `[port]` is 54886, and when a port conflict occurs, you may change the `[port]`. \n\n\u003e Note: If your pytorch version is less than 1.9.0, please replace `torchrun` with `python -m torch.distributed.launch --use_env` in [multi_train.sh](multi_train.sh).\n\n## Run in the background\n\nif you want to run the code in the background, run:\n\n```shell\nnohup sh train.sh ${GPU_IDS} \u0026\u003e\u003e /dev/null \u0026\nor\nnohup sh multi_train.sh ${GPU_IDS} \u0026\u003e\u003e /dev/null \u0026\nor\nnohup python -m occupiedgpus.core --gpu-ids ${GPU_IDS} --epochs 120 --options 0 \u0026\u003e\u003e /dev/null \u0026\n```\n\n\u003e replace ${GPU_IDS} with `0,1,...`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinzcdev%2Foccupied-gpus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinzcdev%2Foccupied-gpus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinzcdev%2Foccupied-gpus/lists"}