队列服务,用于快速开发可有效使用所有GPU的澳客彩票下载手机版下载

澳客彩票下载手机版下载✅【15bet.net】✅为中国访问最快的线路平台登录注册,欢迎大家收藏访问,澳客彩票下载手机版下载将为您提供国内顶尖的手机客户端app下载,带给你无限的激情!我们的宗旨在于让大家享受最贴心的服务!

Fastgpu provides a single command, Fastgpu_poll, which polls a directory to check for scripts to run, and then runs them on the first available GPU. If no GPUs are available, it waits until one is. If more than one GPU is available, multiple scripts are run in parallel, one per GPU.

还提供了API以编程方式进行轮询,该API可扩展用于将其他资源分配给GPU以外的进程。有关API的详细信息,请参阅有关的文档 core.

安装

pip install fastgpu

如何使用

--help 提供命令帮助:

$ fastgpu_poll --help
usage: fastgpu_poll [-h] [--path PATH] [--exit EXIT]

Poll `path` for scripts using `ResourcePoolGPU.poll_scripts`

optional arguments:
  -h, --help   show this help message and exit
  --path PATH  Path containing `to_run` directory
  --exit EXIT  Exit when `to_run` is empty

path defaults to the current directory. The path should contain a subdirectory to_run containing executable scripts you wish to run. It should not contain any other files, although it can contain subdirectories (which are ignored).

Fastgpu_poll will run each script in to_run in sorted order. Each script will be assigned to one GPU. The CUDA_VISIBLE_DEVICES environment variable will be set to the ID of this GPU in the script's subprocess. In addition, the FASTGPU_ID environment variable will also be set to this ID.

Once a script is selected to be run, it is moved into a directory called running. Once it's finished, it's moved into complete or fail as appropriate. stdout and stderr are captured to files with the same name as the script, plus stdout or stderr appended.

If exit is 1 (which is the default), then once all scripts are run, Fastgpu_poll will exit. If it is 0 then Fastgpu_poll will continue running until it is killed; it will keep polling for any new scripts that are added to to_run.

要限制可用于fastgpu的GPU,请设置 CUDA_VISIBLE_DEVICES 轮询前,例如:

CUDA_VISIBLE_DEVICES=2,3 fastgpu_poll script_dir