Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

How to add paddle dist train test case

Darcy edited this page Jun 5, 2018 · 2 revisions

测试执行过程

  1. 从CE的paddle build结果中创建paddle docker image
  2. 以paddle docker image作为base image来创建测试docker image并push到docker hub
  3. checkout aws_runner
  4. 根据测试要求的spec(trainer数量, pserver数量, etc)来创建ec2 instances
  5. 在ec2 instances上收集测试需要参数, 如pserver ip, 配合测试需要的参数, 如model, batch size, pass num, 启动测试的docker image
  6. 测试完成后关掉ec2 instances
  7. 收集和归纳测试数据

测试编写流程

以vgg16_aws_dist为例, 上述步骤的1~3步在run.xsh中处理, 然后转入ce_runner.py来调用aws_runner中的client.abclient来具体执行创建instance,在instance运行docker image的动作

python ce_runner.py \
    --key_name aws_benchmark_us_east \
    --security_group_id sg-95539dff \
    --online_mode yes \
    --pserver_command $training_command \
    --trainer_command $training_command \
    --docker_image $fluid_benchmark_dockerhub_tag

请注意,请勿更改此处key_name, security_group_id 和 online_mode 的值

ce_runner.py中创建log_processor用于收集测试过程中的数据作为metric data来提供给CE做进一步分析. 目前在此例子中log_processor是被封装在DataCollector类中, 为了方便处理.

如何添加新的分布式测试

仿照vgg16_aws_dist, 目前此目录下的fluid_benchmark_for_aws已经包含了machine_translation, mnist, resnet, stacked_dynamic_lstm, vgg, 在continuous_evaluation.py里面, 添加或更新cluster_specs里面配置, 数组内每一个元素按顺序分别代表: test_name, batch_size, trainer_count, gpus_per_trainer_count, pserver_count. 所以如果要添加一个batch_size 64, 8 trainer, 每个trainer 2 GPU, 4 pserver, 的mnist测试就可以添加如下元素

["mnist", 64, 8, 2, 4]

如果要目前fluid_benchmark_for_aws不存在的model, 请仿照fluid_benchmark_for_aws/models下面的model文件来创建新的model.

Clone this wiki locally