localminimum / QANet

A Tensorflow implementation of QANet for machine reading comprehension
MIT License
983 stars 310 forks source link

Speed ? #25

Closed chenghuige closed 6 years ago

chenghuige commented 6 years ago

For num_heads 1, hidden size 96, seems not faster then HKUST rnet ? With batch size 64 , 1.42 batch/s while HKUST RNET with 2.4+ batch/s Though HKUST RNET default use char dim only 8 , here we use 64 but still I think QANet not as fast as which google show in the paper ?

localminimum commented 6 years ago

Hi @chenghuige , thanks for your issue. There are a few points we need to clarify:

First of all, we don't claim our model to be faster than R-Net implementation by HKUST. Secondly, in the paper they use P100, which is one of the latest gpus with twice the gpu memory of GTX1080 which I used to develop this model. Last but not least, the speed claimed by QANet paper is when the batch size of 32 is used, not 64.

Having said that, I agree with you that my implementation is probably not as fast as the original paper's implementation. If you have a suggestion or ideas to make this implementation better, please push a pull request. Thanks!

chenghuige commented 6 years ago

@localminimum I see, actually I learn a lot from your code, thanks a lot for sharing! I'm trying to find encoder for applications like classification which is faster then rnn and has similar or better performance. Since google claims their model is much faster then rnn based models, so very curious if we can verify that :) Anyway I will first close this issue.