linkedin / linkedin/Liger-Kernel
Check if cross entropy is applied correctly in all monkey patch functions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 603
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 47
Description
🐛 Describe the bug
Some of them aren't patched to the correct object.
For example: InternVL doesn't have nn.CrossEntropy in its modeling file. The monkey patch should be applied to the loss_util file (See comment)
https://github.com/linkedin/Liger-Kernel/blob/da6e7059fd3b496f3bae6152e5814e72a495601a/src/liger_kernel/transformers/monkey_patch.py#L2070-L2072
Note that some monkey patch functions are outdated, so you may need to check them manually
p.s. we only need to support transformers>=4.49.0. bwd-test ci is targeting to 4.49.0.
Reproduce
No response
Versions
liger_kernel==https://github.com/linkedin/Liger-Kernel/commit/da6e7059fd3b496f3bae6152e5814e72a495601a
Contributor 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.
Research direction
Start in src/liger_kernel/transformers/monkey_patch.py around lines 2070-2072 and review the related monkey-patch functions manually. Compare each cross-entropy target with the corresponding Transformers 4.49.0 model or loss_util location, using the linked PR comment as context. Run the bwd-test CI coverage to confirm that all supported patches target the correct objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100