()
| 104 | |
| 105 | |
| 106 | def build_config_json() -> str: |
| 107 | config_dict = { |
| 108 | "architectures": ["Qwen3MoeForCausalLM"], |
| 109 | "hidden_size": 7168, |
| 110 | "moe_intermediate_size": 1, |
| 111 | "moe_num_experts": 1, |
| 112 | "moe_k": 1, |
| 113 | "hidden_act": "silu", |
| 114 | "num_attention_heads": 64, |
| 115 | "dtype": "bfloat16", |
| 116 | } |
| 117 | |
| 118 | tmp_dir = f"./tmpefef{paddle.distributed.get_rank()}" |
| 119 | os.makedirs(tmp_dir, exist_ok=True) |
| 120 | with open(f"./{tmp_dir}/config.json", "w") as f: |
| 121 | json.dump(config_dict, f) |
| 122 | model_name_or_path = os.path.join(os.getcwd(), tmp_dir) |
| 123 | print("model_name_or_path", model_name_or_path) |
| 124 | return model_name_or_path |
| 125 | |
| 126 | |
| 127 | def get_fd_config(batch_size: int): |
no test coverage detected