liger-kernel-nightly 0.5.4.dev20250224214213__py3-none-any.whl → 0.5.4.dev20250225020243__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/utils.py +1 -3
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.dist-info}/METADATA +1 -1
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.dist-info}/RECORD +8 -8
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.dist-info}/LICENSE +0 -0
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.dist-info}/NOTICE +0 -0
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.dist-info}/WHEEL +0 -0
- {liger_kernel_nightly-0.5.4.dev20250224214213.dist-info → liger_kernel_nightly-0.5.4.dev20250225020243.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:
|
liger_kernel/utils.py
CHANGED
|
@@ -5,12 +5,10 @@ def infer_device():
|
|
|
5
5
|
"""
|
|
6
6
|
Get current device name based on available devices
|
|
7
7
|
"""
|
|
8
|
-
if torch.cuda.is_available():
|
|
8
|
+
if torch.cuda.is_available(): # Works for both Nvidia and AMD
|
|
9
9
|
return "cuda"
|
|
10
10
|
elif torch.xpu.is_available():
|
|
11
11
|
return "xpu"
|
|
12
|
-
elif torch.hip.is_available():
|
|
13
|
-
return "hip"
|
|
14
12
|
else:
|
|
15
13
|
return "cpu"
|
|
16
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
liger_kernel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
liger_kernel/env_report.py,sha256=uhdEC8OydxoZlb7B6YYcAaBF3crGFdIck-4cxaW4NJY,1728
|
|
3
|
-
liger_kernel/utils.py,sha256=
|
|
3
|
+
liger_kernel/utils.py,sha256=178Hn8uD-VauDT6FjqMyXLbKLod8ObIpaTtapHwfEK0,1861
|
|
4
4
|
liger_kernel/chunked_loss/README.md,sha256=0FmkFC3hKBqyoDT5uTlIYmrvRkF-EOCR1y-EBU1LpWU,2248
|
|
5
5
|
liger_kernel/chunked_loss/__init__.py,sha256=ATu-xX5Fc49Cr6yBOGBRNTo593ZrU5ZCsIuvoIbJWw4,603
|
|
6
6
|
liger_kernel/chunked_loss/cpo_loss.py,sha256=OdBR8WYdHTKpLI_c9DcuwqKSWPeAAeTyREz46Vu_cAY,3682
|
|
@@ -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
|
|
@@ -66,9 +66,9 @@ liger_kernel/transformers/trainer/__init__.py,sha256=p7yQfklV8-467qSz_ZMimkbDF7H
|
|
|
66
66
|
liger_kernel/transformers/trainer/orpo_trainer.py,sha256=pdekW7l6Qg_aqa5SYKYlSWUF8m3lkOFvFLcIMEHrz9s,8338
|
|
67
67
|
liger_kernel/triton/__init__.py,sha256=qCiCamzCRv6lpV8IqpAc9YMdNKC7GKurClWceQPnlis,92
|
|
68
68
|
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.
|
|
69
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/LICENSE,sha256=OhzLDHJ0to4a8sodVLELZiCFylZ1NAAYLs-HrjPy0ag,1312
|
|
70
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/METADATA,sha256=8MIiL5w8zFdcQMmctVN8Ca-A1pk2UG2e-aKDtlRaKf4,22234
|
|
71
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/NOTICE,sha256=njwnoPZLh9AN8SJQzxvCGLHi-8X__AvWRze6joNXIY8,2066
|
|
72
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
73
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/top_level.txt,sha256=2eghu4hA3LnkM7ElW92tQ8zegWKgSbeo-k-aGe1YnvY,13
|
|
74
|
+
liger_kernel_nightly-0.5.4.dev20250225020243.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|