Skip to content

Commit

Permalink
[Minor] improve kill scripts and torchao import (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
merrymercy authored Sep 10, 2024
1 parent dff2860 commit 6c7cb90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions python/sglang/srt/layers/torchao_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
"""

import torch
from torchao.quantization import (
int4_weight_only,
int8_dynamic_activation_int8_weight,
int8_weight_only,
quantize_,
)


def torchao_quantize_param_data(param, torchao_config):
# Lazy import to suppress some warnings
from torchao.quantization import (
int4_weight_only,
int8_dynamic_activation_int8_weight,
int8_weight_only,
quantize_,
)

dummy_linear = torch.nn.Linear(param.shape[1], param.shape[0], bias=False)
dummy_linear.weight = param
if "int8wo" in torchao_config:
Expand Down
2 changes: 1 addition & 1 deletion test/killall_sglang.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kill -9 $(ps aux | grep 'sglang' | grep -v 'grep' | awk '{print $2}')
kill -9 $(ps aux | grep 'sglang.launch_server' | grep -v 'grep' | awk '{print $2}')

0 comments on commit 6c7cb90

Please sign in to comment.