-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run_summarization.py
isn't computing on GPU (but allocate memory)
#18
Comments
@pltrdy, try to change the follow line |
Thx @pedrobalage, I actually removed this block. I don't really understand why the device is hardcoded. Shouldn't it be left "default" (and then user can (un/)set |
@pltrdy, I didn't understand this decision too. This was the only way it worked for me. I also setup the CUDA_VISIBLE_DEVICE. |
@pedrobalage thanks for sharing it, I didn't even noticed this line. @abisee I forked, switched to python3 syntax & removed this line. My python 3 implementation wont be compatible because of |
thanks for pointing this out @pltrdy removing that line allows the code to run on the gpu and it's going 20x faster. so you pretty much made my life go by 20 times faster 👍 |
Another related discussion can be found in #3 |
@ioana-blue In fact I just complained then @pedrobalage helped us ;) @tianjianjiang thx for referencing it. Interesting to notice that it's the same GPU. Can't figure out how this may work on K40 (used by the author) and not on 1080 since there is enough RAM. Maybe CUDA/TF version have some effect here. No idea. |
@pltrdy You're welcome and I can also confirm that changing it from CPU to GPU can be worse on K80 and GT 650M. |
BTW, there's a recent post about this topic https://datascience.stackexchange.com/questions/19220/choosing-between-cpu-and-gpu-for-training-a-neural-network |
Hi everyone, I'm afraid this will be a rather unsatisfactory answer, but the reason that we set default device to CPU is that our code is derived from the TextSum code, which does the same thing (see this line). Similarly, we have a few
lines in Personally I'm not sure what is the rationale for doing this (I think I tried removing these lines and didn't see a difference). But that's the code we ran for our experiments so we left it like that for reproducibility, in case it matters. Edit: When we ran on our K40, the GPU-Util was non-zero so the GPU was being used. |
I'm new to everything related to this work, but learning. From what I read in the docs and looking at the code, this is my understanding. https://www.tensorflow.org/tutorials/using_gpu explains that That's why you can see various behavior depending on where you run the code, what's running concurrently, etc. Hope this explains some of the mystery. |
I'm not entirely sure if I was able to make it to run on GPU. @ioana-blue @abisee @pltrdy @pedrobalage @tianjianjiang How long is a training step taking you approximately? For me every training step is about 1.5 seconds, is that the speed you're getting on GPU or the CPU? |
@Spandan-Madan I'm around 1.8sec/step, default parameters, nvidia 1080. |
It's better to switch to GPU, since the default setting would make the training extremely slow. |
Hello again, Though I'm sure I tried changing |
Strange fact. I've been trying to train summarization with default parameters and default dataset.
It turns out that the GPU is detected (
2017-06-01 17:57:05.548650: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0)
), some GPU memory is alocated for the process, but nothing is running on it (load: 0%). It sometimes peak at around 27% for very short time.The GPU is a single 1080 with 8G RAM (4617MiB allocated by the process)
Any idea?
The text was updated successfully, but these errors were encountered: