Skip to content
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

关于GPU使用率问题,以及LSTM比Transformer速度”更快“的问题 #50

Open
yolanda182 opened this issue Dec 23, 2021 · 3 comments

Comments

@yolanda182
Copy link

你好👋打扰了!我发现了代码在GPU服务器上跑的时候利用率只有百分之三十,不知道是否是这个原因代码整体的运行速度很慢。
另外还有一个疑问就是序列编码层用LSTM比用Transformer的时候还要快(我是通过您代码输出的Speed和Time发现LSTM会比Transformer要快,具体运行的结果如下面所示)

LSTM:
image

Transformer:
image

Transformer的时候GPU使用信息:
image

最后还有一个问题,就是您论文里的Computational Efficiency Study中的 Inference speed应该不是这个输出的speed对吧?

(大佬们的论文真的太棒了!希望能有机会和您们交流下这几个问题🙏🏻,感激不尽!谢谢!)

@rtmaww
Copy link
Collaborator

rtmaww commented Jan 20, 2022

您好,GPU使用率低或许是因为batch size开得比较小。transformers和LSTM的batch size可能也设置得不同。论文中计算的Computational Efficiency是decode时候的时间,也就是截图中的test speed(instance/s)

@mudongla
Copy link

你好,请问是怎么切换编号为1的gpu?需要改哪些地方 @yolanda182

@Yan-cc-l
Copy link

Yan-cc-l commented Mar 3, 2023

直接在代码加:torch.cuda.set_device(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants