Skip to content

Commit 7bab4bb

Browse files
authored
[Misc] Add Qwen2MoeForCausalLM moe tuning support (#14276)
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
1 parent e17e448 commit 7bab4bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

benchmarks/kernels/benchmark_moe.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,11 @@ def main(args: argparse.Namespace):
509509
intermediate_size = config.moe_intermediate_size
510510
shard_intermediate_size = 2 * intermediate_size // args.tp_size
511511
block_quant_shape = config.quantization_config['weight_block_size']
512+
elif config.architectures[0] == "Qwen2MoeForCausalLM":
513+
E = config.num_experts
514+
topk = config.num_experts_per_tok
515+
intermediate_size = config.moe_intermediate_size
516+
shard_intermediate_size = 2 * intermediate_size // args.tp_size
512517
else:
513518
# Default: Mixtral.
514519
E = config.num_local_experts

0 commit comments

Comments
 (0)