已合并
fix:pipeline报错用例,删除看护用例中的save参数 #2380
wx_4e191bb7af创建于 2025年3月11日
fix:pipeline报错用例,删除看护用例中的save参数 #2380
已合并
wx_4e191bb7af创建于 2025年3月11日
refs/pull/2380/head合入到master
5 个文件变更+33-37
@@ -45,38 +45,6 @@ class TestInferenceWorldSize2(DistributedTest):
45 world_size = 245 world_size = 2
46 test_config = create_testconfig(Path(__file__).with_suffix(".json"))46 test_config = create_testconfig(Path(__file__).with_suffix(".json"))
47 47 
48- @pytest.mark.parametrize("params", test_config["test_llama2_legacy_prompt_greedy_search"])
49- def test_llama2_legacy_greedy_search(self, build_args, params):
50- os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
51- os.environ["CLOSE_MATMUL_K_SHIFT"] = "1"
52- if dist.get_rank() == 0:
53- handler, log_capture = setup_logger(PATTERN)
54- 
55- main()
56- if dist.get_rank() == 0:
57- print("=============== llama2 legacy prompt greedy search =============")
58- print(log_capture)
59- context = acquire_context(log_capture)
60- assert [context] == [
61- "I'm doing well, thanks.\nI'm doing well, thanks. I'm doing well, thanks. I'm doing"
62- ], "forward pass has been changed, check it!"
63- 
64- @pytest.mark.parametrize("params", test_config["test_llama2_lora_prompt_legacy_greedy_search"])
65- def test_llama2_lora_legacy_greedy_search(self, build_args, params):
66- os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
67- os.environ["CLOSE_MATMUL_K_SHIFT"] = "1"
68- if dist.get_rank() == 0:
69- handler, log_capture = setup_logger(PATTERN)
70- 
71- main()
72- if dist.get_rank() == 0:
73- print("=============== llama2 lora legacy prompt greedy search =============")
74- print(log_capture)
75- context = acquire_context(log_capture)
76- assert [context] == [
77- "I'm doing well, thanks.\nI'm doing well, thanks. I'm doing well, thanks. I'm doing"
78- ], "forward pass has been changed, check it!"
79- 
80 @pytest.mark.parametrize("params", test_config["test_chatglm3_mcore_greedy_search"])48 @pytest.mark.parametrize("params", test_config["test_chatglm3_mcore_greedy_search"])
81 def test_chatglm3_mcore_greedy_search(self, build_args, params):49 def test_chatglm3_mcore_greedy_search(self, build_args, params):
82 os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"50 os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
@@ -113,7 +81,39 @@ class TestInferenceWorldSize2(DistributedTest):
113class TestInference(DistributedTest):81class TestInference(DistributedTest):
114 world_size = 882 world_size = 8
115 test_config = create_testconfig(Path(__file__).with_suffix(".json"))83 test_config = create_testconfig(Path(__file__).with_suffix(".json"))
116- 84+
85+ @pytest.mark.parametrize("params", test_config["test_llama2_legacy_prompt_greedy_search"])
86+ def test_llama2_legacy_greedy_search(self, build_args, params):
87+ os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
88+ os.environ["CLOSE_MATMUL_K_SHIFT"] = "1"
89+ if dist.get_rank() == 0:
90+ handler, log_capture = setup_logger(PATTERN)
91+
92+ main()
93+ if dist.get_rank() == 0:
94+ print("=============== llama2 legacy prompt greedy search =============")
95+ print(log_capture)
96+ context = acquire_context(log_capture)
97+ assert [context] == [
98+ "I'm doing well, thanks.\nI'm doing well, thanks. I'm doing well, thanks. I'm doing"
99+ ], "forward pass has been changed, check it!"
100+
101+ @pytest.mark.parametrize("params", test_config["test_llama2_lora_prompt_legacy_greedy_search"])
102+ def test_llama2_lora_legacy_greedy_search(self, build_args, params):
103+ os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
104+ os.environ["CLOSE_MATMUL_K_SHIFT"] = "1"
105+ if dist.get_rank() == 0:
106+ handler, log_capture = setup_logger(PATTERN)
107+
108+ main()
109+ if dist.get_rank() == 0:
110+ print("=============== llama2 lora legacy prompt greedy search =============")
111+ print(log_capture)
112+ context = acquire_context(log_capture)
113+ assert [context] == [
114+ "I'm doing well, thanks.\nI'm doing well, thanks. I'm doing well, thanks. I'm doing"
115+ ], "forward pass has been changed, check it!"
116+
117 @pytest.mark.parametrize("params", test_config["test_baichuan2_mcore_greedy_search"])117 @pytest.mark.parametrize("params", test_config["test_baichuan2_mcore_greedy_search"])
118 def test_baichuan2_mcore_greedy_search(self, build_args, params):118 def test_baichuan2_mcore_greedy_search(self, build_args, params):
119 os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"119 os.environ["CUDA_DEVICE_MAX_CONNECTIONS"] = "1"
@@ -106,4 +106,3 @@ torchrun $DISTRIBUTED_ARGS $basepath/pretrain_gpt.py \
106 $OUTPUT_ARGS \106 $OUTPUT_ARGS \
107 --distributed-backend nccl \107 --distributed-backend nccl \
108 --load ${CKPT_LOAD_DIR} \108 --load ${CKPT_LOAD_DIR} \
109- --save ${CKPT_SAVE_DIR}
@@ -106,7 +106,6 @@ CKPT_ARGS="
106 --no-save-optim \106 --no-save-optim \
107 --no-save-rng \107 --no-save-rng \
108 --seed 1234 \108 --seed 1234 \
109- --save ${CKPT_SAVE_DIR}
110"109"
111 110 
112OUTPUT_ARGS="111OUTPUT_ARGS="
@@ -98,4 +98,3 @@ torchrun $DISTRIBUTED_ARGS $basepath/pretrain_gpt.py \
98 $OUTPUT_ARGS \98 $OUTPUT_ARGS \
99 --distributed-backend nccl \99 --distributed-backend nccl \
100 --load ${CKPT_LOAD_DIR} \100 --load ${CKPT_LOAD_DIR} \
101- --save ${CKPT_SAVE_DIR} \
@@ -13,7 +13,6 @@ WORLD_SIZE=$(($NPUS_PER_NODE*$NNODES))
13basepath=$(cd `dirname $0`; cd ../../../; pwd)13basepath=$(cd `dirname $0`; cd ../../../; pwd)
14 14 
15 15 
16-CKPT_SAVE_DIR="./ckpt"
17DATA_PATH="/data/pretrain_dataset/alpaca_text_document"16DATA_PATH="/data/pretrain_dataset/alpaca_text_document"
18TOKENIZER_MODEL="/data/llama-2-7b-hf/tokenizer.model"17TOKENIZER_MODEL="/data/llama-2-7b-hf/tokenizer.model"
19CKPT_LOAD_DIR="/data/llama2-2dtp-tp4pp2vp2tpx2tpy2"18CKPT_LOAD_DIR="/data/llama2-2dtp-tp4pp2vp2tpx2tpy2"