From 2e506120172420b761c46cad65c1ee3f5427f347 Mon Sep 17 00:00:00 2001 From: nurxat Date: Tue, 4 Mar 2025 16:06:49 +0800 Subject: [PATCH 1/3] support poetry --- docs/features/install_guide.md | 19 +++++++++++++ pyproject.toml | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 pyproject.toml diff --git a/docs/features/install_guide.md b/docs/features/install_guide.md index f6ac441ee..18a1fe30a 100644 --- a/docs/features/install_guide.md +++ b/docs/features/install_guide.md @@ -59,3 +59,22 @@ cd ../MindSpeed-LLM pip install -r requirements.txt # 安装其余依赖库 ``` + +### poetry安装PTA及MindSpeed-LLM相关依赖 + +```shell +git clone https://github.com/NVIDIA/Megatron-LM.git +git clone https://gitee.com/ascend/MindSpeed-LLM.git +cp -r Megatron-LM/megatron MindSpeed-LLM/ +cd MindSpeed-LLM + +# 创建并进入虚拟环境 +pip install poetry +poetry env use python3.8 +poetry shell + +# 手动安装PTA,MindSpeed-LLM依赖库会根据pyproject.toml文件自动安装 +poetry add torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl +poetry add torch_npu-2.1.0.post8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl +poetry add apex-0.1.dev20241015+ascend-cp38-cp38-linux_aarch64.whl +``` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..20a6b7e0d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,51 @@ +[tool.poetry] +name = "mindspeed-llm" +version = "0.1.0" +description = "The Python dependencies of MindSpeed-LLM" +authors = ["30068855 nuerxiatiabulimiti@h-partners.com"] +readme = "README.md" + +[tool.poetry.dependencies] +python = ">=3.8" +numpy = ">=1.19.2,<2.0.0" +transformers = "4.43.2" +transformers-stream-generator = "*" +sympy = "*" +decorator = "*" +scipy = "*" +sentencepiece = "*" +einops = "*" +datasets = ">=2.16.0" +pybind11 = "*" +accelerate = "*" +six = "*" +protobuf = "*" +peft = "0.7.1" +tiktoken = "*" +ray = "2.10.0" +tensordict = "0.1.2" +hydra-core = "1.3.2" +codetiming = "*" +bitsandbytes-npu-beta = "0.45.2" +word2number = "*" +latex2sympy2 = "*" +antlr4-python3-runtime = "==4.9.*" +ninja = "*" +wheel = "*" +regex = "*" +attrs = "*" +psutil = "*" +pyyaml = "*" +tokenizers = "<=0.20.3" +gpytorch = "*" +pandas = "*" +scikit-learn = "*" +SQLAlchemy = "*" +mindspeed = { git = "https://gitee.com/ascend/MindSpeed.git", branch = "0dfa0035ec54d9a74b2f6ee2867367df897299df" } + +[tool.poetry.group.dev.dependencies] +pytest = "^8.3.5" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file -- Gitee From 7c1e9ce581438dc0322f0b7c1a2f65691722a785 Mon Sep 17 00:00:00 2001 From: nurxat Date: Wed, 12 Mar 2025 21:14:25 +0800 Subject: [PATCH 2/3] update config --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 20a6b7e0d..a95cb05fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "mindspeed-llm" version = "0.1.0" description = "The Python dependencies of MindSpeed-LLM" -authors = ["30068855 nuerxiatiabulimiti@h-partners.com"] +authors = [""] readme = "README.md" [tool.poetry.dependencies] -- Gitee From e86da42a23c8ea0aefa42647b62916f87e620f80 Mon Sep 17 00:00:00 2001 From: nurxat Date: Tue, 18 Mar 2025 09:32:40 +0800 Subject: [PATCH 3/3] support poetry --- docs/features/install_guide.md | 19 ------------------- docs/features/poetry_guide.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 docs/features/poetry_guide.md diff --git a/docs/features/install_guide.md b/docs/features/install_guide.md index 18a1fe30a..f6ac441ee 100644 --- a/docs/features/install_guide.md +++ b/docs/features/install_guide.md @@ -59,22 +59,3 @@ cd ../MindSpeed-LLM pip install -r requirements.txt # 安装其余依赖库 ``` - -### poetry安装PTA及MindSpeed-LLM相关依赖 - -```shell -git clone https://github.com/NVIDIA/Megatron-LM.git -git clone https://gitee.com/ascend/MindSpeed-LLM.git -cp -r Megatron-LM/megatron MindSpeed-LLM/ -cd MindSpeed-LLM - -# 创建并进入虚拟环境 -pip install poetry -poetry env use python3.8 -poetry shell - -# 手动安装PTA,MindSpeed-LLM依赖库会根据pyproject.toml文件自动安装 -poetry add torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -poetry add torch_npu-2.1.0.post8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -poetry add apex-0.1.dev20241015+ascend-cp38-cp38-linux_aarch64.whl -``` \ No newline at end of file diff --git a/docs/features/poetry_guide.md b/docs/features/poetry_guide.md new file mode 100644 index 000000000..b3b8a404a --- /dev/null +++ b/docs/features/poetry_guide.md @@ -0,0 +1,20 @@ + +### poetry管理环境 + +```shell +# 准备MindSpeed-LLM及megatron +git clone https://github.com/NVIDIA/Megatron-LM.git +git clone https://gitee.com/ascend/MindSpeed-LLM.git +cp -r Megatron-LM/megatron MindSpeed-LLM/ +cd MindSpeed-LLM + +# 创建并进入虚拟环境 +pip install poetry +poetry env use python3.8 +poetry shell + +# 手动安装PTA,MindSpeed-LLM依赖库会根据pyproject.toml文件自动安装 +poetry add torch-2.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl +poetry add torch_npu-2.1.0.post8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl +poetry add apex-0.1.dev20241015+ascend-cp38-cp38-linux_aarch64.whl +``` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a95cb05fa..1030df0d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ gpytorch = "*" pandas = "*" scikit-learn = "*" SQLAlchemy = "*" -mindspeed = { git = "https://gitee.com/ascend/MindSpeed.git", branch = "0dfa0035ec54d9a74b2f6ee2867367df897299df" } +mindspeed = { git = "https://gitee.com/ascend/MindSpeed.git", rev = "0dfa0035ec54d9a74b2f6ee2867367df897299df" } [tool.poetry.group.dev.dependencies] pytest = "^8.3.5" -- Gitee