Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DS2 run on Kubernates clusters #2381

Closed
4 of 6 tasks
wanghaoshuang opened this issue Jun 5, 2017 · 1 comment
Closed
4 of 6 tasks

Make DS2 run on Kubernates clusters #2381

wanghaoshuang opened this issue Jun 5, 2017 · 1 comment

Comments

@wanghaoshuang
Copy link
Contributor

wanghaoshuang commented Jun 5, 2017

  • 重新组织语音数据,将小文件打包合并为大文件,以适应paddle cloud
  • cloud的文件系统和分布式环境数据分发;数据上传到paddle cloud data center。
  • 改写data reader,使其能在Kubernates cluster环境work
  • 按paddle cloud教程编写提交任务脚本
  • 测试
  • 统一单机与分布式数据接口

design doc

数据

http://www.openslr.org/resources/12/about.html

单机数据存储方式与reader

存储方式

audio data: one audio clip is saved as a file
manifest: Manifest is a json file with each line containing one audio clip filepath,
its transcription text string, and its duration.

reader

steps:

  1. sample 200 lines from manifest to count mean and std for normolization
  2. shuffle manifest or sort manifest
  3. for line in manifest:extract and normalize features from audio clip file
  4. yield audio features and transcription text by batch which may be padded

为什么不适用于paddlecloud

paddle cloud特点:

  1. 数据需要通过数据中转机上传 tutorial
  2. 数据存放在hdfs,每个节点通过挂载路径读取hdfs上的数据 tutorial
  3. 可自定义数据分发逻辑 tutorial

为什么单机方案不能直接用于paddle cloud:

  1. 无法直接使用librispeech.py下载数据到paddle cloud
  2. 音频数据以小文件存储,不适用于paddle cloud的文件系统
  3. 所有数据信息集中在一个manifest文件中,不利于多节点分发数据
    • 通过自定义分发逻辑可以把manifest拆成多个文件,分发到各个节点。但是,这样每个节点还是要从hdfs上一个个读小文件

改写方案

存储

  1. 把数据提前处理好,放到paddle cloud data center公有路径下
  2. 将音频文件打包成大文件存储:
    图片
    图1
  3. 按batch_file 分发数据:
    图片
    图2

reader

图3
图3

  1. 如果单节点可以完全load数据到内存:
    • 提取特征步骤的结果是否可以缓存在内存,避免每个pass重复提取特征?
  2. 如果单节点无法完全load数据到内存:
    • 提取特征后的结果是否可以存到文件系统,避免每个pass重复提取特征 ?
  3. 如果 图3 中buffer的size设置为无穷大,相当于对一个节点(worker)的数据做全局sort或shuffle

如何优雅统一单机与分布式数据接口?

  • 把小音频文件打成tar包,并维护以下结构:
    • list: [(filename, duration)] :快速全局sort by duration或shuffle
    • dict: filename->(tarfile object , tarinfo) : 快速索引数据
@wanghaoshuang wanghaoshuang changed the title Make it run on Kubernates clusters, add details to README.txt. Make DS2 run on Kubernates clusters, add details to README.txt. Jun 5, 2017
@wanghaoshuang wanghaoshuang self-assigned this Jun 7, 2017
@wanghaoshuang wanghaoshuang changed the title Make DS2 run on Kubernates clusters, add details to README.txt. Make DS2 run on Kubernates clusters Jun 7, 2017
@typhoonzero
Copy link
Contributor

Seems we have already finished this, closing. If you have any questions @wanghaoshuang, we can open up some new issue for discussion.

heavengate pushed a commit to heavengate/Paddle that referenced this issue Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants