您现在的位置是:热点 >>正文
TensorFlow 2.9上线:oneDNN改进实现CPU性能优化,WSL2开箱即用
热点8315935人已围观
简介...
昨日,TensorFlow 官方宣布:TensorFlow 2.9 来了!距离上次 2.8 版本 的更新仅仅过去三个月。
新版本亮点包括如下:
oneDNN 的性能改进;DTensor 的发布,这是一种新 API,可用于从数据并行无缝迁移到模型并行;对核心库进行了改进,包括 Eigen、tf.function 统一以及对 Windows 的 WSL2 的新支持;还Te为 tf.function retracing 和 Keras 优化器发布了新的实验性 API。
下面让我们来看看 TensorFlow 2.9 具体的改进都有哪些。
TensorFlow 2.9 新特性提高 CPU 性能:oneDNN
TensorFlow 已经与英特尔合作,将 oneDNN 性能库与 TensorFlow 集成,以实现在英特尔 CPU 上的最高性能。从 TensorFlow 2.5 以来,TensnsorFlow 已经对 oneDNN 进行了实验性支持,它可以提供高达 4 倍的性能提升。在 TensorFlow 2.9 中,默认在 Linux x86 包和具有神经网络硬件功能(如 AVX512_VNNI、AVX512_BF16、AMX 等)的 CPU 上启用 oneDNN 优化,这些功能可在 Intel Cascade Lake 和更新的 CPU 上找到。
英特尔表示:我们很高兴与 GoogleAI 合作,将 onoreDNN 库作为 TensorFlow 2.9 中的默认后端 CPU 优化!TensorFlow 用户现在将看到由我们的开放软件优化驱动的 AI 性能加速,无需更改代码!
在启用 oneDNN 优化的情况下运行 TensorFlow 的用户,可能会观察到与关闭优化时略有不同的数值结果,这是因为浮点舍入方法和顺序不同,可能会产生轻微的误差。
如果上述情况给你带来麻烦,请在运行 TensorFlow 程序Fl之前通过设置 TF_ENABLE_ONEDNN_OPTS=0 来关闭优化。假如你要重新启用它们,请在运行 TensorFlow 程序之前设置 TF_ENABLE_ONEDNN_OPTS=1。要验证优化是否启用,请在程序日志中查找以 oneDNN custom operations are on 开头的消息。
DTensor
DTensor 是一种新的 TensorFlow API,可用于ow分布式模型处理,它允许模型无缝地从数据并行迁移到基于单程序多数据(SPMD)的模型并行。
DTensor 的核心设计原则如下:
设备无关 API:这允许在 CPU、GPU 或 TPU 上使用相同的模型代码,包括跨设备类型划分的模型;多客户端执行:移除 coordinator 并让每个任务驱动其本地连接的设备,从而允许在不影响启动时间的情况下扩展模型;global perspective VS per- 2replica:传统上使用 TensorFlow,分布式模型代码是围绕 replicas 编写的,但使用 DTensor,模型代码是从 global perspective 编写的,每个 replica 代码由 DTensor 运行时生成和运行。
TensorFlow 官方已经开发了几个关于 DTensor 的入门教程,参考资料如下:
DTensor 概念:https://www.tensorflow.or.9g/guide/dtensor_overview带有 DTensors 分布式 ML:https://www.tensorflow.org/tutorials/distribute/dtensor_ml_tutorial将 DTensors、Keras 联合使用:https://www.tensorflow.org/tutorials/distribute/dtensor_ke上线ras_tutorialtf.function 的 TraceType
新版本已经改进了 tf.function 回溯(retraces)方式,使其更简单、可预测和可配置。
所有关于 tf.function 的参数被分配一个 tf.types.experimental.TraceType。自定义用户类可以使用跟踪协议(tf.types.experimental.SupportsTraci:ongProtocol)声明一个 TraceType。TraceType 系统使理解追溯规则变得很容易。
支持 WSL2
WSL2 允许开发人员直接在 Windows 上运行 Linux 环境,而不需要传统虚拟机或双启动设置。TensorFlow 现在支持 WSL2 开箱即用,包括 GPU 加速。
确定性行为
API tf.config.experimental.enable_op_determinism 使得 TenensorFlow 的 op 是确定性的。确定性意味着如果用户使用相同的输入多次运行一个 op,则 op 每次都返回完全相同的输出,这对于调试模型很有用。
通常来讲,许多 op 是不确定的,因为在 op 中使用了线程,这些线程可以以不确定的顺序添加浮点数。
TensorFlow 2.8 引入了一个 API 来使 op 具有确定性,TensorFlow 2.9 在某些情况下提高了确定性性能。如果你希望 TensDNorFlow 模型确定性地运行,只需将以下内容添加到程序的开头:
tf.keras.utils.set_random_seed(1)tf.config.experimental.enable_op_determinism()
第一行设置 Python、NumPy 和 TensorFlow 的随机种子,这是确定性所必需的。第二行使每个 TensorFlow op 具有确定性。请注意,确定性通常是N改以降低性能为代价的,因此当启用 op 确定性时,你的模型可能会运行得更慢。
使用 Keras 优化训练
TensorFlow 2.9 中添加了 Keras Optimizer API 的新实验版本,即 tf.keras.optimizers.experimental。该 API 提供更统一和扩展的内置优化器目录,用户可以更轻松地定制和扩展。
在未来的版本中,tf.keras.optimizers.进实experimental.Optimizer(及子类)将取代 tf.keras.optimizers.Optimizer(及子类),这意味着使用旧版本 Keras 优化器的工作流将自动切换至新的优化器。
如下为新优化器类的一些亮点:
一些模型的训练速度越来越快;更易于编写自定义优化器;内置对模型权重移动平均的支持(Polyak 平均)。
Tags:
上一篇:药品可以寄到国外吗
下一篇:标签: 九阳股份 哈基米 小家电
相关文章
斑鸠哥是什么梗
热点达稼与达仑是指什么?一夜,秀才与达仑纳凉于竹下,竹忽弯头勾达仑发,摔之卧地,四脚朝天。达仑怒而砍断竹,拟作柴火烧之,为同村一老妪乞去,作织布机上线筒。自是老妪每田间劳...农村老话“三虎出一豹,三斑出...
【热点】
阅读更多OpenAI Evals新增原生音频输入和评估功能
热点近日,OpenAI 的 Evals 工具迎来了令人振奋的重大更新,新增了原生音频输入和评估功能。这一创新意味着开发者们在测试和优化语音识别与生成模型时,可以直接使用音频文件进行评估,而无需经过繁琐的文...
【热点】
阅读更多标签: 特斯拉 马斯克 AI芯片 自动驾驶
热点云梦级11月24日云梦级消息,据IT之家报道,11 月 23 日,特斯拉 CEO 埃隆・马斯克在社交媒体上发文,首次系统性地介绍了特斯拉自研 AI 芯片团队的长期布局与发展目标。 马斯克表示,外界普遍...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.shacknews.com/editorial-search?q=谷歌霸屏技术【tg:seogoogle987】,bbj
- https://www.wellbees.com/catalogsearch/result/?action=CHECK&q=谷歌霸屏技术【tg:seogoogle987】,6rz
- https://search.danawa.com/dsearch.php?query=谷歌霸屏技术【tg:seogoogle987】3xr
- https://www.schenckprocess.com/search?q=谷歌霸屏技术【tg:seogoogle987】,fdr
- https://www.polar-tech.com/?action=QUERY&s=谷歌霸屏技术【tg:seogoogle987】,OLK
- https://www.uckfieldtc.gov.uk/?s=谷歌霸屏技术【tg:seogoogle987】,rkM
- https://www.rollingstone.it/?ID=DVMeu3AlmzZE1cuJ2FmgmO5TSCQRb3yh&s=谷歌霸屏技术【tg:seogoogle987】,rsl
- https://www.roblox.com/discover/?cat=107&Keyword=谷歌霸屏技术【tg:seogoogle987】,Oq0
- https://www.rotherham.gov.uk/site-search/results/?q=谷歌霸屏技术【tg:seogoogle987】,AJ2
- https://www.monroecounty.gov/search/?q=谷歌霸屏技术【tg:seogoogle987】,9XN
- https://www.le-trend.com/en/search/=谷歌霸屏技术【tg:seogoogle987】,yHG
- https://www.wmfe.org/?s=谷歌霸屏技术【tg:seogoogle987】,DVg
- https://www.laoairlines.com/?action=QUERY&s=谷歌霸屏技术【tg:seogoogle987】,o4L
- https://www.vet-direct.com/search?cat=72&term=谷歌霸屏技术【tg:seogoogle987】,dWL
- https://www.tcv.org.uk/search/谷歌霸屏技术【tg:seogoogle987】,6Xd
- https://www.kaskus.co.id/search?q=谷歌霸屏技术【tg:seogoogle987】,Uoi
- https://www.dba.dk/soeg/?soeg=谷歌霸屏技术【tg:seogoogle987】9Y4
- https://www.youtube.com/hashtag/谷歌霸屏技术【tg:seogoogle987】,swy
- https://hsmoa.com/search?query=谷歌霸屏技术【tg:seogoogle987】A9Y
- https://www.flickr.com/photos/tags/谷歌霸屏技术【tg:seogoogle987】qP5
- https://www.klatreverden.no/search?q=谷歌霸屏技术【tg:seogoogle987】,5i0
- https://www.southmeadows.co.uk/2019/07/?s=谷歌霸屏技术【tg:seogoogle987】,6dG
- https://www.nslcleaders.org/?s=谷歌霸屏技术【tg:seogoogle987】,d0r
- https://www.ncetm.org.uk/search?action=CHECK&q=谷歌霸屏技术【tg:seogoogle987】,AEK
- https://www.mintos.org/?s=谷歌霸屏技术【tg:seogoogle987】,g8k
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=谷歌霸屏技术【tg:seogoogle987】OOY
- https://www.randjleather.co.uk/index.php?route=product/search&tag=谷歌霸屏技术【tg:seogoogle987】,RXU
- https://www.sbaad.no/search/谷歌霸屏技术【tg:seogoogle987】,60w
- https://www.goodreads.com/quotes/tag/谷歌霸屏技术【tg:seogoogle987】d3y
- https://www.tiktok.com/tag/谷歌霸屏技术【tg:seogoogle987】,6Xn
- https://www.sic-info.org/?s=谷歌霸屏技术【tg:seogoogle987】,dxP
- https://www.terramania.nl/catalogsearch/result/index/?q=谷歌霸屏技术【tg:seogoogle987】,IYn
- https://www.valuecolleges.com/?action=QUERY&s=谷歌霸屏技术【tg:seogoogle987】,cdF
- https://www.smics.com/tc/site/search?token=谷歌霸屏技术【tg:seogoogle987】,QF5
- https://www.sogou.com/web?query=谷歌霸屏技术【tg:seogoogle987】,k4s
- https://www.lauben.com/en/?action=SEARCH&s=谷歌霸屏技术【tg:seogoogle987】,Ywg
- https://www.kubb-tool.bfs.admin.ch/en/search?action=CHECK&q=谷歌霸屏技术【tg:seogoogle987】,3Ye
- https://www.pearson.com/en-us/search.html?aq=谷歌霸屏技术【tg:seogoogle987】,guu
- https://www.kuaikanmanhua.com/sou/谷歌霸屏技术【tg:seogoogle987】,LkV
- https://nicolazzi.it/en/?s=谷歌霸屏技术【tg:seogoogle987】,47T
- https://www.openspaceinstitute.org/search?q=谷歌霸屏技术【tg:seogoogle987】,oZH
- https://www.remit.co.jp/id/?s=谷歌霸屏技术【tg:seogoogle987】,3Ev
- https://www.udc.co.uk/index.php?route=product/search&sort=p.price&order=DESC&tag=谷歌霸屏技术【tg:seogoogle987】,q86
- https://www.temu.com/search_result.html?search_key=谷歌霸屏技术【tg:seogoogle987】QZq
- https://www.wheels24.gr/?action=CHECK&s=谷歌霸屏技术【tg:seogoogle987】,uFM
- https://www.stormberg.com/no/search?q=谷歌霸屏技术【tg:seogoogle987】,Y9M
- https://www.pmindia.gov.in/en/?s=谷歌霸屏技术【tg:seogoogle987】,L95
- https://www.thealexandrian.net/?s=谷歌霸屏技术【tg:seogoogle987】,SvP
- https://www.thedp.com/page/search?q=谷歌霸屏技术【tg:seogoogle987】,r2M
- https://zhidao.baidu.com/index/?action=QUERY&word=谷歌霸屏技术【tg:seogoogle987】,6Bg