Skip to content

use LigerCrossEntropy loss with reduction=sum#578

Closed
thisisatharva-rh wants to merge 3 commits into
instructlab:mainfrom
thisisatharva-rh:lk-fix
Closed

use LigerCrossEntropy loss with reduction=sum#578
thisisatharva-rh wants to merge 3 commits into
instructlab:mainfrom
thisisatharva-rh:lk-fix

Conversation

@thisisatharva-rh

Copy link
Copy Markdown
Collaborator

Currently, we are using torch.nn.CrossEntropyLoss(reduction=sum) with LK to facilitate multipack sampling, which leads to some weird behaviours as reported here. This PR enables us to use LigerCrossEntropyLoss with the multi-pack sampler, and solves the incorrect loss issue.

@mergify mergify Bot added the ci-failure label May 29, 2025

@JamesKunstle JamesKunstle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a reasonable fix.

@JamesKunstle

JamesKunstle commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

@thisisatharva-rh fix your linting and DCO. To fix DCO just use git commit -s --amend --no-edit; git push -f <your-fork> lk-fix which will update your commit but add your DCO signature

@mergify

mergify Bot commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. @thisisatharva-rh please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@thisisatharva-rh

Copy link
Copy Markdown
Collaborator Author

Closing due to some git-tree issues while rebasing, opened #609 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants