liger-kernel-nightly 0.5.4.dev20250225015144__py3-none-any.whl → 0.5.4.dev20250227064037__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of liger-kernel-nightly might be problematic. Click here for more details.
- liger_kernel/ops/cross_entropy.py +4 -0
- liger_kernel/transformers/__init__.py +1 -0
- liger_kernel/transformers/model/qwen2_5_vl.py +205 -0
- liger_kernel/transformers/monkey_patch.py +68 -0
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/METADATA +2 -1
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/RECORD +10 -9
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/LICENSE +0 -0
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/NOTICE +0 -0
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/WHEEL +0 -0
- {liger_kernel_nightly-0.5.4.dev20250225015144.dist-info → liger_kernel_nightly-0.5.4.dev20250227064037.dist-info}/top_level.txt +0 -0
|
@@ -285,6 +285,10 @@ def cross_entropy_forward(
|
|
|
285
285
|
|
|
286
286
|
target_mask = target != ignore_index
|
|
287
287
|
n_non_ignore = target_mask.sum().item()
|
|
288
|
+
assert (target * target_mask).max() < _input.shape[-1], (
|
|
289
|
+
f"Target {target.max()} is out of bounds. Expected < {_input.shape[-1]}"
|
|
290
|
+
)
|
|
291
|
+
assert (target * target_mask).min() >= 0, f"Target {target.min()} is out of bounds. Expected >= 0"
|
|
288
292
|
sum_non_ignore_weight = n_non_ignore
|
|
289
293
|
weight_sum = 0.0
|
|
290
294
|
if weight is not None:
|
|
@@ -17,6 +17,7 @@ from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_mllama
|
|
|
17
17
|
from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_olmo2 # noqa: F401
|
|
18
18
|
from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_phi3 # noqa: F401
|
|
19
19
|
from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_qwen2 # noqa: F401
|
|
20
|
+
from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_qwen2_5_vl # noqa: F401
|
|
20
21
|
from liger_kernel.transformers.monkey_patch import apply_liger_kernel_to_qwen2_vl # noqa: F401
|
|
21
22
|
from liger_kernel.transformers.rms_norm import LigerRMSNorm # noqa: F401
|
|
22
23
|
from liger_kernel.transformers.rope import liger_rotary_pos_emb # noqa: F401
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from typing import Tuple
|
|
4
|
+
from typing import Union
|
|
5
|
+
|
|
6
|
+
import torch
|
|
7
|
+
|
|
8
|
+
from torch.nn import CrossEntropyLoss
|
|
9
|
+
from transformers.models.qwen2_5_vl.modeling_qwen2_5_vl import _CONFIG_FOR_DOC
|
|
10
|
+
from transformers.models.qwen2_5_vl.modeling_qwen2_5_vl import QWEN2_5_VL_INPUTS_DOCSTRING
|
|
11
|
+
from transformers.models.qwen2_5_vl.modeling_qwen2_5_vl import Qwen2_5_VLCausalLMOutputWithPast
|
|
12
|
+
from transformers.utils import add_start_docstrings_to_model_forward
|
|
13
|
+
from transformers.utils import replace_return_docstrings
|
|
14
|
+
|
|
15
|
+
from liger_kernel.transformers.fused_linear_cross_entropy import LigerFusedLinearCrossEntropyLoss
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@add_start_docstrings_to_model_forward(QWEN2_5_VL_INPUTS_DOCSTRING)
|
|
19
|
+
@replace_return_docstrings(output_type=Qwen2_5_VLCausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
|
|
20
|
+
def lce_forward(
|
|
21
|
+
self,
|
|
22
|
+
input_ids: torch.LongTensor = None,
|
|
23
|
+
attention_mask: Optional[torch.Tensor] = None,
|
|
24
|
+
position_ids: Optional[torch.LongTensor] = None,
|
|
25
|
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
|
26
|
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
|
27
|
+
labels: Optional[torch.LongTensor] = None,
|
|
28
|
+
use_cache: Optional[bool] = None,
|
|
29
|
+
output_attentions: Optional[bool] = None,
|
|
30
|
+
output_hidden_states: Optional[bool] = None,
|
|
31
|
+
return_dict: Optional[bool] = None,
|
|
32
|
+
pixel_values: Optional[torch.Tensor] = None,
|
|
33
|
+
pixel_values_videos: Optional[torch.FloatTensor] = None,
|
|
34
|
+
image_grid_thw: Optional[torch.LongTensor] = None,
|
|
35
|
+
video_grid_thw: Optional[torch.LongTensor] = None,
|
|
36
|
+
rope_deltas: Optional[torch.LongTensor] = None,
|
|
37
|
+
cache_position: Optional[torch.LongTensor] = None,
|
|
38
|
+
second_per_grid_ts: Optional[torch.Tensor] = None,
|
|
39
|
+
) -> Union[Tuple, Qwen2_5_VLCausalLMOutputWithPast]:
|
|
40
|
+
r"""
|
|
41
|
+
Copy paste Qwen2_5_VL's forward but replace torch cross entropy with liger fused linear cross entropy
|
|
42
|
+
Args:
|
|
43
|
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
|
44
|
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
|
|
45
|
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
|
46
|
+
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
|
|
50
|
+
Example:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
>>> from PIL import Image
|
|
54
|
+
>>> import requests
|
|
55
|
+
>>> from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
|
|
56
|
+
|
|
57
|
+
>>> model = Qwen2_5_VLForConditionalGeneration.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
|
|
58
|
+
>>> processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
|
|
59
|
+
|
|
60
|
+
>>> messages = [
|
|
61
|
+
{
|
|
62
|
+
"role": "user",
|
|
63
|
+
"content": [
|
|
64
|
+
{"type": "image"},
|
|
65
|
+
{"type": "text", "text": "What is shown in this image?"},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
>>> url = "https://www.ilankelman.org/stopsigns/australia.jpg"
|
|
70
|
+
>>> image = Image.open(requests.get(url, stream=True).raw)
|
|
71
|
+
|
|
72
|
+
>>> text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
|
73
|
+
>>> inputs = processor(text=[text], images=[image], vision_infos=[vision_infos])
|
|
74
|
+
|
|
75
|
+
>>> # Generate
|
|
76
|
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
|
77
|
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
|
78
|
+
"The image shows a street scene with a red stop sign in the foreground. In the background, there is a large red gate with Chinese characters ..."
|
|
79
|
+
```"""
|
|
80
|
+
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|
|
81
|
+
output_hidden_states = (
|
|
82
|
+
output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
|
|
83
|
+
)
|
|
84
|
+
return_dict = return_dict if return_dict is not None else self.config.use_return_dict
|
|
85
|
+
|
|
86
|
+
if inputs_embeds is None:
|
|
87
|
+
inputs_embeds = self.model.embed_tokens(input_ids)
|
|
88
|
+
if pixel_values is not None:
|
|
89
|
+
pixel_values = pixel_values.type(self.visual.dtype)
|
|
90
|
+
image_embeds = self.visual(pixel_values, grid_thw=image_grid_thw)
|
|
91
|
+
n_image_tokens = (input_ids == self.config.image_token_id).sum().item()
|
|
92
|
+
n_image_features = image_embeds.shape[0]
|
|
93
|
+
if n_image_tokens != n_image_features:
|
|
94
|
+
raise ValueError(
|
|
95
|
+
f"Image features and image tokens do not match: tokens: {n_image_tokens}, features {n_image_features}"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
mask = input_ids == self.config.image_token_id
|
|
99
|
+
mask_unsqueezed = mask.unsqueeze(-1)
|
|
100
|
+
mask_expanded = mask_unsqueezed.expand_as(inputs_embeds)
|
|
101
|
+
image_mask = mask_expanded.to(inputs_embeds.device)
|
|
102
|
+
|
|
103
|
+
image_embeds = image_embeds.to(inputs_embeds.device, inputs_embeds.dtype)
|
|
104
|
+
inputs_embeds = inputs_embeds.masked_scatter(image_mask, image_embeds)
|
|
105
|
+
|
|
106
|
+
if pixel_values_videos is not None:
|
|
107
|
+
pixel_values_videos = pixel_values_videos.type(self.visual.dtype)
|
|
108
|
+
video_embeds = self.visual(pixel_values_videos, grid_thw=video_grid_thw)
|
|
109
|
+
n_video_tokens = (input_ids == self.config.video_token_id).sum().item()
|
|
110
|
+
n_video_features = video_embeds.shape[0]
|
|
111
|
+
if n_video_tokens != n_video_features:
|
|
112
|
+
raise ValueError(
|
|
113
|
+
f"Video features and video tokens do not match: tokens: {n_video_tokens}, features {n_video_features}"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
mask = input_ids == self.config.video_token_id
|
|
117
|
+
mask_unsqueezed = mask.unsqueeze(-1)
|
|
118
|
+
mask_expanded = mask_unsqueezed.expand_as(inputs_embeds)
|
|
119
|
+
video_mask = mask_expanded.to(inputs_embeds.device)
|
|
120
|
+
|
|
121
|
+
video_embeds = video_embeds.to(inputs_embeds.device, inputs_embeds.dtype)
|
|
122
|
+
inputs_embeds = inputs_embeds.masked_scatter(video_mask, video_embeds)
|
|
123
|
+
|
|
124
|
+
if attention_mask is not None:
|
|
125
|
+
attention_mask = attention_mask.to(inputs_embeds.device)
|
|
126
|
+
|
|
127
|
+
# if we get 4D attention mask we cannot calculate rope deltas anymore. TODO @raushan fixme
|
|
128
|
+
if position_ids is None and (attention_mask is None or attention_mask.ndim == 2):
|
|
129
|
+
# calculate RoPE index once per generation in the pre-fill stage only
|
|
130
|
+
if (cache_position is not None and cache_position[0] == 0) or self.rope_deltas is None:
|
|
131
|
+
position_ids, rope_deltas = self.get_rope_index(
|
|
132
|
+
input_ids,
|
|
133
|
+
image_grid_thw,
|
|
134
|
+
video_grid_thw,
|
|
135
|
+
second_per_grid_ts,
|
|
136
|
+
attention_mask,
|
|
137
|
+
)
|
|
138
|
+
self.rope_deltas = rope_deltas
|
|
139
|
+
# then use the prev pre-calculated rope-deltas to get the correct position ids
|
|
140
|
+
else:
|
|
141
|
+
batch_size, seq_length, _ = inputs_embeds.shape
|
|
142
|
+
delta = (cache_position[0] + self.rope_deltas).to(inputs_embeds.device) if cache_position is not None else 0
|
|
143
|
+
position_ids = torch.arange(seq_length, device=inputs_embeds.device)
|
|
144
|
+
position_ids = position_ids.view(1, -1).expand(batch_size, -1)
|
|
145
|
+
if cache_position is not None: # otherwise `deltas` is an int `0`
|
|
146
|
+
delta = delta.repeat_interleave(batch_size // delta.shape[0], dim=0)
|
|
147
|
+
position_ids = position_ids.add(delta)
|
|
148
|
+
position_ids = position_ids.unsqueeze(0).expand(3, -1, -1)
|
|
149
|
+
|
|
150
|
+
outputs = self.model(
|
|
151
|
+
input_ids=None,
|
|
152
|
+
position_ids=position_ids,
|
|
153
|
+
attention_mask=attention_mask,
|
|
154
|
+
past_key_values=past_key_values,
|
|
155
|
+
inputs_embeds=inputs_embeds,
|
|
156
|
+
use_cache=use_cache,
|
|
157
|
+
output_attentions=output_attentions,
|
|
158
|
+
output_hidden_states=output_hidden_states,
|
|
159
|
+
return_dict=return_dict,
|
|
160
|
+
cache_position=cache_position,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
hidden_states = outputs[0]
|
|
164
|
+
|
|
165
|
+
loss = None
|
|
166
|
+
logits = None
|
|
167
|
+
|
|
168
|
+
if self.training and (labels is not None):
|
|
169
|
+
shift_hidden_states = hidden_states[..., :-1, :].contiguous()
|
|
170
|
+
shift_labels = labels[..., 1:].contiguous()
|
|
171
|
+
|
|
172
|
+
# Flatten tokens
|
|
173
|
+
shift_hidden_states = shift_hidden_states.view(-1, self.config.hidden_size)
|
|
174
|
+
shift_labels = shift_labels.view(-1)
|
|
175
|
+
|
|
176
|
+
lce = LigerFusedLinearCrossEntropyLoss()
|
|
177
|
+
loss = lce(self.lm_head.weight, shift_hidden_states, shift_labels)
|
|
178
|
+
else:
|
|
179
|
+
logits = self.lm_head(hidden_states)
|
|
180
|
+
if labels is not None:
|
|
181
|
+
# Upcast to float if we need to compute the loss to avoid potential precision issues
|
|
182
|
+
logits = logits.float()
|
|
183
|
+
# Shift so that tokens < n predict n
|
|
184
|
+
shift_logits = logits[..., :-1, :].contiguous()
|
|
185
|
+
shift_labels = labels[..., 1:].contiguous()
|
|
186
|
+
# Flatten the tokens
|
|
187
|
+
loss_fct = CrossEntropyLoss()
|
|
188
|
+
shift_logits = shift_logits.view(-1, self.config.vocab_size)
|
|
189
|
+
shift_labels = shift_labels.view(-1)
|
|
190
|
+
# Enable model parallelism
|
|
191
|
+
shift_labels = shift_labels.to(shift_logits.device)
|
|
192
|
+
loss = loss_fct(shift_logits, shift_labels)
|
|
193
|
+
|
|
194
|
+
if not return_dict:
|
|
195
|
+
output = (logits,) + outputs[1:]
|
|
196
|
+
return (loss,) + output if loss is not None else output
|
|
197
|
+
|
|
198
|
+
return Qwen2_5_VLCausalLMOutputWithPast(
|
|
199
|
+
loss=loss,
|
|
200
|
+
logits=logits,
|
|
201
|
+
past_key_values=outputs.past_key_values,
|
|
202
|
+
hidden_states=outputs.hidden_states,
|
|
203
|
+
attentions=outputs.attentions,
|
|
204
|
+
rope_deltas=rope_deltas,
|
|
205
|
+
)
|
|
@@ -745,6 +745,73 @@ def apply_liger_kernel_to_qwen2_vl(
|
|
|
745
745
|
_patch_rms_norm_module(decoder_layer.post_attention_layernorm)
|
|
746
746
|
|
|
747
747
|
|
|
748
|
+
def apply_liger_kernel_to_qwen2_5_vl(
|
|
749
|
+
rope: bool = True,
|
|
750
|
+
cross_entropy: bool = False,
|
|
751
|
+
fused_linear_cross_entropy: bool = True,
|
|
752
|
+
rms_norm: bool = True,
|
|
753
|
+
swiglu: bool = True,
|
|
754
|
+
model: PreTrainedModel = None,
|
|
755
|
+
) -> None:
|
|
756
|
+
"""
|
|
757
|
+
Apply Liger kernels to replace original implementation in HuggingFace Qwen2.5-VL models.
|
|
758
|
+
NOTE: Qwen2.5-VL is not available in transformers<4.48.2
|
|
759
|
+
|
|
760
|
+
Args:
|
|
761
|
+
cross_entropy (bool): Whether to apply Liger's cross entropy loss. Default is False.
|
|
762
|
+
fused_linear_cross_entropy (bool):
|
|
763
|
+
Whether to apply Liger's fused linear cross entropy loss. Default is True.
|
|
764
|
+
`cross_entropy` and `fused_linear_cross_entropy` cannot both be True.
|
|
765
|
+
If `fused_linear_cross_entropy` is True, the logits will not be materialized but more memory efficient.
|
|
766
|
+
rms_norm (bool): Whether to apply Liger's RMSNorm. Default is True.
|
|
767
|
+
swiglu (bool): Whether to apply Liger's SwiGLU MLP. Default is True.
|
|
768
|
+
model (PreTrainedModel): The model instance to apply Liger kernels to, if the model has already been
|
|
769
|
+
loaded. Default is None.
|
|
770
|
+
"""
|
|
771
|
+
assert not (cross_entropy and fused_linear_cross_entropy), (
|
|
772
|
+
"cross_entropy and fused_linear_cross_entropy cannot both be True."
|
|
773
|
+
)
|
|
774
|
+
|
|
775
|
+
from transformers.models.qwen2_5_vl import modeling_qwen2_5_vl
|
|
776
|
+
from transformers.models.qwen2_5_vl.modeling_qwen2_5_vl import Qwen2_5_VLModel
|
|
777
|
+
|
|
778
|
+
from liger_kernel.transformers.model.qwen2_5_vl import lce_forward as qwen2_5_vl_lce_forward
|
|
779
|
+
|
|
780
|
+
if rope:
|
|
781
|
+
modeling_qwen2_5_vl.apply_multimodal_rotary_pos_emb = liger_multimodal_rotary_pos_emb
|
|
782
|
+
if rms_norm:
|
|
783
|
+
modeling_qwen2_5_vl.Qwen2RMSNorm = LigerRMSNorm
|
|
784
|
+
if cross_entropy:
|
|
785
|
+
modeling_qwen2_5_vl.CrossEntropyLoss = LigerCrossEntropyLoss
|
|
786
|
+
if fused_linear_cross_entropy:
|
|
787
|
+
modeling_qwen2_5_vl.Qwen2_5_VLForConditionalGeneration.forward = qwen2_5_vl_lce_forward
|
|
788
|
+
if swiglu:
|
|
789
|
+
modeling_qwen2_5_vl.Qwen2MLP = LigerSwiGLUMLP
|
|
790
|
+
|
|
791
|
+
if model is not None:
|
|
792
|
+
# The model instance already exists, so we need to additionally patch the
|
|
793
|
+
# instance variables that reference already-instantiated modules
|
|
794
|
+
|
|
795
|
+
# get the base model from the model instance
|
|
796
|
+
base_model: Qwen2_5_VLModel = getattr(model, model.base_model_prefix, model)
|
|
797
|
+
|
|
798
|
+
if hasattr(model, "visual"):
|
|
799
|
+
# Patch Qwen2_5_VisionTransformerPretrainedModel
|
|
800
|
+
for vision_block in model.visual.blocks:
|
|
801
|
+
if rms_norm:
|
|
802
|
+
_patch_rms_norm_module(vision_block.norm1)
|
|
803
|
+
_patch_rms_norm_module(vision_block.norm2)
|
|
804
|
+
|
|
805
|
+
if rms_norm:
|
|
806
|
+
_patch_rms_norm_module(base_model.norm)
|
|
807
|
+
for decoder_layer in base_model.layers:
|
|
808
|
+
if swiglu:
|
|
809
|
+
_bind_method_to_module(decoder_layer.mlp, "forward", LigerSwiGLUMLP.forward)
|
|
810
|
+
if rms_norm:
|
|
811
|
+
_patch_rms_norm_module(decoder_layer.input_layernorm)
|
|
812
|
+
_patch_rms_norm_module(decoder_layer.post_attention_layernorm)
|
|
813
|
+
|
|
814
|
+
|
|
748
815
|
def apply_liger_kernel_to_phi3(
|
|
749
816
|
rope: bool = True,
|
|
750
817
|
cross_entropy: bool = False,
|
|
@@ -890,6 +957,7 @@ MODEL_TYPE_TO_APPLY_LIGER_FN = {
|
|
|
890
957
|
"olmo2": apply_liger_kernel_to_olmo2,
|
|
891
958
|
"qwen2": apply_liger_kernel_to_qwen2,
|
|
892
959
|
"qwen2_vl": apply_liger_kernel_to_qwen2_vl,
|
|
960
|
+
"qwen2_5_vl": apply_liger_kernel_to_qwen2_5_vl,
|
|
893
961
|
"phi3": apply_liger_kernel_to_phi3,
|
|
894
962
|
}
|
|
895
963
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: liger_kernel_nightly
|
|
3
|
-
Version: 0.5.4.
|
|
3
|
+
Version: 0.5.4.dev20250227064037
|
|
4
4
|
Summary: Efficient Triton kernels for LLM Training
|
|
5
5
|
License: BSD 2-CLAUSE LICENSE
|
|
6
6
|
Copyright 2024 LinkedIn Corporation
|
|
@@ -312,6 +312,7 @@ loss.backward()
|
|
|
312
312
|
| Gemma2 | `liger_kernel.transformers.apply_liger_kernel_to_gemma2` | RoPE, RMSNorm, GeGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
313
313
|
| Qwen2, Qwen2.5, & QwQ | `liger_kernel.transformers.apply_liger_kernel_to_qwen2` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
314
314
|
| Qwen2-VL, & QVQ | `liger_kernel.transformers.apply_liger_kernel_to_qwen2_vl` | RMSNorm, LayerNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
315
|
+
| Qwen2.5-VL | `liger_kernel.transformers.apply_liger_kernel_to_qwen2_5_vl` | RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
315
316
|
| Phi3 & Phi3.5 | `liger_kernel.transformers.apply_liger_kernel_to_phi3` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
316
317
|
| Granite 3.0 & 3.1 | `liger_kernel.transformers.apply_liger_kernel_to_granite` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss |
|
|
317
318
|
| OLMo2 | `liger_kernel.transformers.apply_liger_kernel_to_olmo2` | RoPE, RMSNorm, SwiGLU, CrossEntropyLoss, FusedLinearCrossEntropy |
|
|
@@ -16,7 +16,7 @@ liger_kernel/chunked_loss/kto_loss.py,sha256=b3ffJyk97e-6XdXd4HFrYyx8wW4A-CU4gOa
|
|
|
16
16
|
liger_kernel/chunked_loss/orpo_loss.py,sha256=yjcrrbVeemLYodoSKT-FMSnaPtyKAZ3aOrvPD6tTY6Y,3617
|
|
17
17
|
liger_kernel/chunked_loss/simpo_loss.py,sha256=3TTc7U79Orjgi-Wu81WZkWk5MgsdqKXIOBHgIvDazPw,3865
|
|
18
18
|
liger_kernel/ops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
liger_kernel/ops/cross_entropy.py,sha256=
|
|
19
|
+
liger_kernel/ops/cross_entropy.py,sha256=yKKhN63I7r9NxJye4wTLBvvKAyrXQt6jf4nBo3lJyVg,18860
|
|
20
20
|
liger_kernel/ops/fused_linear_cross_entropy.py,sha256=1Y3Uk_TCSjqKgoG2eot1ptnWXJXXQESqGvOmqAW1gsM,10912
|
|
21
21
|
liger_kernel/ops/fused_linear_jsd.py,sha256=Seshez2qaM6HiTQ8_HEqSwhaeVruNT1SvIM4ZrAPBEU,9602
|
|
22
22
|
liger_kernel/ops/geglu.py,sha256=axGvCIvlBzuluoAIrWTsp2iZM4BFKNInkPov8YVvH9E,4126
|
|
@@ -32,7 +32,7 @@ liger_kernel/ops/tvd.py,sha256=FHJtLQI95ijqgg9UtaHpMAjSCiPxB6CduPwPMcGxelc,6405
|
|
|
32
32
|
liger_kernel/ops/utils.py,sha256=uoFKQqo-34N2TWQNvXMFywqGiOMMXNEVBxVojzlUAa0,3836
|
|
33
33
|
liger_kernel/ops/experimental/embedding.py,sha256=tolj3tItkzpSb30zWqDN2_yX4ectflaQ8HMyKyFIQc8,4172
|
|
34
34
|
liger_kernel/ops/experimental/mm_int8int2.py,sha256=TrS9lpwekrik_w5qE7AhMJD1bcq-OidjtbsW80oZ6IM,13314
|
|
35
|
-
liger_kernel/transformers/__init__.py,sha256=
|
|
35
|
+
liger_kernel/transformers/__init__.py,sha256=4bwMPQhGHxmZ-WTFAMD9m-s0PYyfcvIRxhq_h3b0Wz0,2363
|
|
36
36
|
liger_kernel/transformers/auto_model.py,sha256=0qCTRZt280Bj_LcFdzo9hlaR-BWNazawXOGgoCZjgEg,1545
|
|
37
37
|
liger_kernel/transformers/cross_entropy.py,sha256=z3KTWQnFxr_IZaVjtYt0ZNEWQdDdYThN35xWkHlDGH0,1683
|
|
38
38
|
liger_kernel/transformers/functional.py,sha256=ShLD3eb--XKNtllznCrOYTbo4f-1KVwzi0KLMICdrn4,4942
|
|
@@ -43,7 +43,7 @@ liger_kernel/transformers/group_norm.py,sha256=6qMAWOprr4SzP0YhNVNGQIBpM5aUHplUD
|
|
|
43
43
|
liger_kernel/transformers/jsd.py,sha256=DGqRnxIZxsvxo0_tbbxX3b-sDbDjC_yKufyRIHCcScY,2979
|
|
44
44
|
liger_kernel/transformers/kl_div.py,sha256=WLffFbh1EExD2Eb1F7lN11fo9JJC-0751WJjZAF1Fj8,409
|
|
45
45
|
liger_kernel/transformers/layer_norm.py,sha256=c9pk3PEasOKYR0rhe5e5nNrnYKVCEW4VC8S6LpCq9EQ,906
|
|
46
|
-
liger_kernel/transformers/monkey_patch.py,sha256=
|
|
46
|
+
liger_kernel/transformers/monkey_patch.py,sha256=9ud9tv1LI9WIa9UDu0abGIiusIIkayO1fjAUMWgwwT0,47096
|
|
47
47
|
liger_kernel/transformers/qwen2vl_mrope.py,sha256=5EwSqrMdsL9MYspeBMXBsNJKvH0MOmRrtJXAJlnnlOI,1047
|
|
48
48
|
liger_kernel/transformers/rms_norm.py,sha256=GqCEJuGt0YdqqlMcToE0Wp4A8YFquDa4UUSyH2uFW2A,1191
|
|
49
49
|
liger_kernel/transformers/rope.py,sha256=ZTrTORSAyfcFIKjk6XEeYmk4ROH7xXED9L4g2NFntlE,999
|
|
@@ -61,14 +61,15 @@ liger_kernel/transformers/model/mllama.py,sha256=qWexBdskuN3gPJvPUwt4J0nU675tGD6
|
|
|
61
61
|
liger_kernel/transformers/model/olmo2.py,sha256=yyksS6E4fuWd8asEW8rEDBKqZpFmP4ITCM_bjIDZaoY,5124
|
|
62
62
|
liger_kernel/transformers/model/phi3.py,sha256=biRa8fph9qdnQmkD9I21t5XIjpIt1i6UKU4uk8Up8pU,10292
|
|
63
63
|
liger_kernel/transformers/model/qwen2.py,sha256=14UuPjxB-tjqWn85Tn4fqBFvVhVsth5iPEt8kJSMiew,9581
|
|
64
|
+
liger_kernel/transformers/model/qwen2_5_vl.py,sha256=l71WBfX0ptrisoURIRwXJH7MQ2vGKOvcRYMNsrydwlQ,9455
|
|
64
65
|
liger_kernel/transformers/model/qwen2_vl.py,sha256=yMLqsfSYcvhClUpTUjGoADiOxfLB2B8240VdrPP0c8s,9851
|
|
65
66
|
liger_kernel/transformers/trainer/__init__.py,sha256=p7yQfklV8-467qSz_ZMimkbDF7HHWHwku25A-GYL0WU,193
|
|
66
67
|
liger_kernel/transformers/trainer/orpo_trainer.py,sha256=pdekW7l6Qg_aqa5SYKYlSWUF8m3lkOFvFLcIMEHrz9s,8338
|
|
67
68
|
liger_kernel/triton/__init__.py,sha256=qCiCamzCRv6lpV8IqpAc9YMdNKC7GKurClWceQPnlis,92
|
|
68
69
|
liger_kernel/triton/monkey_patch.py,sha256=Rd0hUHAzDkFfHvnX7-PBaNK5EKnZhtfM_h-fgQH9HPY,1568
|
|
69
|
-
liger_kernel_nightly-0.5.4.
|
|
70
|
-
liger_kernel_nightly-0.5.4.
|
|
71
|
-
liger_kernel_nightly-0.5.4.
|
|
72
|
-
liger_kernel_nightly-0.5.4.
|
|
73
|
-
liger_kernel_nightly-0.5.4.
|
|
74
|
-
liger_kernel_nightly-0.5.4.
|
|
70
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/LICENSE,sha256=OhzLDHJ0to4a8sodVLELZiCFylZ1NAAYLs-HrjPy0ag,1312
|
|
71
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/METADATA,sha256=cLJkyLwqe07PHRuASpIGhgOq-5abocy-sHrijROBnts,22389
|
|
72
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/NOTICE,sha256=njwnoPZLh9AN8SJQzxvCGLHi-8X__AvWRze6joNXIY8,2066
|
|
73
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
74
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/top_level.txt,sha256=2eghu4hA3LnkM7ElW92tQ8zegWKgSbeo-k-aGe1YnvY,13
|
|
75
|
+
liger_kernel_nightly-0.5.4.dev20250227064037.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|