<small id='ZU7i1'></small><noframes id='ZU7i1'>

    • <bdo id='ZU7i1'></bdo><ul id='ZU7i1'></ul>
    <legend id='ZU7i1'><style id='ZU7i1'><dir id='ZU7i1'><q id='ZU7i1'></q></dir></style></legend>

      <i id='ZU7i1'><tr id='ZU7i1'><dt id='ZU7i1'><q id='ZU7i1'><span id='ZU7i1'><b id='ZU7i1'><form id='ZU7i1'><ins id='ZU7i1'></ins><ul id='ZU7i1'></ul><sub id='ZU7i1'></sub></form><legend id='ZU7i1'></legend><bdo id='ZU7i1'><pre id='ZU7i1'><center id='ZU7i1'></center></pre></bdo></b><th id='ZU7i1'></th></span></q></dt></tr></i><div id='ZU7i1'><tfoot id='ZU7i1'></tfoot><dl id='ZU7i1'><fieldset id='ZU7i1'></fieldset></dl></div>
      1. <tfoot id='ZU7i1'></tfoot>

        使用 tensorflow 数据集的 GPU 利用率低下

        GPU under utilization using tensorflow dataset(使用 tensorflow 数据集的 GPU 利用率低下)

          <tbody id='BBHyS'></tbody>
          <tfoot id='BBHyS'></tfoot>

          <i id='BBHyS'><tr id='BBHyS'><dt id='BBHyS'><q id='BBHyS'><span id='BBHyS'><b id='BBHyS'><form id='BBHyS'><ins id='BBHyS'></ins><ul id='BBHyS'></ul><sub id='BBHyS'></sub></form><legend id='BBHyS'></legend><bdo id='BBHyS'><pre id='BBHyS'><center id='BBHyS'></center></pre></bdo></b><th id='BBHyS'></th></span></q></dt></tr></i><div id='BBHyS'><tfoot id='BBHyS'></tfoot><dl id='BBHyS'><fieldset id='BBHyS'></fieldset></dl></div>
              <bdo id='BBHyS'></bdo><ul id='BBHyS'></ul>
              • <legend id='BBHyS'><style id='BBHyS'><dir id='BBHyS'><q id='BBHyS'></q></dir></style></legend>

                <small id='BBHyS'></small><noframes id='BBHyS'>

                  本文介绍了使用 tensorflow 数据集的 GPU 利用率低下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的数据训练期间,我的 GPU 利用率约为 40%,我清楚地看到有一个基于 tensorflow 分析器的数据复制操作占用了大量时间(见附图).我认为MEMCPYHtoD"选项正在将批处理从 CPU 复制到 GPU,并阻止使用 GPU.无论如何将数据预取到GPU?还是有其他我没有看到的问题?

                  During training of my data, my GPU utilization is around 40%, and I clearly see that there is a datacopy operation that's using a lot of time, based on tensorflow profiler(see attached picture). I presume that "MEMCPYHtoD" option is copying the batch from CPU to GPU, and is blocking the GPU from being used. Is there anyway to prefetch data to GPU? or is there other problems that I am not seeing?

                  这里是数据集的代码:

                  X_placeholder = tf.placeholder(tf.float32, data.train.X.shape)
                  y_placeholder = tf.placeholder(tf.float32, data.train.y[label].shape)
                  
                  dataset = tf.data.Dataset.from_tensor_slices({"X": X_placeholder, 
                                                                "y": y_placeholder})
                  dataset = dataset.repeat(1000)
                  dataset = dataset.batch(1000)
                  dataset = dataset.prefetch(2)
                  iterator = dataset.make_initializable_iterator()
                  next_element = iterator.get_next()
                  

                  推荐答案

                  预取到单个 GPU:

                  • 考虑使用比 prefetch_to_device 更灵活的方法,例如通过使用 tf.data.experimental.copy_to_device(...) 显式复制到 GPU,然后进行预取.这允许避免 prefetch_to_device 必须是管道中的最后一个转换的限制,并允许结合进一步的技巧来优化 Dataset 管道性能(例如 通过覆盖线程池分布).
                  • 试用实验性的 tf.contrib.data.AUTOTUNE 选项进行预取,它允许 tf.data 运行时根据您的系统自动调整预取缓冲区大小和环境.
                  • Consider using a more flexible approach than prefetch_to_device, e.g. by explicitly copying to the GPU with tf.data.experimental.copy_to_device(...) and then prefetching. This allows to avoid the restriction that prefetch_to_device must be the last transformation in a pipeline, and allow to incorporate further tricks to optimize the Dataset pipeline performance (e.g. by overriding threadpool distribution).
                  • Try out the experimental tf.contrib.data.AUTOTUNE option for prefetching, which allows the tf.data runtime to automatically tune the prefetch buffer sizes based on your system and environment.

                  最后,你可能会做这样的事情:

                  At the end, you might end up doing something like this:

                  dataset = dataset.apply(tf.data.experimental.copy_to_device("/gpu:0"))
                  dataset = dataset.prefetch(tf.contrib.data.AUTOTUNE)
                  

                  这篇关于使用 tensorflow 数据集的 GPU 利用率低下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                    <tbody id='tKqbY'></tbody>

                  <i id='tKqbY'><tr id='tKqbY'><dt id='tKqbY'><q id='tKqbY'><span id='tKqbY'><b id='tKqbY'><form id='tKqbY'><ins id='tKqbY'></ins><ul id='tKqbY'></ul><sub id='tKqbY'></sub></form><legend id='tKqbY'></legend><bdo id='tKqbY'><pre id='tKqbY'><center id='tKqbY'></center></pre></bdo></b><th id='tKqbY'></th></span></q></dt></tr></i><div id='tKqbY'><tfoot id='tKqbY'></tfoot><dl id='tKqbY'><fieldset id='tKqbY'></fieldset></dl></div>
                  <tfoot id='tKqbY'></tfoot>

                  <legend id='tKqbY'><style id='tKqbY'><dir id='tKqbY'><q id='tKqbY'></q></dir></style></legend>
                    <bdo id='tKqbY'></bdo><ul id='tKqbY'></ul>

                          1. <small id='tKqbY'></small><noframes id='tKqbY'>