From 5808a295a490cffddcdd76e957cfe22f02f25de6 Mon Sep 17 00:00:00 2001 From: lijiakun Date: Fri, 21 Mar 2025 10:18:04 +0800 Subject: [PATCH 01/10] add goldenstick st --- tests/st/python/test_goldenstick.py | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/st/python/test_goldenstick.py diff --git a/tests/st/python/test_goldenstick.py b/tests/st/python/test_goldenstick.py new file mode 100644 index 00000000..0ebdad74 --- /dev/null +++ b/tests/st/python/test_goldenstick.py @@ -0,0 +1,33 @@ +# Copyright 2024 The vLLM team. +# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://wwww.apache.org/licenses/LICENSE-2.0 +# +# Unless required by application law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""test demo for st.""" +import pytest + + +class TestGoldenStick: + """ + Test Demo for ST. + """ + @pytest.mark.level0 + @pytest.mark.platform_arm_ascend910b_training + @pytest.mark.env_single + def test_aaa(self): + """ + test case aaa + """ + from mindspore_gs.ptq import PTQConfig + a = PTQConfig() + assert a.group_size == 0 -- Gitee From cac711c460bddbf8494563986cac43ec16e468c3 Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 10:19:47 +0800 Subject: [PATCH 02/10] deepseek model support model inputs --- .gitignore | 3 +++ .gitmodules | 4 ++++ tests/run_all_tests.sh | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 .gitmodules create mode 100644 tests/run_all_tests.sh diff --git a/.gitignore b/.gitignore index b4bf03fd..68be17cc 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,6 @@ dmypy.json # Cython debug symbols cython_debug/ + +# tests +tests/mindformers \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..93a6eab2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "tests/mindformers"] + path = tests/mindformers + url = https://gitee.com/mindspore/mindformers.git + branch = br_infer_deepseek_os \ No newline at end of file diff --git a/tests/run_all_tests.sh b/tests/run_all_tests.sh new file mode 100644 index 00000000..f31977cf --- /dev/null +++ b/tests/run_all_tests.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +pytest ./st \ No newline at end of file -- Gitee From 4a39cda00914624368ef00b460cd7a2ee18541fd Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 15:12:41 +0800 Subject: [PATCH 03/10] add env --- tests/run_all_tests.sh | 14 ++++++++++++++ tests/st/python/test_env.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/st/python/test_env.py diff --git a/tests/run_all_tests.sh b/tests/run_all_tests.sh index f31977cf..feaeaf08 100644 --- a/tests/run_all_tests.sh +++ b/tests/run_all_tests.sh @@ -1,3 +1,17 @@ #!/bin/bash +export MINDFORMERS_MODEL_CONFIG=/home/zxh/predict_deepseek_r1_671b_w8a8.yaml +export ASCEND_CUSTOM_PATH=$ASCEND_HOME_PATH/../ +export vLLM_MODEL_BACKEND=MindFormers +export vLLM_MODEL_MEMORY_USE_GB=53 +export ASCEND_TOTAL_MEMORY_GB=64 +export MS_ENABLE_LCCL=off +export HCCL_OP_EXPANSION_MODE=AIV +export HCCL_SOCKET_IFNAME=enp189s0f0 +export GLOO_SOCKET_IFNAME=enp189s0f0 +export TP_SOCKET_IFNAME=enp189s0f0 +export HCCL_CONNECT_TIMEOUT=3600 +export MS_ALLOC_CONF="enable_vmm:True" +export MS_DEV_JIT_SYNTAX_LEVEL=0 + pytest ./st \ No newline at end of file diff --git a/tests/st/python/test_env.py b/tests/st/python/test_env.py new file mode 100644 index 00000000..37ea43d5 --- /dev/null +++ b/tests/st/python/test_env.py @@ -0,0 +1,30 @@ +# Copyright 2024 The vLLM team. +# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://wwww.apache.org/licenses/LICENSE-2.0 +# +# Unless required by application law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================ +"""test demo for st.""" +import pytest + + +class TestEnv: + """ + Test Demo for ST. + """ + @pytest.mark.level0 + @pytest.mark.platform_arm_ascend910b_training + @pytest.mark.env_single + def test_bbb(self): + import os + for key, value in os.environ.items(): + print(f"{key}={value}") -- Gitee From 674959df35dfb4dd45efb80c27389d909792db44 Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 15:20:32 +0800 Subject: [PATCH 04/10] a --- tests/run_all_tests.sh | 17 ----------------- tests/st/python/test_env.py | 30 ------------------------------ 2 files changed, 47 deletions(-) delete mode 100644 tests/run_all_tests.sh delete mode 100644 tests/st/python/test_env.py diff --git a/tests/run_all_tests.sh b/tests/run_all_tests.sh deleted file mode 100644 index feaeaf08..00000000 --- a/tests/run_all_tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -export MINDFORMERS_MODEL_CONFIG=/home/zxh/predict_deepseek_r1_671b_w8a8.yaml -export ASCEND_CUSTOM_PATH=$ASCEND_HOME_PATH/../ -export vLLM_MODEL_BACKEND=MindFormers -export vLLM_MODEL_MEMORY_USE_GB=53 -export ASCEND_TOTAL_MEMORY_GB=64 -export MS_ENABLE_LCCL=off -export HCCL_OP_EXPANSION_MODE=AIV -export HCCL_SOCKET_IFNAME=enp189s0f0 -export GLOO_SOCKET_IFNAME=enp189s0f0 -export TP_SOCKET_IFNAME=enp189s0f0 -export HCCL_CONNECT_TIMEOUT=3600 -export MS_ALLOC_CONF="enable_vmm:True" -export MS_DEV_JIT_SYNTAX_LEVEL=0 - -pytest ./st \ No newline at end of file diff --git a/tests/st/python/test_env.py b/tests/st/python/test_env.py deleted file mode 100644 index 37ea43d5..00000000 --- a/tests/st/python/test_env.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2024 The vLLM team. -# Copyright 2024 Microsoft and the HuggingFace Inc. team. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://wwww.apache.org/licenses/LICENSE-2.0 -# -# Unless required by application law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""test demo for st.""" -import pytest - - -class TestEnv: - """ - Test Demo for ST. - """ - @pytest.mark.level0 - @pytest.mark.platform_arm_ascend910b_training - @pytest.mark.env_single - def test_bbb(self): - import os - for key, value in os.environ.items(): - print(f"{key}={value}") -- Gitee From 12ee577f4186232849cd40d1e107b102d4df23bb Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 15:30:53 +0800 Subject: [PATCH 05/10] add env --- .gitignore | 3 --- .gitmodules | 6 +++--- tests/st/python/set_env.py | 16 ++++++++++++++++ tests/st/python/test_goldenstick.py | 4 ++++ 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 tests/st/python/set_env.py diff --git a/.gitignore b/.gitignore index 68be17cc..b4bf03fd 100644 --- a/.gitignore +++ b/.gitignore @@ -139,6 +139,3 @@ dmypy.json # Cython debug symbols cython_debug/ - -# tests -tests/mindformers \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 93a6eab2..d057201a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "tests/mindformers"] - path = tests/mindformers - url = https://gitee.com/mindspore/mindformers.git - branch = br_infer_deepseek_os \ No newline at end of file + path = tests/mindformers + url = https://gitee.com/mindspore/mindformers.git + branch = br_infer_deepseek_os diff --git a/tests/st/python/set_env.py b/tests/st/python/set_env.py new file mode 100644 index 00000000..d4f25f17 --- /dev/null +++ b/tests/st/python/set_env.py @@ -0,0 +1,16 @@ +import os +import sys + +# 获取当前执行目录的绝对路径 +current_dir = os.path.abspath(os.getcwd()) + +# 设置环境变量 PYTHONPATH +os.environ["PYTHONPATH"] = current_dir + "/mindformers" + +# 动态修改 sys.path +if current_dir not in sys.path: + sys.path.insert(0, current_dir) + +# 打印信息以确认设置 +print("PYTHONPATH is set to:", os.environ["PYTHONPATH"]) +print("sys.path updated:", sys.path) \ No newline at end of file diff --git a/tests/st/python/test_goldenstick.py b/tests/st/python/test_goldenstick.py index 0ebdad74..fd046539 100644 --- a/tests/st/python/test_goldenstick.py +++ b/tests/st/python/test_goldenstick.py @@ -15,6 +15,7 @@ # ============================================================================ """test demo for st.""" import pytest +import set_env class TestGoldenStick: @@ -28,6 +29,9 @@ class TestGoldenStick: """ test case aaa """ + import os + for k, v in os.environ.items(): + print(f"{k} = {v}") from mindspore_gs.ptq import PTQConfig a = PTQConfig() assert a.group_size == 0 -- Gitee From 537a1e4290d8b853f24e76564cb666c3036c9506 Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 16:50:28 +0800 Subject: [PATCH 06/10] a --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d057201a..51ec9210 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ [submodule "tests/mindformers"] path = tests/mindformers url = https://gitee.com/mindspore/mindformers.git - branch = br_infer_deepseek_os -- Gitee From 2ab01f6131d7a81d8fbb2eb73654a84f701725e2 Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 16:59:46 +0800 Subject: [PATCH 07/10] a --- .gitmodules | 1 + tests/mindformers | 1 + tests/st/python/test_goldenstick.py | 1 + 3 files changed, 3 insertions(+) create mode 160000 tests/mindformers diff --git a/.gitmodules b/.gitmodules index 51ec9210..d057201a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "tests/mindformers"] path = tests/mindformers url = https://gitee.com/mindspore/mindformers.git + branch = br_infer_deepseek_os diff --git a/tests/mindformers b/tests/mindformers new file mode 160000 index 00000000..1d3b9a5a --- /dev/null +++ b/tests/mindformers @@ -0,0 +1 @@ +Subproject commit 1d3b9a5a2fc4bd13a6b685cd5b5eef6af8c345c6 diff --git a/tests/st/python/test_goldenstick.py b/tests/st/python/test_goldenstick.py index fd046539..393b929d 100644 --- a/tests/st/python/test_goldenstick.py +++ b/tests/st/python/test_goldenstick.py @@ -32,6 +32,7 @@ class TestGoldenStick: import os for k, v in os.environ.items(): print(f"{k} = {v}") + assert True == False from mindspore_gs.ptq import PTQConfig a = PTQConfig() assert a.group_size == 0 -- Gitee From c1658554eaccb363d50efb0f8766c873a74a55db Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 17:24:42 +0800 Subject: [PATCH 08/10] a --- .gitmodules | 6 +++--- .jenkins/test/config/dependent_packages.yaml | 3 --- mindformers | 1 + tests/mindformers | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) create mode 160000 mindformers delete mode 160000 tests/mindformers diff --git a/.gitmodules b/.gitmodules index d057201a..3e6bd62b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "tests/mindformers"] - path = tests/mindformers +[submodule "mindformers"] + path = mindformers url = https://gitee.com/mindspore/mindformers.git - branch = br_infer_deepseek_os + branch = dev diff --git a/.jenkins/test/config/dependent_packages.yaml b/.jenkins/test/config/dependent_packages.yaml index 4d4b2078..cd4b99c3 100644 --- a/.jenkins/test/config/dependent_packages.yaml +++ b/.jenkins/test/config/dependent_packages.yaml @@ -1,9 +1,6 @@ mindspore: 'https://repo.mindspore.cn/mindspore/mindspore/version/202503/20250320/master_20250320090217_3eca2ce4180f845e512bc6237e785a1bdf0959c6_newest' -mindformers: - 'https://repo.mindspore.cn/mindspore/mindformers/version/202503/20250314/br_infer_deepseek_os_20250314173721_24b79c6513b3ade8b6b6c4142e9f8e2239180cb8_newest/' - mindspore_gs: 'https://repo.mindspore.cn/mindspore/golden-stick/version/202503/20250321/master_20250321010018_bb9236c2106f3200d8e3f1c32177cb1a7b9c9e78_newest/' diff --git a/mindformers b/mindformers new file mode 160000 index 00000000..bf3f20f3 --- /dev/null +++ b/mindformers @@ -0,0 +1 @@ +Subproject commit bf3f20f37e276597cf6c2f1b29764f817271740b diff --git a/tests/mindformers b/tests/mindformers deleted file mode 160000 index 1d3b9a5a..00000000 --- a/tests/mindformers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1d3b9a5a2fc4bd13a6b685cd5b5eef6af8c345c6 -- Gitee From fd37770549db0fd75cfe023227ddcb7ad99db93f Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 17:28:02 +0800 Subject: [PATCH 09/10] a --- .jenkins/test/config/dependent_packages.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.jenkins/test/config/dependent_packages.yaml b/.jenkins/test/config/dependent_packages.yaml index cd4b99c3..4d4b2078 100644 --- a/.jenkins/test/config/dependent_packages.yaml +++ b/.jenkins/test/config/dependent_packages.yaml @@ -1,6 +1,9 @@ mindspore: 'https://repo.mindspore.cn/mindspore/mindspore/version/202503/20250320/master_20250320090217_3eca2ce4180f845e512bc6237e785a1bdf0959c6_newest' +mindformers: + 'https://repo.mindspore.cn/mindspore/mindformers/version/202503/20250314/br_infer_deepseek_os_20250314173721_24b79c6513b3ade8b6b6c4142e9f8e2239180cb8_newest/' + mindspore_gs: 'https://repo.mindspore.cn/mindspore/golden-stick/version/202503/20250321/master_20250321010018_bb9236c2106f3200d8e3f1c32177cb1a7b9c9e78_newest/' -- Gitee From 8613e8d81e7ec44e873d4b3cbc114e4e7c138edb Mon Sep 17 00:00:00 2001 From: lijiakun Date: Mon, 24 Mar 2025 18:01:06 +0800 Subject: [PATCH 10/10] a --- .gitmodules | 4 ++-- mindformers => tests/mindformers | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename mindformers => tests/mindformers (100%) diff --git a/.gitmodules b/.gitmodules index 3e6bd62b..ec95f133 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "mindformers"] - path = mindformers +[submodule "tests/mindformers"] + path = tests/mindformers url = https://gitee.com/mindspore/mindformers.git branch = dev diff --git a/mindformers b/tests/mindformers similarity index 100% rename from mindformers rename to tests/mindformers -- Gitee