()
| 82 | |
| 83 | |
| 84 | def build_config_json() -> str: |
| 85 | config_dict = { |
| 86 | "architectures": ["Qwen3MoeForCausalLM"], |
| 87 | "hidden_size": 7168, |
| 88 | "moe_intermediate_size": 1, |
| 89 | "moe_num_experts": 1, |
| 90 | "moe_k": 1, |
| 91 | "hidden_act": "silu", |
| 92 | "num_attention_heads": 64, |
| 93 | "dtype": "bfloat16", |
| 94 | } |
| 95 | |
| 96 | tmp_dir = f"./tmpefef{paddle.distributed.get_rank()}" |
| 97 | os.makedirs(tmp_dir, exist_ok=True) |
| 98 | with open(f"./{tmp_dir}/config.json", "w") as f: |
| 99 | json.dump(config_dict, f) |
| 100 | model_name_or_path = os.path.join(os.getcwd(), tmp_dir) |
| 101 | print("model_name_or_path", model_name_or_path) |
| 102 | return model_name_or_path |
| 103 | |
| 104 | |
| 105 | def get_fd_config(batch_size: int): |
no test coverage detected