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
add LeViT #177
Conversation
OneFlow LeViT_128S time: 34.5ms (= 3447.5ms / 100, input_shape=[16, 3, 224, 224]) OneFlow LeViT_128 time: 45.5ms (= 4551.8ms / 100, input_shape=[16, 3, 224, 224]) OneFlow LeViT_192 time: 56.6ms (= 5663.3ms / 100, input_shape=[16, 3, 224, 224]) OneFlow LeViT_256 time: 60.8ms (= 6081.3ms / 100, input_shape=[16, 3, 224, 224]) OneFlow LeViT_384 time: 89.8ms (= 8976.2ms / 100, input_shape=[16, 3, 224, 224]) OneFlow LeViT_128S time: 15.2ms (= 1517.8ms / 100, input_shape=[16, 3, 224, 224], backward is disabled, ddp, world size=2) Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. OneFlow LeViT_128 time: 15.4ms (= 1544.3ms / 100, input_shape=[16, 3, 224, 224], backward is disabled, ddp, world size=2) Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. OneFlow LeViT_192 time: 19.2ms (= 1918.2ms / 100, input_shape=[16, 3, 224, 224], backward is disabled, ddp, world size=2) Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. OneFlow LeViT_256 time: 22.5ms (= 2250.0ms / 100, input_shape=[16, 3, 224, 224], backward is disabled, ddp, world size=2) Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. OneFlow LeViT_384 time: 31.9ms (= 3191.4ms / 100, input_shape=[16, 3, 224, 224], backward is disabled, ddp, world size=2) Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. |
这个速度误差好大啊,大家有没有什么想法 |
我看看,你搬的速度有点快233 |
flowvision/models/levit.py
Outdated
|
||
def forward(self, x): | ||
if self.training and self.drop > 0: | ||
return x + self.m(x) * (flow.rand(x.size(0), 1, 1, device=x.device)>self.drop).div(1 - self.drop).detach() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.div
的速度可能有问题
|
||
def forward(self, x): | ||
B, N, C = x.shape | ||
x = x.view(B, self.resolution, self.resolution, C)[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.view
还有一些slice的操作速度上可能也有差距
修复一下冲突就可以合并了 @kaijieshi7 |
OK |
Add LeViT