Another MLP implementation along with multiplier support
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- python
- Domain
- machine-learning, performance
Research direction
Start by locating the LigerMLP modules and the existing fused SwiGLU/GeGLU implementation, then review multiplier support in issue #936. Compare the three proposed approaches with performance measurements; the work is done when an approach is selected, implemented, and its performance is documented.
Written by the indexing model from the issue text.
Description
🚀 The feature, motivation and pitch
Currently, LigerMLP modules only fuse swiglu/geglu computations together and leave matmuls untouched. These elementwise operations (including multiplier support #936 ) could be easily fused into matmul's epilogues. We can investigate the performance of this approach and see if we should adopt it.
TL;DR
Instead of
gate_states = self.gate_proj(x)
up_states = self.up_proj(x)
intermidiate_states = LigerSiLUMulFunction.apply(gate_states , up_states)
return self.down_proj(intermidiate_states)
There are some other approaches worth exploring:
- fuse activations (and multiplier) into gate_proj(x)
up_states = self.up_proj(x)
intermidiate_states = LigerFusedLinearActMultiplierFunction.apply(x, self.gate_proj.weight, gate_multiplier, up_states)
return self.down_proj(intermidiate_states)
- stack gate and up projections then put it into activation functions
gate_up_states = self.gate_up_proj(x)
intermidiate_states = LigerSplitStatesActMultiplierFunction.apply(
gate_up_states,
config.hidden_act,
gate_multiplier,
up_states
)
return self.down_proj(intermidiate_states)
- dual gemm with activations (and multiplier)
intermidiate_states = LigerDualGemmActMulFuncion.apply(
x,
self.gate_proj.weight,
self.up_proj.weight,
config.hidden_act,
gate_multiplier,
)
return self.down_proj(intermidiate_states)
Alternatives
No response
Additional context
No response
- 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 ·