DeepPavlov
DeepPavlov copied to clipboard
Performance issue in /deeppavlov/core/common (by P3)
Hello! I've found a performance issue in /deeppavlov/core/common/check_gpu.py: with tf.Session(config=sess_config)
(here) is defined in the function check_gpu_existence
(here) which is called in the function cudnn_gru_wrapper
(here) which is called in the function cudnn_bi_gru
(here) which is repeatedly called in the loop for n in range(n_stacks)
(here).
tf.Session
being defined repeatedly could lead to incremental overhead. If you define tf.Session
out of the loop and pass tf.Session
as a parameter to the loop, your program would be much more efficient. Here is the Stack Overflow post to support it.
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
Hello, I'm looking forward to your reply~
Hey @DLPerf sorry for the late response. Unfortunately, deprecated tf 1.x models have very limited support nowadays. I suggest you to describe what are developing exactly, maybe we can find a modern replacement in our DeepPavlov.
Hello! I've found a performance issue in /deeppavlov/core/common/check_gpu.py:
with tf.Session(config=sess_config)
(here) is defined in the functioncheck_gpu_existence
(here) which is called in the functioncudnn_gru_wrapper
(here) which is called in the functioncudnn_bi_gru
(here) which is repeatedly called in the loopfor n in range(n_stacks)
(here).
tf.Session
being defined repeatedly could lead to incremental overhead. If you definetf.Session
out of the loop and passtf.Session
as a parameter to the loop, your program would be much more efficient. Here is the Stack Overflow post to support it.Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
Hey, I think the tf.Session is not called every single time, the if condition if _gpu_available is None:
here helps in this.
global _gpu_available
is used to keep track of any previous results of existence of gpu.
Correct me if I am wrong. Thank you
Hello, @DLPerf! We are now using PyTorch instead of TensorFlow, so there should be no problem with this now. If you are still having difficulties with our library, please let us know.