Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
620fc2d0
Unverified
Commit
620fc2d0
authored
Apr 05, 2025
by
Lucia Fang
Committed by
GitHub
Apr 05, 2025
Browse files
[Model] fix model testing for TeleChat2ForCausalLM and V0 llama4 (#16112)
Signed-off-by:
Lu Fang
<
fanglu@fb.com
>
parent
29283eaa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
vllm/attention/backends/flash_attn.py
vllm/attention/backends/flash_attn.py
+5
-0
vllm/model_executor/models/telechat2.py
vllm/model_executor/models/telechat2.py
+6
-2
No files found.
vllm/attention/backends/flash_attn.py
View file @
620fc2d0
...
...
@@ -617,10 +617,15 @@ class FlashAttentionImpl(AttentionImpl):
blocksparse_params
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
logits_soft_cap
:
Optional
[
float
]
=
None
,
attn_type
:
str
=
AttentionType
.
DECODER
,
use_irope
:
bool
=
False
,
)
->
None
:
if
blocksparse_params
is
not
None
:
raise
ValueError
(
"FlashAttention does not support block-sparse attention."
)
if
use_irope
:
logger
.
warning
(
"Using irope in V0 is not supported yet, it will fall back "
"to global attention for long context."
)
self
.
num_heads
=
num_heads
self
.
head_size
=
head_size
self
.
scale
=
float
(
scale
)
...
...
vllm/model_executor/models/telechat2.py
View file @
620fc2d0
...
...
@@ -19,7 +19,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
typing
import
Iterable
,
Set
,
Tuple
from
typing
import
Iterable
,
Set
,
Tuple
,
Type
import
torch
...
...
@@ -27,6 +27,7 @@ from vllm.config import VllmConfig
from
vllm.model_executor.model_loader.weight_utils
import
default_weight_loader
from
vllm.model_executor.models.llama
import
LlamaForCausalLM
,
LlamaModel
from
.llama
import
LlamaDecoderLayer
from
.utils
import
(
AutoWeightsLoader
,
PPMissingLayer
,
WeightsMapper
,
is_pp_missing_parameter
)
...
...
@@ -120,7 +121,10 @@ class TeleChat2ForCausalLM(LlamaForCausalLM):
},
)
def
_init_model
(
self
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
):
def
_init_model
(
self
,
vllm_config
:
VllmConfig
,
prefix
:
str
=
""
,
layer_type
:
Type
[
LlamaDecoderLayer
]
=
LlamaDecoderLayer
):
return
TeleChat2Model
(
vllm_config
=
vllm_config
,
prefix
=
prefix
)
def
load_weights
(
self
,
weights
:
Iterable
[
Tuple
[
str
,
...
...
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