# 安装与设置 ## 支持的系统 + Ubuntu 20.04 ## 依赖 + [libaio](https://packages.ubuntu.com/search?keywords=libaio):Linux 异步 I/O 依赖 + [Anaconda3 (Python 3.8)](https://repo.anaconda.com/archive/) + GPU 驱动,CUDA 库:完全版,支持 `Driver Version 470.42.01` + `CUDA11.3` ## 获取 token 请在账号开通邮件中查收用户名、密码(token),用于[初始化 hfai](../cli/user.rst)。如需申请开通帐号请[联系管理员](https://mp.weixin.qq.com/s/1orFQWkCzxH1sGZa8twleQ)。 ## 安装 hfai 1. 执行如下命令
轻量版(只安装任务提交和管理所需的依赖,支持 Linux / Mac OS / WSL 系统下的 Python 3.8 环境) ``` pip3 install hfai --extra-index-url https://pypi.hfai.high-flyer.cn/simple --trusted-host pypi.hfai.high-flyer.cn ``` 完全版(安装所有组件所需的依赖,包括 [ffrecord](https://www.high-flyer.cn/blog/ffrecord/),[hfreduce](https://www.high-flyer.cn/blog/hf-reduce/),[优化算子](https://www.high-flyer.cn/blog/hfnn/),[并行 checkpoint](https://www.high-flyer.cn/blog/checkpoint/),PyTorch (CUDA) 等,仅支持 Ubuntu 20.04 的 Python 3.8 环境) ``` pip3 install hfai[full] --extra-index-url https://pypi.hfai.high-flyer.cn/simple --trusted-host pypi.hfai.high-flyer.cn ``` 2. 完成后执行 `hfai` 能输出命令列表,即安装成功,如下: ``` Usage: hfai COMMAND ... [OPTIONS] Options: -h, --help Show this message and exit. ... ``` **注意**:hfai 持续优化迭代中,请留意版本号,及时更新最新版 hfai,获得最好使用体验。 ## 安装 hfreduce hfreduce 是 hfai 的高级功能之一,提供多 GPU 之间高性能通信能力,更多介绍参考[技术博客](https://www.high-flyer.cn/blog/hf-reduce/)。 1. 安装依赖 ``` sudo apt install libnuma-dev sudo apt install libibverbs-dev ``` 2. 安装 hfreduce 包(完全版已包含) ``` pip3 install hfreduce --extra-index-url https://pypi.hfai.high-flyer.cn/simple --trusted-host pypi.hfai.high-flyer.cn ```