当前位置:网站首页>Mindspore 1.5rcGraph Mode训练速度慢,这是为什么?
Mindspore 1.5rcGraph Mode训练速度慢,这是为什么?
2022-06-10 04:30:00 【MSofficial】
问题描述:
【背景信息】
整个Model是一个文字识别任务,包含CNN,Transformer,Loss只有一个CrossEntropy的分类loss。
【问题描述】
整个代码已经在PyNative模式下顺利运行,并且训练到了很高的性能。
训练输入是batchsize=64的160x48的图片。输出类别数为7000左右。
单卡单机,PyNative下训练,每个Batch平均需要3秒左右
现在拿在PyNative模式下训练好的Model,load进来以后切换成GRAPH Mode继续finetune,发现精度几乎一致,没有下降,但是速度慢了一大截!比PyNative模式,每个batch慢了10倍左右的时间!
解答:
应该是图重复编译了,dict,list,tuple都不要作为根图的入参,因为graph是有编译缓存的,tensor作为入参时,是把shape和type看做是key的,其他类型都是要看object的属性和value的,如果传入一个dict可能导致某些value一直在变,导致图缓存不下来,每个step都在编译图,时间会大大增加。
边栏推荐
- Pysimplegui classic practice: how to read this Chinese character?
- [Error] anonymous type with no linkage used to declare function ‘bool InitSLinkList
- Two modes of epoll and epoll reactor
- [深入研究4G/5G/6G专题-24]: 5G NR开机流程4.2 - 随机接入应答消息MSG2的调度过程与上行同步、时间提前量TA通过PDSCH信道下发
- How to write Scala code in idea
- Jenkinsclient | easy to use Jenkins client
- CVPR 2022 | indirect lighting modeling in inverse rendering
- Mysql database (25): foreing key
- Execution strategy of application software efficiency test
- 常见的数据库-字段类型映射关系
猜你喜欢
Webcodecs解析GIF图

What are the advantages of multi merchant mall applet source code?

Unity光照黑莫名其妙的偏色问题

golang学习之六:中的文件操作

These programming languages are old and almost dead. Young people can't touch them

多商户商城小程序源码有何优势?

Crack the five myths of programmers, and new programmer 004 is officially launched!

5分钟学会本地Pypi源搭建

这些编程语言老了,差不多死透了,年轻人不能碰

Celery | task queue artifact
随机推荐
Cross in tensorflow_ entropy
Webcodecs parsing GIF graph
idea中怎样编写Scala代码
电阻电容封装选型经验详解
Celery | 任务队列神器
[深入研究4G/5G/6G专题-25]: 5G NR开机流程4.3 - RRC连接请求消息MSG3/RRCSetupRequest与PUSCH上行信道首次调度
[机缘参悟-20]:鬼谷子-反应篇-动静之术、说听结合、沉默是金
Ammonium tech, a well-known network security hardware platform manufacturer, joined dragon lizard community
[in depth study of 4g/5g/6g topic -24]: 5g NR startup process 4.2 - scheduling process and uplink synchronization of random access response message msg2, and time advance TA are sent through PDSCH cha
Meanings of letters in PMP project management calculation PV, EV, AC, SV, CV, SPI, CPI
Exemple de démarrage JDBC
[Android L]SEAndroid增强Androd安全性背景概要及带来的影响
[in depth study of 4g/5g/6g topic -27]: 5g NR startup process 4.5 - RRC connection response message msg4, first scheduling of PUCCH uplink control channel, UCI and HARQ response
Zero basic network: command line (CLI) debugging firewall practice
The relationship between libc, glibc and glib
Descriptor ready condition
JDBC 入门示例
23 very useful shell scripts
[chance enlightenment -21]: Rethink technology, management, working, entrepreneurship and investment from the perspective of system architecture
90. 闭锁