linkedin / linkedin/Liger-Kernel

【FLCE】the bias in the previous layer

Open
#891 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.6k
Forks
603
Avg merge
1d 20h
Merged PRs (30d)
47

Description

I see the function LigerFusedLinearCrossEntropyLoss, I think bias and lin_weight are from the previous layer. If so, maybe `def forward(self, _input, target, lin_weight, bias=None):` is easy to understand.

```

def forward(self, lin_weight, _input, target, bias=None):
loss, z_loss = LigerFusedLinearCrossEntropyFunction.apply(
_input,
lin_weight,
target,
bias,
self.ce_weight,
self.ignore_index,
self.lse_square_scale,
self.label_smoothing,
self.reduction,
self.softcap,
self.return_z_loss,
self.accum_dtype,
)
if not self.return_z_loss:
return loss
return loss, z_loss
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at LigerFusedLinearCrossEntropyLoss.forward and compare the proposed parameter order with the arguments passed to LigerFusedLinearCrossEntropyFunction.apply. Confirm whether lin_weight and bias represent the previous layer, then ensure the public signature and its call site use an unambiguous order.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.