unsloth/unsloth/kernels
swappy 66cfbeac1d
Fix loss function not patched for Qwen3.5 models (#5442)
* fix: patch loss functions for Qwen3_5ForConditionalGeneration to prevent OOM errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Narrow except scope and simplify LOSS_MAPPING sweep

Replace bare except Exception with the only two compatibility errors we
actually care about so genuine bugs in the sweep surface. Drop the
redundant _key != "ForCausalLM" guard since the __name__ predicate
already excludes the patched entry (UnslothForCausalLMLoss != ForCausalLMLoss).

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <danielhanchen@gmail.com>
2026-05-19 03:57:50 -07:00
..
moe Fix: Add missing utf-8 encoding to text-mode file operations (#5356) 2026-05-14 18:15:27 +04:00
__init__.py Formatting & bug fixes (#3563) 2025-11-07 06:00:22 -08:00
cross_entropy_loss.py Fix loss function not patched for Qwen3.5 models (#5442) 2026-05-19 03:57:50 -07:00
fast_lora.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2025-12-30 15:58:41 +00:00
flex_attention.py Revert "Initial changes: Refactor Attention" 2026-03-13 22:38:57 -07:00
fp8.py fix: use % 8 instead of // 8 in FP8 weight shape check (#5243) 2026-05-05 03:48:04 -07:00
geglu.py Revert "[FIX] Vllm guided decoding params (#3662)" 2025-12-01 05:43:45 -08:00
layernorm.py fix(Triton): ensure float32 eps in RMS LayerNorm rsqrt for HIP/ROCm (#4110) 2026-02-28 23:59:22 -08:00
rms_layernorm.py fix(Triton): ensure float32 eps in RMS LayerNorm rsqrt for HIP/ROCm (#4110) 2026-02-28 23:59:22 -08:00
rope_embedding.py fastrope fix for zero strided tensors (#3782) 2025-12-28 21:21:48 -08:00
swiglu.py Apply suggestion from @danielhanchen 2026-01-12 21:32:20 -08:00
utils.py MLX training support for Studio on Apple Silicon (#5340) 2026-05-14 05:24:20 -07:00