Commit 1c013e2
[Feature] Use Liger's Relu_Squared kernel for Nemotron models (#1176)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Use relu_squared in nemotron.
This PR is generated using the liger-autopatch skill and tests the
changes in #1177 .
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->
Class patching and instance patching of relu_squared function.
## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->
<!--
Replace BLANK with your device type. For example, A100-80G-PCIe
Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them.
-->
- Hardware Type: H100
- [x] run `make test` to ensure correctness
- [x] run `make checkstyle` to ensure code style
- [x] run `make test-convergence` to ensure convergence
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f16c9f7 commit 1c013e2
File tree
3 files changed
+22
-6
lines changed- src/liger_kernel/transformers
- test/transformers
3 files changed
+22
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| 752 | + | |
751 | 753 | | |
752 | 754 | | |
753 | 755 | | |
| |||
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
763 | 764 | | |
764 | 765 | | |
| 766 | + | |
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| |||
776 | 778 | | |
777 | 779 | | |
778 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
779 | 784 | | |
780 | 785 | | |
781 | 786 | | |
| |||
784 | 789 | | |
785 | 790 | | |
786 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
787 | 797 | | |
788 | 798 | | |
789 | 799 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3275 | 3275 | | |
3276 | 3276 | | |
3277 | 3277 | | |
| 3278 | + | |
3278 | 3279 | | |
3279 | 3280 | | |
3280 | 3281 | | |
| |||
3292 | 3293 | | |
3293 | 3294 | | |
3294 | 3295 | | |
| 3296 | + | |
| 3297 | + | |
3295 | 3298 | | |
3296 | 3299 | | |
3297 | | - | |
3298 | 3300 | | |
3299 | 3301 | | |
3300 | 3302 | | |
3301 | 3303 | | |
3302 | 3304 | | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
3303 | 3309 | | |
3304 | 3310 | | |
3305 | 3311 | | |
| |||
0 commit comments