linkedin / linkedin/Liger-Kernel
【FLCE】the bias in the previous layer
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
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 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