Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/tilegym/ops/cutile/swiglu.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ def swiglu_backward_kernel(dc, a, b, da, db, TILE_SIZE: ct.Constant[int]):
a_tile_f32 = a_tile.astype(ct.float32)
b_tile_f32 = b_tile.astype(ct.float32)

# NOTE: sigmoid is intentionally inlined here to preserve current backward
# kernel behavior and benchmark baselines. Forward already uses
# the shared `sigmoid()` helper; backward will switch to it in a follow-up
# optimization PR that re-benchmarks backward performance.
# Compute sigmoid(a) and silu(a)
sigmoid_a = 1.0 / (1.0 + ct.exp(-a_tile_f32))
sigmoid_a = sigmoid(a_tile_f32)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For such a small change, I choose not to move everything into experimental

silu_a = a_tile_f32 * sigmoid_a

# db = dc * silu(a)
Expand Down
Loading