gpt4 book ai didi

Tensorflow tf.data 自动调谐

转载 作者:行者123 更新时间:2023-12-04 11:06:51 27 4
gpt4 key购买 nike

我正在阅读数据加载部分的 TF 性能指南。对于预取它说,

The tf.data API provides a software pipelining mechanism through the tf.data.Dataset.prefetch transformation, which can be used to decouple the time when data is produced from the time when data is consumed. In particular, the transformation uses a background thread and an internal buffer to prefetch elements from the input dataset ahead of the time they are requested. The number of elements to prefetch should be equal to (or possibly greater than) the number of batches consumed by a single training step. You could either manually tune this value, or set it to tf.data.experimental.AUTOTUNE which will prompt the tf.data runtime to tune the value dynamically at runtime.



AUTOTUNE 内部在做什么?正在应用哪种算法,启发式?

另外,在实践中,进行了什么样的手动调整?

最佳答案

tf.data构建输入管道的性能模型并运行优化算法以在指定为 AUTOTUNE 的所有参数之间找到其 CPU 预算的良好分配。 .当输入管道运行时,tf.data跟踪每个操作所花费的时间,以便将这些时间输入到优化算法中。
OptimizationOptions object 可以对自动调谐的行为方式进行一些控制。

关于Tensorflow tf.data 自动调谐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56613155/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com