Skip to content

Commit fa815e6

Browse files
Cleanup code
Removed unnecessary comments
1 parent d225c42 commit fa815e6

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

vllm/model_executor/layers/activation.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import torch.nn as nn
88
import torch.nn.functional as F
99

10-
import warnings
11-
1210
from vllm.distributed import (divide, get_tensor_model_parallel_rank,
1311
get_tensor_model_parallel_world_size)
1412
from vllm.model_executor.custom_op import CustomOp
@@ -17,6 +15,7 @@
1715
from vllm.utils import LazyDict
1816

1917
from torch._dynamo import allow_in_graph
18+
import warnings
2019

2120
@CustomOp.register("xielu")
2221
class XIELU(CustomOp):
@@ -30,19 +29,15 @@ class XIELU(CustomOp):
3029

3130
def __init__(self, alpha_p_init=0.8, alpha_n_init=0.8, beta=0.5, eps=-1e-6):
3231
super().__init__()
33-
# Initialize parameters (good)
3432
self.alpha_p = nn.Parameter(torch.log(torch.exp(torch.tensor(alpha_p_init)) - 1.0).unsqueeze(0))
3533
self.alpha_n = nn.Parameter(torch.log(torch.exp(torch.tensor(alpha_n_init - beta)) - 1.0).unsqueeze(0))
3634
self.beta = beta
3735
self.eps = torch.tensor(eps, dtype=torch.bfloat16, device='cuda')
3836

39-
# Default to native implementation
4037
self._forward_method = self.forward_native
41-
4238
if current_platform.is_cuda_alike():
4339
try:
4440
from xielu.ops.wrappers import XIELU as XIELUCUDA
45-
4641
# Create CUDA instance without Dynamo interference first
4742
self._xielu_cuda = XIELUCUDA(
4843
alpha_p=self.alpha_p,

0 commit comments

Comments
 (0)