{ "info": { "author": "Bin Wang", "author_email": "wwwbbb8510@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# cudam\nCuda Mangement - multi-process, scheduled jobs, distributed processing\n\n## command to check all cuda server status\n\n```bash\ndate >> cuda_status.txt && echo 'cuda1' >> cuda_status.txt && ssh cuda1 'nvidia-smi' >> cuda_status.txt && echo 'cuda2' >> cuda_status.txt && ssh cuda2 'nvidia-smi' >> cuda_status.txt && echo 'cuda3' >> cuda_status.txt && ssh cuda3 'nvidia-smi' >> cuda_status.txt && echo 'cuda4' >> cuda_status.txt && ssh cuda4 'nvidia-smi' >> cuda_status.txt && echo 'cuda5' >> cuda_status.txt && ssh cuda5 'nvidia-smi' >> cuda_status.txt && echo 'cuda6' >> cuda_status.txt && ssh cuda6 'nvidia-smi' >> cuda_status.txt && echo 'cuda11' >> cuda_status.txt && ssh cuda11 'nvidia-smi' >> cuda_status.txt\n```\n\n## server-client mode to utilize multi-GPUs across Multi-Machines\n\n### server side - develop the code that runs on a single GPU\n\n```python\n# here is a dumb function to evaluate densenet\n# it should be replaced by the actual code of evaluation\ndef evaluate_densenet(model):\n acc = 0.99\n return acc\n```\n\n### client size - develop the code to send the models to server for evaluation\n\n* Add available GPU servers in the server list configuration file\n\n```text\n# configuration of server list\ncuda4,8000\ncuda4,8001\ncuda5,8000\ncuda5,8001\ncuda5,8002\n```\n\n* The client code that concurrently evaluates models\n\n```python\nfrom cudam.cudam_socket.client import GPUClientPool\nDEFAULT_RUN_CODE_WORK_DIRECTORY = \"/home/www/server\" # the folder where the server side code resides \nDEFAULT_RUN_CODE_PATH = \"server_file\" # the file name of the server side code\nSERVER_LIST_CONFIG = 'config/server_list.txt' # the configuration file of the server list\ndef pool_evaluate_densenet(model_list):\n # generat the arguments which will passed to client pool\n arr_args = []\n for m in model_list: \n singe_args = {'model': m}\n arr_args.append({\n 'path': DEFAULT_RUN_CODE_PATH,\n 'entry': \"evaluate_densenet\",\n 'work_directory': DEFAULT_RUN_CODE_WORK_DIRECTORY,\n 'args': singe_args,\n 'use_cuda': True # whether to use GPU or not\n })\n # init client pool\n server_list = GPUClientPool.load_server_list_from_file(SERVER_LIST_CONFIG)\n pool = GPUClientPool(server_list)\n # perform evaluation\n eval_result = pool.run_code_batch(arr_args)\n return eval_result\n# main entrance\nif __name__ == '__main__':\n model_list =[] # dumb model list which needs to be replaced by real models\n pool_evaluate_densenet(model_list)\n```\n\n### start the server \n\n* After installation of this package, `cudam_server.py` should be automatically copied to the bin path; if not, please manually copy this file to the root folder of the project. The server can be started by running the following command: \n\n```bash\nnohup python cudam_server.py -s 1 -i cuda1 -p 8000 -g 0 >& log/nohup_cuda_1_8000_0.log &\n```\n\n### run the client side python code to evaluate a batch of models\n\n## task manager\n\n### task template\n\n```bash\n#!/usr/bin/env bash\n\nwhile getopts g: option;do\n case \"${option}\" in\n g) GPU_ID=${OPTARG};;\n esac\ndone\n\nprint_help(){\n printf \"Parameter g(GPU ID) is mandatory\\n\"\n printf \"g values - GPU ID\"\n exit 1\n}\n\nif [ -z \"${GPU_ID}\" ];then\n print_help\nfi\n\necho \"start task on GPU: $GPU_ID\"\n\n# the root directory of your python script\ncd ~/code/psocnn/\n# the main python script accepting the gpu ID in -g argument\npython3 main.py -g ${GPU_ID}\n```\n\n### task folder structure\n\n![task folder structure](https://github.com/wwwbbb8510/cudam/blob/master/sh_task_structure.PNG \"Task folder structure\")\n\n### task manager \n\n```bash\n# start task manager\nnohup cudam_task_manager.py -n 2 -s 2 -i 60 -f 300 &\n# snap gpu\ncudam_snap_gpu.py -s 2 -l 60 -g 1\n```\n\n### install cumdam for a specific user and can not add the local path into executable PATH\n\n* Switch to the root folder of your project\n\n* Install cudam package\n```bash\npip install --user cudam\n``` \n\n* Create a soft link of the executable file\n```bash\nln -s /home/{YOURUSER}/.local/bin/cudam_task_manager.py cudam_task_manager.py\nln -s /home/{YOURUSER}/.local/bin/cudam_snap_gpu.py cudam_snap_gpu.py\n```\n\n* Run the task manager\n```bash\n# run interactively\npython cudam_task_manager.py -n 2 -s 2 -i 60 -f 300\n# run in background\nnohup python cudam_task_manager.py -n 2 -s 2 -i 60 -f 300 &\n```\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wwwbbb8510/cudam.git", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "cudam", "package_url": "https://pypi.org/project/cudam/", "platform": "", "project_url": "https://pypi.org/project/cudam/", "project_urls": { "Homepage": "https://github.com/wwwbbb8510/cudam.git" }, "release_url": "https://pypi.org/project/cudam/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Cuda Mangement - multi-process, scheduled jobs, distributed processing", "version": "0.0.6" }, "last_serial": 4812915, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "2dc4d8ffb2794287c4a445f1827e75da", "sha256": "d2e0a0060d8a9e2ede6adab64250e3aa43285deda2855cb3a28f4c4e72434a96" }, "downloads": -1, "filename": "cudam-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "2dc4d8ffb2794287c4a445f1827e75da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16440, "upload_time": "2018-08-13T02:51:28", "url": "https://files.pythonhosted.org/packages/a1/55/cf75c2386ce5b2026e50a0ea260bffd066c83d38a70c781b775a1d5b5856/cudam-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a51dfab5159291c5becbe40a9bfde846", "sha256": "85b9d65b5418816c1c82d688650ec0fa11ac46322b17a8357a9929b67bf352a5" }, "downloads": -1, "filename": "cudam-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a51dfab5159291c5becbe40a9bfde846", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7334, "upload_time": "2018-08-13T02:51:29", "url": "https://files.pythonhosted.org/packages/b2/62/dbb10014590217bf327bf9e0a26e50e5e46682d60428f1a0f2ed0fe62b29/cudam-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "e02344dccb3a4f85c19f9f3c08e950d3", "sha256": "d50680be5e3d3926e6339db707fabc1a6d5397e48f2256403b0ce5002d0245c8" }, "downloads": -1, "filename": "cudam-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e02344dccb3a4f85c19f9f3c08e950d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16697, "upload_time": "2018-08-13T03:44:36", "url": "https://files.pythonhosted.org/packages/ce/ea/cc7eb569908683330d5d636b4bc7010c7a9281b8aa235c3e758f15d403cd/cudam-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a47f88d1d8c98a4c51eb32c5ba20fcc8", "sha256": "d7f1ec3f74b98860b7c34e4eb76a5e4270a6cb33e029ef5da7f15fe7d042a0d6" }, "downloads": -1, "filename": "cudam-0.0.4.tar.gz", "has_sig": false, "md5_digest": "a47f88d1d8c98a4c51eb32c5ba20fcc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7543, "upload_time": "2018-08-13T03:44:37", "url": "https://files.pythonhosted.org/packages/bb/73/3f6af1e4062fcc4e716609c964b96bc03037380179d94107ac59eb385434/cudam-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "d2260302eb674e427853dd583050130d", "sha256": "4e6f9b871e64bdcb1b9f1f44f507a9d27fd49be894a4d1fdbdab3dc639c0d94f" }, "downloads": -1, "filename": "cudam-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "d2260302eb674e427853dd583050130d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53774, "upload_time": "2019-02-12T21:23:21", "url": "https://files.pythonhosted.org/packages/ac/56/f9eb6e106b5edc55707fcd095273199f9725eab7ae62e0c722fa87becb6c/cudam-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67fa8f181ff3162c934d9d3cd68bab15", "sha256": "c6ae788a566ed49456640dbef6a2545660d47b125bd6da1cce57e8ce1d5297a1" }, "downloads": -1, "filename": "cudam-0.0.5.tar.gz", "has_sig": false, "md5_digest": "67fa8f181ff3162c934d9d3cd68bab15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27161, "upload_time": "2019-02-12T21:23:23", "url": "https://files.pythonhosted.org/packages/f6/2b/93b7e5f91f8bbfca8d1cde224240f75da3ec3c85b5aa658cb0187c76e204/cudam-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "cfa6915ec31e997f874b4e7e6e5ba1dd", "sha256": "1358914da93359e1c01727855d18ad68e438713a8f7ffd40ef64d16149949961" }, "downloads": -1, "filename": "cudam-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "cfa6915ec31e997f874b4e7e6e5ba1dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53768, "upload_time": "2019-02-12T21:29:33", "url": "https://files.pythonhosted.org/packages/78/34/e13d6e69ef1a1fab8f5c4344e01cde055c09e5ee8af511fbbc240d8d8711/cudam-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a7ee4388b7d9b4734bf54db9a1ceaf7", "sha256": "e87b137d1cf70e817a9781f1ca194865bfe6e37bee4323e6d93f883d7bbfda07" }, "downloads": -1, "filename": "cudam-0.0.6.tar.gz", "has_sig": false, "md5_digest": "2a7ee4388b7d9b4734bf54db9a1ceaf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27156, "upload_time": "2019-02-12T21:29:35", "url": "https://files.pythonhosted.org/packages/ce/cb/e3c028d59eeab9853ba73fb12c35b10e114917b5bdb57b1c6209546b39d2/cudam-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cfa6915ec31e997f874b4e7e6e5ba1dd", "sha256": "1358914da93359e1c01727855d18ad68e438713a8f7ffd40ef64d16149949961" }, "downloads": -1, "filename": "cudam-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "cfa6915ec31e997f874b4e7e6e5ba1dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53768, "upload_time": "2019-02-12T21:29:33", "url": "https://files.pythonhosted.org/packages/78/34/e13d6e69ef1a1fab8f5c4344e01cde055c09e5ee8af511fbbc240d8d8711/cudam-0.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a7ee4388b7d9b4734bf54db9a1ceaf7", "sha256": "e87b137d1cf70e817a9781f1ca194865bfe6e37bee4323e6d93f883d7bbfda07" }, "downloads": -1, "filename": "cudam-0.0.6.tar.gz", "has_sig": false, "md5_digest": "2a7ee4388b7d9b4734bf54db9a1ceaf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27156, "upload_time": "2019-02-12T21:29:35", "url": "https://files.pythonhosted.org/packages/ce/cb/e3c028d59eeab9853ba73fb12c35b10e114917b5bdb57b1c6209546b39d2/cudam-0.0.6.tar.gz" } ] }