fused_linear_cross_entropy caused bad performance
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- machine-learning, performance
Research direction
Start with the fused_linear_cross_entropy entry point and the training command in src/open_r1/sft.py, using scripts/zero3.json and the reported environment as context. Compare training with and without the option, then establish a reproducible performance difference and identify the affected behavior; no dedicated test or reproduction is provided in the issue.
Written by the indexing model from the issue text.
Description
🐛 Describe the bug
Hello, i'm finetuning Qwen-2.5-VL-3B with trl. When i turn on the liger kernel, it could lead to poor performance while the performance is normal without liger kernel. I later discovered that it was fused_linear_cross_entropy that caused the performance difference. However, their loss looks almost the same, and the problem is that this option is crucial for saving GPU memory.
Here is my training args
deepspeed --master_port 25410 src/open_r1/sft.py
--model_name_or_path .cache/Qwen2.5-VL-3B-Instruct
--dataset_name data/instructions_dynamic_combine_action.jsonl
--deepspeed scripts/zero3.json
--learning_rate 2.0e-5
--num_train_epochs 1
--packing
--max_seq_length 64800
--per_device_train_batch_size 4
--gradient_accumulation_steps 4
--dataloader_num_workers 4
--gradient_checkpointing True
--torch_dtype bfloat16
--bf16
--logging_steps 5
--eval_strategy no
--eval_steps 100
--save_strategy no
--save_steps 6000
--attn_implementation flash_attention_2
--output_dir result/Qwen2.5-VL_3B_sft_r2r_dynamic_test_fix_liger
--report_to tensorboard
Reproduce
No response
Versions
Environment Report:
Operating System: Linux-6.8.0-54-generic-x86_64-with-glibc2.39
Python version: 3.10.16
Liger Kernel version: 0.5.10
PyTorch version: 2.7.1+cu126
CUDA version: 12.6
HIP(ROCm) version: Not available
Triton version: 3.3.1
Transformers version: 4.50.3
Trl version: 0.16.0
XPU version: XPU Not Available
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 673
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linkedin/Liger-Kernel
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
linkedin/Liger-Kernel#1693 ·
Maintainers usually reply within 3 days
-
[Bug] GroupNorm kernels overflow int32 sample offsets (`batch_idx * X_row_stride`) past 2^31 elementsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
linkedin/Liger-Kernel#1692 ·
Maintainers usually reply within 3 days
-
[Bug] LigerGroupNormFunction.backward crashes on any 4D (N, C, H, W) tensor (H > 1) and hardcodes tl.bfloat16 for float16 inputsPossibly taken @shotsan claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
linkedin/Liger-Kernel#1676 · 2 comments ·
Maintainers usually reply within 3 days
-
[Bug] LigerFusedGateUpSiLUMulFunction.backward crashes with shape mismatch on any 3D (B, T, 2*H) input tensorPossibly taken @shotsan claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linkedin/Liger-Kernel#1675 · 1 comment ·
Maintainers usually reply within 3 days
-
[Bug] Silent backward gradient corruption in LigerCrossEntropy on non-contiguous logits (returns raw input logits as dL/dlogits)Possibly taken @shotsan claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
linkedin/Liger-Kernel#1674 ·
Maintainers usually reply within 3 days
All issues in linkedin/Liger-Kernel
Similar issues
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Maintainers usually reply within 1 day
-
CI: MSYS2 jobs fail — mingw python3 package renamed upstream to pythonPossibly taken @ronaldtse claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pydantic/pytest-examples#102 · 1 comment ·