Comments (3)
另外,pck-knn-mt将Key的维度从1024降低到64,我在同样软硬件条件下同样数据集,pck-knn-mt的inference,用时大约16s。Key从1024维降低到64维,对于KNN检索来说应该大幅度提高了性能,但是对总体性能的影响却不大。种种迹象表明,KNN检索并没有那么费时间。FAISS库本身也是非常非常优化的,不仅有GPU加速,而且对于检索算法也有非常好的优化....
from knn-box.
在KNNMT论文(也就是Vanilla KNNMT)里说,加入KNN检索之后,速度慢了有2两个数量级。
我用咱们KNNBOX,在一块RTX8000上,测试对IT领域翻译的速度(推理速度),按照Readme中的指令运行的。
Baseline (只用NMT):用时14.1s
Vanilla KNNMT : 用时17.7s
我注意到有基于原始KNNMT的代码的工作例如Revised-Key-KNNMT,在运行的时候,整个程序的整体GPU利用率只有25%,作者说因为“检索数据库时,需要把向量先转移到CPU,检索得到表示后再转移到GPU",但我观察https://github.com/NJUNLP/knn-box/blob/master/knnbox/retriever/utils.py 似乎也是这样做的,运行Vanilla KNNMT GPU占用率却能够稳定接近100%。原始的KNNMT的代码https://github.com/urvashik/knnmt 是否存在GPU利用率过低的问题?(我实在没能跑起来这个原始的KNNMT代码,不知道HOME环境变量应该设置为什么,只能厚着脸皮来这里问问了)。
如果原始KNNMT比Baseline慢了两个数量级是因为原始KNNMT代码做的优化不好,而像KNNBOX这样能100%利用GPU则不存在这个问题的话,那么有关KNNMT的加速的研究还有用吗....
你好,谢谢你对kNN-BOX的关注。kNN-BOX确实在实现上优化了kNN-MT的解码效率问题,但是我们也注意到在解码过程中设置batch size比较大时,kNN-MT和单纯的neural模型还是会存在一定速度差异的。
from knn-box.
好的!!!
from knn-box.
Related Issues (20)
- missing 'transformer_wmt19_de_en' arch when I trying to reproduce the Adaptive-kNN HOT 6
- 关于plac-knn-mt运行报错 HOT 1
- KeyError: 'keys' HOT 4
- 基础NMT模型fairseq版本冲突问题 HOT 18
- 推理训练数据与标签不一致 HOT 4
- 感谢您指出这个问题。我们经过对checkpoint文件的对比,确认了您提出的现象,您可以按照下面的示例代码,对checkpoint进行一个小的修改,以正常加载,而kNN-BOX的代码无需修改:
- 关于vanilla-knn-mt inference报错 HOT 1
- Question about multilingual experiments in kNN-BOX paper HOT 3
- 翻译错误:AssertionError: interactive mode, should have only one sentence HOT 1
- the blue-score always 0 HOT 5
- 关于计时的一个问题 HOT 3
- 关于RuntimeError: Error(s) in loading state_dict for VanillaKNNMT: HOT 1
- 您好,当我运行adaptive-knn-mt中的build_datasotre.sh时,报No moudle named'knnbox' HOT 12
- Multi-processing for huge datastore HOT 2
- FileNotFoundError: /home/demo/knn-box/knnbox/models HOT 1
- AssertionError: You should set pad mask first! 当我尝试运行bash build_datastore.sh HOT 4
- 运行vanilla-knn-mt-visual出错 HOT 9
- 运行adaptive knn-mt出错 HOT 2
- KeyError when load_faiss_index from a dumpped datastore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knn-box.