-
Notifications
You must be signed in to change notification settings - Fork 468
[Feature] Qwen3 next support sp. #3225
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
e841807
6fbadf3
c6e0fbe
439d426
f09dffd
39fd106
aac996c
9cb2faa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -98,9 +98,11 @@ | |||||||||||||||||
|
||||||||||||||||||
class CustomColumnParallelOp(CustomTensorParallelOp): | ||||||||||||||||||
|
||||||||||||||||||
def __init__(self, layer): | ||||||||||||||||||
def __init__(self, layer, prefix, skip_first_layer=False): | ||||||||||||||||||
super().__init__(layer) | ||||||||||||||||||
self.gather_output = None | ||||||||||||||||||
self.prefix = prefix | ||||||||||||||||||
self.skip_first_layer = skip_first_layer | ||||||||||||||||||
|
||||||||||||||||||
def update_attrs(self): | ||||||||||||||||||
super().update_attrs() | ||||||||||||||||||
|
@@ -133,7 +135,7 @@ | |||||||||||||||||
class MLPColumnParallelOp(CustomColumnParallelOp): | ||||||||||||||||||
|
||||||||||||||||||
def __init__(self, layer): | ||||||||||||||||||
super().__init__(layer) | ||||||||||||||||||
|
||||||||||||||||||
@property | ||||||||||||||||||
def comm_group(self): | ||||||||||||||||||
|
@@ -169,7 +171,13 @@ | |||||||||||||||||
# Matrix multiply. | ||||||||||||||||||
assert self.quant_method is not None | ||||||||||||||||||
|
||||||||||||||||||
input_ = torch.ops.vllm.maybe_all_gather_and_maybe_unpad(input_, True) | ||||||||||||||||||
input_ = None | ||||||||||||||||||
if self.skip_first_layer: | ||||||||||||||||||
layer_num = self.prefix.split('.')[2] | ||||||||||||||||||
input_ = torch.ops.vllm.maybe_all_gather_and_maybe_unpad( | ||||||||||||||||||
input_, layer_num != '0') | ||||||||||||||||||
else: | ||||||||||||||||||
input_ = torch.ops.vllm.maybe_all_gather_and_maybe_unpad(input_, True) | ||||||||||||||||||
output_parallel = self.quant_method.apply(self.layer, input_, bias) | ||||||||||||||||||
|
||||||||||||||||||
if self.gather_output: | ||||||||||||||||||
|
@@ -183,10 +191,6 @@ | |||||||||||||||||
|
||||||||||||||||||
class SequenceQKVParallelOp(CustomColumnParallelOp): | ||||||||||||||||||
|
||||||||||||||||||
def __init__(self, layer, prefix): | ||||||||||||||||||
super().__init__(layer) | ||||||||||||||||||
self.prefix = prefix | ||||||||||||||||||
|
||||||||||||||||||
def apply_impl( | ||||||||||||||||||
self, input_: torch.Tensor | ||||||||||||||||||
) -> Union[torch.Tensor, tuple[torch.Tensor, Optional[Parameter]]]: | ||||||||||||||||||
|
@@ -405,50 +409,58 @@ | |||||||||||||||||
self.reduce_results = self.layer.reduce_results | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
def get_column_parallel_op( | ||||||||||||||||||
def _get_column_parallel_op( | ||||||||||||||||||
disable_tp, prefix, layer | ||||||||||||||||||
) -> Tuple[Optional[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, | ||||||||||||||||||
SequenceQKVParallelOp]], int, int]: | ||||||||||||||||||
|
def _get_column_parallel_op( | |
disable_tp, prefix, layer | |
) -> Tuple[Optional[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, | |
SequenceQKVParallelOp]], int, int]: | |
def _get_column_parallel_op( | |
prefix, layer | |
) -> Tuple[Optional[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, | |
SequenceQKVParallelOp]], int, int]: |
Check failure on line 421 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "MLPColumnParallelOp", expected "tuple[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, SequenceQKVParallelOp, None], int, int]") [return-value]
Check failure on line 424 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "SequenceMergedColumnParallelOp", expected "tuple[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, SequenceQKVParallelOp, None], int, int]") [return-value]
Check failure on line 426 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "SequenceMergedColumnParallelOp", expected "tuple[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, SequenceQKVParallelOp, None], int, int]") [return-value]
Check failure on line 428 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "SequenceQKVParallelOp", expected "tuple[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, SequenceQKVParallelOp, None], int, int]") [return-value]
Check failure on line 430 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "None", expected "tuple[Union[MLPColumnParallelOp, SequenceMergedColumnParallelOp, SequenceQKVParallelOp, None], int, int]") [return-value]
Check failure on line 439 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "MLPRowParallelOp", expected "tuple[Union[MLPRowParallelOp, OProjRowParallelOp, MatmulAllreduceRowParallelOp, SequenceRowParallelOp, None], int, int]") [return-value]
Check failure on line 441 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "OProjRowParallelOp", expected "tuple[Union[MLPRowParallelOp, OProjRowParallelOp, MatmulAllreduceRowParallelOp, SequenceRowParallelOp, None], int, int]") [return-value]
Check failure on line 443 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "MatmulAllreduceRowParallelOp", expected "tuple[Union[MLPRowParallelOp, OProjRowParallelOp, MatmulAllreduceRowParallelOp, SequenceRowParallelOp, None], int, int]") [return-value]
Check failure on line 446 in vllm_ascend/ops/linear_op.py
GitHub Actions / lint / pre-commit
Incompatible return value type (got "SequenceRowParallelOp", expected "tuple[Union[MLPRowParallelOp, OProjRowParallelOp, MatmulAllreduceRowParallelOp, SequenceRowParallelOp, None], int, int]") [return-value]
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.
The
forward_oot
method inAscendGemmaRMSNorm
is incorrectly defined as a static method with a mismatched signature. It should be an instance method, and its signature should match theforward
method it's overriding, which is(self, x, residual=None)
. The current implementation will lead to incorrect argument passing at runtime, as thevariance_epsilon
parameter in the signature will receive thex
tensor, and thex
parameter will receive theresidual
tensor. Thevariance_epsilon
should be accessed fromself.variance_epsilon
instead of being a parameter.