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

support noaligned silu_and_mul #2506

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lmdeploy/pytorch/backends/cuda/activation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from torch import nn

from lmdeploy.pytorch.kernels.cuda.activation import silu_and_mul

from ..activation import SiluAndMulBuilder, SiluAndMulImpl
Expand All @@ -12,17 +10,8 @@ class TritonSiluAndMulImpl(SiluAndMulImpl):
def __init__(self, inplace: bool):
self.inplace = inplace

def _forward_naive(self, x):
"""forward naive."""
gate, up = x.chunk(2, -1)
return nn.functional.silu(gate, self.inplace) * up

def forward(self, x):
"""forward."""

if x.size(-1) % 2048 != 0:
return self._forward_naive(x)

out = None
x_shape = None
if x.dim() != 2:
Expand Down
308 changes: 0 additions & 308 deletions lmdeploy/pytorch/dist_utils.py

This file was deleted.

Loading
Loading