当前位置:网站首页>MindSpore:npu 多卡训练自定义数据集如何给不同npu传递不同数据
MindSpore:npu 多卡训练自定义数据集如何给不同npu传递不同数据
2022-07-30 19:04:00 【小乐快乐】
问题描述:
mindspore npu 多卡训练自定义数据集如何给不同npu传递不同数据?
是在ds.GeneratorDataset传递num_shards=num_shards, shard_id=device_id还是自定义数据集__getitem__里面用rank id取不同数据?
解决方案:
使用GeneratorDataset的时候,可以使用 num_shards=num_shards, shard_id=device_id 参数来控制不同卡读取哪个分片的数据,__getitem__ 和 __len__ 按全量数据集处理即可。
举例:
卡0:ds.GeneratorDataset(..., num_shards=8, shard_id=0, ...)
卡1:ds.GeneratorDataset(..., num_shards=8, shard_id=1, ...)
卡2:ds.GeneratorDataset(..., num_shards=8, shard_id=2, ...)
...
卡7:ds.GeneratorDataset(..., num_shards=8, shard_id=7, ...)
边栏推荐
- What is the value of biomedical papers? How to translate the papers into Chinese and English?
- Go 系统收集
- [Use of Qt Designer tool]
- 启动前台Activity
- 【剑指 Offe】剑指 Offer 18. 删除链表的节点
- natural language processing nltk
- LeetCode每日一题(1717. Maximum Score From Removing Substrings)
- 【Prometheus】Prometheus联邦的一次优化记录[续]
- [Summary] 1396- 60+ VSCode plugins to create a useful editor
- 2种手绘风格效果比较,你更喜欢哪一种呢?
猜你喜欢

卫星电话是直接与卫星通信还是通过地面站?

scrapy基本使用

OneFlow源码解析:Op、Kernel与解释器

NC | 西湖大学陶亮组-TMPRSS2“助攻”病毒感染并介导索氏梭菌出血毒素的宿主入侵...

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.解决方法

自然语言处理nltk

2种手绘风格效果比较,你更喜欢哪一种呢?

Meta元宇宙部门第二季度亏损28亿!仍要继续押注?元宇宙发展尚未看到出路!

荐号 | 对你有恩的人,不要请吃饭来报答

MongoDB打破了原则引入SQL?
随机推荐
【剑指 Offe】剑指 Offer 17. 打印从1到最大的n位数
浅聊对比学习(Contrastive Learning)第一弹
攻防世界web-Cat
高并发秒杀项目总结
CIMC Shilian Dafeitong is the global industrial artificial intelligence AI leader, the world's top AI core technology, high generalization, high robustness, sparse sample continuous learning, industri
JS提升:Promise中reject与then之间的关系
Golang logging library zerolog use record
Node encapsulates a console progress bar plugin
防抖和节流有什么区别,分别用于什么场景?
开心的聚餐
kotlin by lazy
VBA connects Access database and Excel
深入浅出边缘云 | 3. 资源配置
Talking about Contrastive Learning (Contrastive Learning) the first bullet
AWS console
Basic use of scrapy
SwiftUI iOS 精品开源项目之 完整烘焙食品菜谱App基于SQLite(教程含源码)
The Meta metaverse division lost 2.8 billion in the second quarter!Still want to keep betting?Metaverse development has yet to see a way out!
Chapter 14 Type Information
MySql中@符号的使用