Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
aa2750be
Unverified
Commit
aa2750be
authored
Sep 18, 2024
by
HAI
Committed by
GitHub
Sep 18, 2024
Browse files
[Bugfix] Enable SGLang on AMD GPUs via PyTorch for ROCm (#1419) (#1453)
parent
5e62a6b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
python/sglang/srt/layers/activation.py
python/sglang/srt/layers/activation.py
+6
-3
python/sglang/srt/layers/layernorm.py
python/sglang/srt/layers/layernorm.py
+10
-7
No files found.
python/sglang/srt/layers/activation.py
View file @
aa2750be
...
...
@@ -19,7 +19,12 @@ from typing import Optional
import
torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
from
flashinfer.activation
import
gelu_and_mul
,
gelu_tanh_and_mul
,
silu_and_mul
from
sglang.srt.utils
import
is_hip
if
not
is_hip
():
from
flashinfer.activation
import
gelu_and_mul
,
gelu_tanh_and_mul
,
silu_and_mul
from
vllm.distributed
import
(
divide
,
get_tensor_model_parallel_rank
,
...
...
@@ -29,8 +34,6 @@ from vllm.model_executor.custom_op import CustomOp
from
vllm.model_executor.layers.quantization
import
QuantizationConfig
from
vllm.model_executor.utils
import
set_weight_attrs
from
sglang.srt.utils
import
is_hip
logger
=
logging
.
getLogger
(
__name__
)
...
...
python/sglang/srt/layers/layernorm.py
View file @
aa2750be
...
...
@@ -20,16 +20,19 @@ from typing import Optional, Tuple, Union
import
torch
import
torch.nn
as
nn
from
flashinfer.norm
import
(
fused_add_rmsnorm
,
gemma_fused_add_rmsnorm
,
gemma_rmsnorm
,
rmsnorm
,
)
from
vllm.model_executor.custom_op
import
CustomOp
from
sglang.srt.utils
import
is_hip
if
not
is_hip
():
from
flashinfer.norm
import
(
fused_add_rmsnorm
,
gemma_fused_add_rmsnorm
,
gemma_rmsnorm
,
rmsnorm
,
)
from
vllm.model_executor.custom_op
import
CustomOp
logger
=
logging
.
getLogger
(
__name__
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment