I'm attempting to run a very large model that does not fit into GPU memory. One very memory intensive part of this model is computing the softmax for each time step in a sequence. I've moved this computation to the CPU, however it seems that the backprop for this part of the graph is still on the GPU. Is there a way to force part of the backprop graph onto the CPU as well?
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/a3a6ddc3-6092-4c6a-b9f1-5e5b627585b9%40tensorflow.org.
optimizer_op = optimizer.minimize(loss)with tf.device('/cpu:0'):
grads = optimizer.compute_gradients(loss, intermediate_vars)
grads += optimizer.compute_gradients(intermediate_vars, remaining_vars)
optimize_op = optimizer.apply_gradients(grads)if you call `tf.gradients` inside `with tf.device("/cpu:0")` block, it should get placed on CPU
On Tue, Dec 27, 2016 at 5:51 PM, <vic...@victorzhong.com> wrote:
I'm attempting to run a very large model that does not fit into GPU memory. One very memory intensive part of this model is computing the softmax for each time step in a sequence. I've moved this computation to the CPU, however it seems that the backprop for this part of the graph is still on the GPU. Is there a way to force part of the backprop graph onto the CPU as well?
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/81a85028-b495-4c5d-887f-0810e3408e8a%40tensorflow.org.
optimizer.minimize(loss, colocate_gradients_with_ops=True)To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/81a85028-b495-4c5d-887f-0810e3408e8a%40tensorflow.org.