Skip to content

Commit

Permalink
Compile GLU (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
josejg authored Mar 22, 2024
1 parent 3348b59 commit 26a5fd4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llmfoundry/models/layers/ffn.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def __init__(
**self.fc_kwargs,
)

@torch.compile
def forward(self, x: torch.Tensor) -> torch.Tensor:
return self.down_proj(self.act(self.gate_proj(x)) * self.up_proj(x))

Expand Down

0 comments on commit 26a5fd4

Please sign in to comment.