Feed Forward Networks (FFN)
About
The d9d.module.block.ffn package implements the dense feed-forward networks of Transformer blocks.
SwiGLU
SwiGLU implements the SwiGLU layer: down(SiLU(gate(x)) * up(x)).
It computes SiLU(gate(x)) * up(x) with a fused Triton kernel, so it requires a GPU supported by Triton.
Kernel Benchmarks (bf16, H100)

Usage
API Reference
d9d.module.block.ffn
Feed-forward network layers.
SwiGLU
Bases: Module, ModuleLateInit
SwiGLU feed-forward network (FFN).
Computes down(SiLU(gate(x)) * up(x)). This is the standard MLP block of architectures like LLaMA.
__init__(hidden_size, intermediate_size, bias=False)
forward(x)
reset_parameters()
Resets module parameters.