Files
13e1bbe59b [Model] Exaone4 Support (#980)
## Summary
Add Liger kernel support for EXAONE4 models (LG AI Research's EXAONE 4.0
series).

### Changes
- Add `src/liger_kernel/transformers/model/exaone4.py` with fused linear
cross entropy forward
- Add `apply_liger_kernel_to_exaone4()` function in `monkey_patch.py`
- Register in `__init__.py`
- Add `revert_liger_kernel_to_exaone4()` in `test/utils.py`
- Add convergence tests in `test/convergence/bf16/` and
`test/convergence/fp32/`

### Supported Kernels
- RMSNorm (including QK-Norm in attention)
- SwiGLU MLP
- RoPE
- Fused Linear Cross Entropy

### Note on in_place=False for RMSNorm
EXAONE4 requires `in_place=False` for RMSNorm due to its attention
implementation pattern:
```python
# EXAONE4 pattern - separate assignment
query_states = self.q_proj(hidden_states).view(...).transpose(1, 2)
query_states = self.q_norm(query_states)  # reassignment to same variable

# vs Qwen3 pattern - chained
query_states = self.q_norm(self.q_proj(hidden_states).view(...)).transpose(1, 2)
```

The view/transpose operations share storage with the original tensor.
In-place modification corrupts the autograd graph, causing NaN
gradients.

### References
- Model: https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-1.2B

## Testing Done
- 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: Sunghyun Cho <[email protected]>
Co-authored-by: Steven Shimizu <[email protected]>
2026-01-07 12:58:04 -08:00
..
2024-08-06 18:44:05 +00:00
2026-01-07 12:58:04 -08:00