diff --git a/MACA.md b/MACA.md index 99cee4e..a989f73 100644 --- a/MACA.md +++ b/MACA.md @@ -250,109 +250,10 @@ - 如果不使用 PyTorch Extension 功能,可以不配置 cu-bridge 环境。关于 PyTorch Extension 功能,参见官网描述。 -## Pypi源配置 +## Pypi安装 -### 一次性安装 - - **使用以下命令一次性安装指定包** - ```bash - pip install -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host https://repos.metax-tech.com - ``` -### 永久配置 -- **如需永久配置 PyPI 源,使用以下命令** - ```bash - pip config set global.index-url https://repos.metax-tech.com/r/maca-pypi/simple - pip config set global.trusted-host https://repos.metax-tech.com - -### 列出可用版本 - -- **对于 pip 22.0 及之前版本,使用以下命令触发错误并列出包的所有可用版本** - ```bash - pip install == -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - -- **对于 pip 22.0 之后版本,使用以下命令列出某个包的所有可用版本** - ```bash - pip index versions -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - -## Conda源配置 - -### 一次性安装 - - **使用以下命令一次性安装指定包** - ```bash - conda install -c https://repos.metax-tech.com/r/maca-conda/ - ``` - -### 永久配置 -- **添加新channels** - ```bash - conda config --add channels https://repos.metax-tech.com/r/maca-conda/ - conda config --set show_channel_urls yes - ``` - -- **删除默认channels** - ```bash - conda config --remove channels defaults - 或者手动方式 - For Linux sed -i.bak '/- defaults/d' ~/.condarc - For Windows 在文件 %USERPROFILE%/.condarc 中删除 "- defaults" 这一行 - ``` - - -### 列出可用版本 -- - ```bash - conda search --info -c https://repos.metax-tech.com/r/maca-conda/ - ``` - -## 兼容性 - - 当前仓库仅支持 Python 3.8 和 Python 3.10 版本。 - - 当前仓库仅支持cpython编译器。 - - -## 安装指南 - - - **1.安装 mcPyTorch** - ```bash - 使用 pip 安装 - pip install torch== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - **2. 安装 mcFlashattn** - ```bash - 使用 pip 安装 - pip install flash_attn== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - **3.安装 mcTorchvision(可选)** - ```bash - 使用 pip 安装 - pip install torchvision== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - **4.安装mcTorchaudio(可选)** - ```bash - 使用 pip 安装 - pip install torchaudio== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - - **5.安装 mcApex(可选)** - ```bash - 使用 pip 安装 - pip install apex== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - - **6.安装 mcTriton(可选)** - ```bash - 使用 pip 安装 - pip install triton== -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com - ``` - - - **7.通过requirements.txt安装** - - maca-pypi源地址预设在requirement.txt 文件中,用户执行命令不需关注maca-pypi源地址 +### 通过requirements.txt安装 + - **maca-pypi源地址预设在requirement.txt 文件中,用户执行命令不需关注maca-pypi源地址** ```bash cat < ./requirements.txt -i https://repos.metax-tech.com/r/maca-pypi/simple @@ -372,7 +273,7 @@ pip install -r ./requirements.txt ``` - 在命令行中指定 maca-pypi 源地址 + - **在命令行中指定 maca-pypi 源地址** ```bash cat < ./requirements.txt apex @@ -392,35 +293,41 @@ ``` +### 单包安装 + - **使用以下命令安装指定包** + ```bash + pip install -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com + ``` + -## 验证安装 - - - **运行前设置环境变量** +### 列出可用版本 + +- **对于 pip 22.0 及之前版本,使用以下命令触发错误并列出包的所有可用版本** ```bash - export MACA_PATH=/opt/maca/ - export LD_LIBRARY_PATH=${MACA_PATH}/lib:${MACA_PATH}/mxgpu_llvm/lib:${LD_LIBRARY_PATH} - export MACA_CLANG_PATH=${MACA_PATH}/mxgpu_llvm/bin - export PYTORCH_USE_FLASHATTN=1 + pip install == -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com ``` - - **如果使用PyTorch Extension功能,需要安装cu-bridge环境,并额外设置以下环境变量** +- **对于 pip 22.0 之后版本,使用以下命令列出某个包的所有可用版本** ```bash - export CUDA_PATH=/opt/maca/tools/cu-bridge/ - export CUCC_PATH=/opt/maca/tools/cu-bridge/ - export PATH=${CUCC_PATH}/tools:${CUCC_PATH}/bin:${PATH} + pip index versions -i https://repos.metax-tech.com/r/maca-pypi/simple --trusted-host repos.metax-tech.com ``` - - **执行以下命令,会输出 `"tensor([1., 1.], device='cuda:0')"` 即表明安装成功** +## Conda安装 + +### 单包安装 + - **使用以下命令安装指定包** ```bash - python -c "import torch; print(torch.ones(2).cuda())" + conda install -c https://repos.metax-tech.com/r/maca-conda/ ``` -## 卸载 - - **卸载mcPyTorch** +### 列出可用版本 +- ```bash - pip uninstall + conda search --info -c https://repos.metax-tech.com/r/maca-conda/ ``` - +## 兼容性 + - 当前仓库仅支持 Python 3.8 和 Python 3.10 版本。 + - 当前仓库仅支持cpython编译器。 \ No newline at end of file