From 121dd4937863191ecda31e3b2e5cd8a8b34cf87c Mon Sep 17 00:00:00 2001 From: hangangqiang Date: Thu, 23 Oct 2025 16:57:09 +0800 Subject: [PATCH] bugfix: 1. mf-infer-model use pretrained_model_dir not load_checkpoint 2. remove allreduce in single card case 3. copy more files from float-safetensors-dir --- .jenkins/check/config/filter_pylint.txt | 5 + .../ptq/models/mindformers_models/mf_model.py | 30 +-- .../mindformers_models/param_processor.py | 3 +- mindspore_gs/ptq/models/safetensors_mgr.py | 60 ++++- .../mindformers/linear_smooth_wrappers.py | 6 +- requirements.txt | 1 + .../st/ptq/models/api/test_safetensors_mgr.py | 233 ++++++++++++++++++ .../network/calibrate_deepseek3_671b.yaml | 2 +- .../ptq/models/network/calibrate_qwen3.yaml | 2 +- .../models/network/calibrate_qwen3_moe.yaml | 2 +- .../models/network/calibrate_telechat2.yaml | 2 +- 11 files changed, 314 insertions(+), 32 deletions(-) create mode 100644 tests/st/ptq/models/api/test_safetensors_mgr.py diff --git a/.jenkins/check/config/filter_pylint.txt b/.jenkins/check/config/filter_pylint.txt index 592067e5..3538b642 100644 --- a/.jenkins/check/config/filter_pylint.txt +++ b/.jenkins/check/config/filter_pylint.txt @@ -72,6 +72,9 @@ "golden-stick/mindspore_gs/common/json_cache.py" "unused-argument" "golden-stick/mindspore_gs/common/logger.py" "unused-argument" "golden-stick/mindspore_gs/ptq/transformer_inspect.py" "unidiomatic-typecheck" +"golden-stick/mindspore_gs/ptq/models/mindformers_models/mf_model.py" "import-outside-toplevel" +"golden-stick/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py" "import-outside-toplevel" +"golden-stick/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py" "super-with-arguments" # tests "golden-stick/tests/st/loss_monitor.py" "unused-argument" @@ -123,6 +126,8 @@ "golden-stick/tests/st/ptq/models/network/ptq_model_tester.py" "wrong-import-position" "golden-stick/tests/st/ptq/models/api/test_auto_model.py" "wrong-import-position" "golden-stick/tests/st/ptq/models/api/test_base_model.py" "wrong-import-position" +"golden-stick/tests/st/ptq/models/api/test_safetensors_mgr.py" "wrong-import-position" +"golden-stick/tests/st/ptq/models/api/test_safetensors_mgr.py" "protected-access" # for version check "golden-stick/mindspore_gs/__init__.py" "wrong-import-position" diff --git a/mindspore_gs/ptq/models/mindformers_models/mf_model.py b/mindspore_gs/ptq/models/mindformers_models/mf_model.py index 12a333d8..1e7de2e3 100644 --- a/mindspore_gs/ptq/models/mindformers_models/mf_model.py +++ b/mindspore_gs/ptq/models/mindformers_models/mf_model.py @@ -161,10 +161,11 @@ class MFModel(BaseQuantForCausalLMImpl): with no_init_parameters(): self.network = AutoModel.from_config(yaml_path) - self._original_sf_path = config.load_checkpoint - if config.load_checkpoint: - self.network.load_weights(config.load_checkpoint) - self._after_network_load_weights() + self._original_sf_path = config.pretrained_model_dir + if not self._original_sf_path: + raise ValueError(f"Make sure pretrained_model_dir in yaml-file is not empty: {yaml_path}") + self.network.load_weights(self._original_sf_path) + self._after_network_load_weights() # pylint: disable=arguments-differ @classmethod @@ -340,8 +341,8 @@ class MFModelEnableSafeTensors(MFModel): # _del_experts_weight experts_dict = {k: v for k, v in param_dict.items() if ".mlp.experts." in k} - is_fc1_quant = any([".linear_fc1.weight_scale" in k for k in experts_dict.keys()]) - is_fc2_quant = any([".linear_fc2.weight_scale" in k for k in experts_dict.keys()]) + is_fc1_quant = any(".linear_fc1.weight_scale" in k for k in experts_dict.keys()) + is_fc2_quant = any(".linear_fc2.weight_scale" in k for k in experts_dict.keys()) def process(root, name_prefix): """Iterate the whole network and call callback function `process_cell`.""" if root is None: @@ -362,8 +363,7 @@ class MFModelEnableSafeTensors(MFModel): if (is_fc1_quant and "weight1" in key) or \ (is_fc2_quant and "weight2" in key): continue - else: - new_param_dict[key] = value + new_param_dict[key] = value return new_param_dict, param_name_trace def _shard_dict(self): @@ -602,8 +602,8 @@ class MFModelNotEnableSafeTensors(MFModel): if ".mlp.experts." in k} other_dict = dict(param_dict.items() - experts_dict.items()) new_param_dict.update(other_dict) - is_fc1_quant = any([".linear_fc1.weight_scale" in k for k in experts_dict.keys()]) - is_fc2_quant = any([".linear_fc2.weight_scale" in k for k in experts_dict.keys()]) + is_fc1_quant = any(".linear_fc1.weight_scale" in k for k in experts_dict.keys()) + is_fc2_quant = any(".linear_fc2.weight_scale" in k for k in experts_dict.keys()) experts_fc1_dict = {k: v for k, v in experts_dict.items() if ".mlp.experts" in k and ".linear_fc1" in k} @@ -637,11 +637,11 @@ class MFModelNotEnableSafeTensors(MFModel): new_name = f"{prefix_str}.{suffix_str}" else: new_name = f"{prefix_str}.{weight_name}" - if new_name in new_param_dict.keys(): + if new_name in new_param_dict: continue experts_dict = {k: v for k, v in param_dict.items() if k.startswith(prefix_str) and k.endswith(suffix_str)} - num_experts = len(experts_dict.keys()) + num_experts = len(experts_dict) value_list = [] for i in range(num_experts): key_ = f"{prefix_str}.{i}.{suffix_str}" @@ -741,7 +741,7 @@ class MFModelNotEnableSafeTensors(MFModel): str. Path to the saved SafeTensors file. """ start = time.time() - logger.info(f"Saving checkpoint...", flush=True) + logger.info("Saving checkpoint...", flush=True) param_dict = self.parameters_dict() try: rank_id = get_rank() @@ -764,9 +764,9 @@ class MFModelNotEnableSafeTensors(MFModel): str. Path to the saved description JSON file. """ start = time.time() - logger.info(f"Saving describle json file...", flush=True) + logger.info("Saving describle json file...", flush=True) desc_info = self.get_description_file(self._network()) - save_json_path = os.path.join(save_path, f"quantization_description.json") + save_json_path = os.path.join(save_path, "quantization_description.json") os.makedirs(save_path, exist_ok=True) with open(save_json_path, "w", encoding="utf-8") as f: json.dump(desc_info, f, ensure_ascii=False, indent=4) diff --git a/mindspore_gs/ptq/models/mindformers_models/param_processor.py b/mindspore_gs/ptq/models/mindformers_models/param_processor.py index 0c24ee6e..f0afb9a6 100644 --- a/mindspore_gs/ptq/models/mindformers_models/param_processor.py +++ b/mindspore_gs/ptq/models/mindformers_models/param_processor.py @@ -22,7 +22,6 @@ from mindspore import Parameter from mindspore import ops as msops from mindformers.parallel_core.inference.parallel_state import get_tensor_model_parallel_world_size -from mindspore_gs.common import logger class MLAParamProcessor: @@ -259,7 +258,7 @@ class MoeParamProcessor(): elif hasattr(self.network.config, 'expert_num'): self.num_experts = self.network.config.expert_num else: - logger.error(f"Warning: Could not find experts number in config") + raise RuntimeError("Could not find experts number in config.json") self.moe_split_rules = (r'\.mlp\.experts\.', *(f'.mlp.experts.{i}.' for i in range(self.num_experts))) diff --git a/mindspore_gs/ptq/models/safetensors_mgr.py b/mindspore_gs/ptq/models/safetensors_mgr.py index 7fac112b..6e034d8a 100644 --- a/mindspore_gs/ptq/models/safetensors_mgr.py +++ b/mindspore_gs/ptq/models/safetensors_mgr.py @@ -51,7 +51,7 @@ class SafeTensorsMgr: os.makedirs(save_path, exist_ok=True) index_json, inv_index_json, total_bytes = self._index_and_size(dis_params_dict) - SafeTensorsMgr._copy_original_json(original_path, save_path) + SafeTensorsMgr._copy_original_files(original_path, save_path) SafeTensorsMgr._save_sf_index_json(save_path, index_json, total_bytes) SafeTensorsMgr._save_quant_desc_json(save_path, quant_desc_info) SafeTensorsMgr._save_safetensors(save_path, inv_index_json) @@ -61,12 +61,56 @@ class SafeTensorsMgr: logger.info(f"barrier finish at rank {self.rank_id}.") @staticmethod - def _copy_original_json(original_path, save_path): + def _copy_original_files(original_path, save_path): + """ + Copy files from original directory to save directory with blacklist filtering. + + This method copies all files from the original directory to the save directory, + except for files that match patterns in the blacklist. The blacklist currently + includes files ending with '.index.json' and '.safetensors' to avoid copying + index files and safetensors files that will be regenerated. + + Args: + original_path (str): Path to the source directory containing original files. + save_path (str): Path to the destination directory where files will be copied. + + Raises: + FileNotFoundError: If the original_path does not exist. + NotADirectoryError: If the original_path is not a directory. + + Note: + - Path validation is performed before file operations to ensure robustness. + - Only files in the root of original_path are processed (no subdirectories). + - File permissions and metadata are preserved using shutil.copy2. + - Files matching blacklist patterns are silently skipped. + """ src_path = Path(original_path) - for json_file in src_path.glob('*.json'): - if json_file.name.endswith('.index.json'): - continue - shutil.copy2(json_file, os.path.join(save_path, json_file.name)) + + # Validate that the source path exists and is a directory + if not src_path.exists(): + raise FileNotFoundError(f"Source path does not exist: {original_path}") + if not src_path.is_dir(): + raise NotADirectoryError(f"Source path is not a directory: {original_path}") + + # Define blacklist for files that should not be copied + blacklist_patterns = [ + '.index.json', # Original blacklist item + '.safetensors' # Exclude safetensors files as requested + ] + + # Iterate through all files in the source directory + for file_path in src_path.iterdir(): + if file_path.is_file(): + # Check if file matches any blacklist pattern + should_skip = False + for pattern in blacklist_patterns: + if file_path.name.endswith(pattern): + should_skip = True + break + + # Copy file if it's not in blacklist + if not should_skip: + shutil.copy2(file_path, os.path.join(save_path, file_path.name)) def _tp_merge(self, dis_params_dict: dict[str, DistributedParameter]): sorted_params = sorted(dis_params_dict) @@ -123,7 +167,7 @@ class SafeTensorsMgr: @staticmethod def _save_quant_desc_json(save_path, quant_desc): """_save_desc_json""" - save_json_path = os.path.join(save_path, f"quantization_description.json") + save_json_path = os.path.join(save_path, "quantization_description.json") os.makedirs(save_path, exist_ok=True) with open(save_json_path, "w", encoding="utf-8") as f: json.dump(quant_desc, f, ensure_ascii=False, indent=4) @@ -132,7 +176,7 @@ class SafeTensorsMgr: @staticmethod def _save_sf_index_json(save_path, index_json, total_bytes): """_save_desc_json""" - save_json_path = os.path.join(save_path, f"model.safetensors.index.json") + save_json_path = os.path.join(save_path, "model.safetensors.index.json") os.makedirs(save_path, exist_ok=True) index_data = { "metadata": {"total_size": total_bytes}, diff --git a/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py b/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py index 0bdebabe..5832b434 100644 --- a/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py +++ b/mindspore_gs/ptq/ptq/wrappers/mindformers/linear_smooth_wrappers.py @@ -401,7 +401,7 @@ class SearchLinearCell(nn.Cell): min_loss = loss best_hyper_param = hyper_param if not best_hyper_param: - raise RuntimeError(f"No search space found.") + raise RuntimeError("No search space found.") self._settle_best(best_hyper_param) @@ -474,7 +474,7 @@ class SearchOutlierSuppressionLiteLinearCell(SmoothQuantLinearCell): self.ic_axis = rank - 1 if self._transpose_b() else rank - 2 self.oc_axis = rank - 2 if self._transpose_b() else rank - 1 self.oc = linear.weight.shape[self.oc_axis] - self.is_expert = (rank == 3) + self.is_expert = rank == 3 self.expert_num = linear.weight.shape[0] if self.is_expert else -1 if self.layer.has_bias and self.expert_num and self.expert_num > 0: raise ValueError(f"Only moe cell without bias is supported, but {linear_name} has bias.") @@ -619,7 +619,7 @@ class SearchOutlierSuppressionLiteLinearCell(SmoothQuantLinearCell): self.x_zp = Tensor(x_zp) self._layer.weight.set_data(msops.cast(q_weight, self._layer.weight.dtype)) self.y_zp = q_weight.sum(axis=self.ic_axis, dtype=msdtype.int32) * self.x_zp.astype(msdtype.int32) - if self.is_rowparallel: + if self.is_rowparallel and self.context.tp_size > 1: self.y_zp = msops.AllReduce(op=ReduceOp.SUM, group=GlobalComm.WORLD_COMM_GROUP)(self.y_zp) quant_output = self._module_forward(True) msops.assign(self._layer.weight, fp16_weight) diff --git a/requirements.txt b/requirements.txt index b662a6d1..c7dc1294 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ prettytable # for ut/st pytest >= 1.6.0 +tiktoken == 0.9.0 aiohttp < 3.9; python_version == '3.9' \ No newline at end of file diff --git a/tests/st/ptq/models/api/test_safetensors_mgr.py b/tests/st/ptq/models/api/test_safetensors_mgr.py new file mode 100644 index 00000000..b92166af --- /dev/null +++ b/tests/st/ptq/models/api/test_safetensors_mgr.py @@ -0,0 +1,233 @@ +# Copyright 2025 Huawei Technologies Co., Ltd +# +# 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://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable 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 SafeTensorsMgr.""" + +import os +import tempfile +import shutil +import json +import pytest + +from mindspore_gs.ptq.models.safetensors_mgr import SafeTensorsMgr + + +class TestSafeTensorsMgr: + """Test cases for SafeTensorsMgr class.""" + + def setup_method(self): + """Setup method to create temporary directories and test files.""" + # Create temporary work directory + self.work_dir = tempfile.mkdtemp() + self.original_path = os.path.join(self.work_dir, "original") + self.save_path = os.path.join(self.work_dir, "save") + + # Create directories + os.makedirs(self.original_path) + os.makedirs(self.save_path) + + # Create test files in original directory + self._create_test_files() + + def teardown_method(self): + """Teardown method to clean up temporary directories.""" + if os.path.exists(self.work_dir): + shutil.rmtree(self.work_dir) + + def _create_test_files(self): + """Create various test files in the original directory.""" + # Create a regular JSON file (should be copied) + config_data = {"model_type": "test", "hidden_size": 768} + with open(os.path.join(self.original_path, "config.json"), 'w', encoding='utf-8') as f: + json.dump(config_data, f) + + # Create a tokenizer JSON file (should be copied) + tokenizer_data = {"vocab_size": 50000} + with open(os.path.join(self.original_path, "tokenizer.json"), 'w', encoding='utf-8') as f: + json.dump(tokenizer_data, f) + + # Create an index.json file (should be filtered out) + index_data = {"weight_map": {"layer.0.weight": "model-00001-of-00002.safetensors"}} + with open(os.path.join(self.original_path, "model.safetensors.index.json"), 'w', encoding='utf-8') as f: + json.dump(index_data, f) + + # Create a safetensors file (should be filtered out) + with open(os.path.join(self.original_path, "model.safetensors"), 'wb') as f: + f.write(b"fake safetensors content") + + # Create a text file (should be copied) + with open(os.path.join(self.original_path, "README.txt"), 'w', encoding='utf-8') as f: + f.write("This is a test README file.") + + # Create a Python file (should be copied) + with open(os.path.join(self.original_path, "modeling.py"), 'w', encoding='utf-8') as f: + f.write("# Test Python file\nprint('Hello World')") + + # Create another safetensors file with different name (should be filtered out) + with open(os.path.join(self.original_path, "pytorch_model.safetensors"), 'wb') as f: + f.write(b"another fake safetensors content") + + @pytest.mark.level0 + @pytest.mark.platform_x86_cpu + @pytest.mark.env_onecard + def test_copy_original_files_basic(self): + """ + Feature: SafeTensorsMgr _copy_original_files method. + Description: Test basic file copying with blacklist filtering. + Expectation: Only non-blacklisted files are copied. + """ + # Create SafeTensorsMgr instance + mgr = SafeTensorsMgr(self.original_path) + + # Call the private method directly for testing + mgr._copy_original_files(self.original_path, self.save_path) + + # Check that expected files are copied + expected_files = ["config.json", "tokenizer.json", "README.txt", "modeling.py"] + for expected_file in expected_files: + copied_file_path = os.path.join(self.save_path, expected_file) + assert os.path.exists(copied_file_path), f"Expected file {expected_file} was not copied" + + # Check that blacklisted files are not copied + blacklisted_files = ["model.safetensors.index.json", "model.safetensors", "pytorch_model.safetensors"] + for blacklisted_file in blacklisted_files: + copied_file_path = os.path.join(self.save_path, blacklisted_file) + assert not os.path.exists(copied_file_path), f"Blacklisted file {blacklisted_file} should not be copied" + + @pytest.mark.level0 + @pytest.mark.platform_x86_cpu + @pytest.mark.env_onecard + def test_copy_original_files_content_integrity(self): + """ + Feature: SafeTensorsMgr _copy_original_files method. + Description: Test that copied files maintain content integrity. + Expectation: Copied files have identical content to originals. + """ + # Create SafeTensorsMgr instance + mgr = SafeTensorsMgr(self.original_path) + + # Call the private method + mgr._copy_original_files(self.original_path, self.save_path) + + # Verify content integrity for JSON files + original_config = os.path.join(self.original_path, "config.json") + copied_config = os.path.join(self.save_path, "config.json") + + with open(original_config, 'r', encoding='utf-8') as f: + original_content = json.load(f) + with open(copied_config, 'r', encoding='utf-8') as f: + copied_content = json.load(f) + + assert original_content == copied_content, "Config file content should be identical" + + # Verify content integrity for text files + original_readme = os.path.join(self.original_path, "README.txt") + copied_readme = os.path.join(self.save_path, "README.txt") + + with open(original_readme, 'r', encoding='utf-8') as f: + original_text = f.read() + with open(copied_readme, 'r', encoding='utf-8') as f: + copied_text = f.read() + + assert original_text == copied_text, "README file content should be identical" + + @pytest.mark.level0 + @pytest.mark.platform_x86_cpu + @pytest.mark.env_onecard + def test_copy_original_files_empty_directory(self): + """ + Feature: SafeTensorsMgr _copy_original_files method. + Description: Test behavior with empty source directory. + Expectation: No files are copied, no errors occur. + """ + # Create empty source directory + empty_source = os.path.join(self.work_dir, "empty_source") + os.makedirs(empty_source) + + # Create SafeTensorsMgr instance + mgr = SafeTensorsMgr(empty_source) + + # Call the private method + mgr._copy_original_files(empty_source, self.save_path) + + # Check that save directory is still empty (except for any pre-existing files) + copied_files = [f for f in os.listdir(self.save_path) if os.path.isfile(os.path.join(self.save_path, f))] + assert not copied_files, "No files should be copied from empty directory" + + @pytest.mark.level0 + @pytest.mark.platform_x86_cpu + @pytest.mark.env_onecard + def test_copy_original_files_subdirectories(self): + """ + Feature: SafeTensorsMgr _copy_original_files method. + Description: Test that subdirectories are not processed (only files in root). + Expectation: Only files in the root directory are considered. + """ + # Create subdirectory with files + subdir = os.path.join(self.original_path, "subdir") + os.makedirs(subdir) + + with open(os.path.join(subdir, "sub_config.json"), 'w', encoding='utf-8') as f: + json.dump({"sub": "config"}, f) + + # Create SafeTensorsMgr instance + mgr = SafeTensorsMgr(self.original_path) + + # Call the private method + mgr._copy_original_files(self.original_path, self.save_path) + + # Check that subdirectory file is not copied + sub_config_path = os.path.join(self.save_path, "sub_config.json") + assert not os.path.exists(sub_config_path), "Files in subdirectories should not be copied" + + # Check that subdirectory itself is not copied + subdir_path = os.path.join(self.save_path, "subdir") + assert not os.path.exists(subdir_path), "Subdirectories should not be copied" + + @pytest.mark.level0 + @pytest.mark.platform_x86_cpu + @pytest.mark.env_onecard + def test_copy_original_files_various_extensions(self): + """ + Feature: SafeTensorsMgr _copy_original_files method. + Description: Test copying files with various extensions. + Expectation: All non-blacklisted files are copied regardless of extension. + """ + # Create files with various extensions + test_files = { + "model.bin": b"binary model data", + "vocab.txt": "vocabulary content", + "special_tokens_map.json": '{"unk_token": "[UNK]"}', + "tokenizer_config.json": '{"do_lower_case": true}', + "generation_config.json": '{"max_length": 512}', + "config.yaml": "model_type: test\nhidden_size: 768", + "requirements.txt": "torch>=1.9.0\ntransformers>=4.0.0" + } + + for filename, content in test_files.items(): + file_path = os.path.join(self.original_path, filename) + mode = 'wb' if isinstance(content, bytes) else 'w' + with open(file_path, mode) as f: + f.write(content) + + # Create SafeTensorsMgr instance + mgr = SafeTensorsMgr(self.original_path) + + # Call the private method + mgr._copy_original_files(self.original_path, self.save_path) + + # Check that all test files are copied + for filename in test_files: + copied_file_path = os.path.join(self.save_path, filename) + assert os.path.exists(copied_file_path), f"File {filename} should be copied" diff --git a/tests/st/ptq/models/network/calibrate_deepseek3_671b.yaml b/tests/st/ptq/models/network/calibrate_deepseek3_671b.yaml index 90d951ef..11e39cda 100644 --- a/tests/st/ptq/models/network/calibrate_deepseek3_671b.yaml +++ b/tests/st/ptq/models/network/calibrate_deepseek3_671b.yaml @@ -1,6 +1,6 @@ seed: 0 output_dir: './output' # path to save checkpoint/strategy -load_checkpoint: '/home/workspace/mindspore_dataset/weight/DeepSeek-R1-bf16' +load_checkpoint: '' use_parallel: True run_mode: 'predict' use_legacy: False diff --git a/tests/st/ptq/models/network/calibrate_qwen3.yaml b/tests/st/ptq/models/network/calibrate_qwen3.yaml index 92236e08..7254cc43 100644 --- a/tests/st/ptq/models/network/calibrate_qwen3.yaml +++ b/tests/st/ptq/models/network/calibrate_qwen3.yaml @@ -1,6 +1,6 @@ seed: 0 output_dir: './output' # path to save checkpoint/strategy -load_checkpoint: '/home/workspace/mindspore_ckpt/safetensors/Qwen3-0.6B' +load_checkpoint: '' auto_trans_ckpt: True use_parallel: True run_mode: 'predict' diff --git a/tests/st/ptq/models/network/calibrate_qwen3_moe.yaml b/tests/st/ptq/models/network/calibrate_qwen3_moe.yaml index 0856472e..0ba45002 100644 --- a/tests/st/ptq/models/network/calibrate_qwen3_moe.yaml +++ b/tests/st/ptq/models/network/calibrate_qwen3_moe.yaml @@ -1,6 +1,6 @@ seed: 0 output_dir: './output' # path to save checkpoint/strategy -load_checkpoint: '/home/workspace/mindspore_ckpt/safetensors/Qwen3-30B-A3B' +load_checkpoint: '' auto_trans_ckpt: True use_parallel: True run_mode: 'predict' diff --git a/tests/st/ptq/models/network/calibrate_telechat2.yaml b/tests/st/ptq/models/network/calibrate_telechat2.yaml index 786a26fd..54efc7c4 100644 --- a/tests/st/ptq/models/network/calibrate_telechat2.yaml +++ b/tests/st/ptq/models/network/calibrate_telechat2.yaml @@ -1,6 +1,6 @@ seed: 0 output_dir: './output' # path to save checkpoint/strategy -load_checkpoint: '/home/workspace/mindspore_dataset/weight/telechat2_7b' +load_checkpoint: '' auto_trans_ckpt: True use_parallel: True run_mode: 'predict' -- Gitee