Skip to content

feat: swiglu simple math changes for perf upgrades#77

Merged
hannahli-nv merged 4 commits intoNVIDIA:mainfrom
aghilann:swg-bwd
Mar 17, 2026
Merged

feat: swiglu simple math changes for perf upgrades#77
hannahli-nv merged 4 commits intoNVIDIA:mainfrom
aghilann:swg-bwd

Conversation

@aghilann
Copy link
Copy Markdown
Contributor

@aghilann aghilann commented Mar 13, 2026

swiglu-backward-hidden2048-float32

M Old (GB/s) New (GB/s) Speedup
1024 419.800 422.132 1.01x
2048 382.291 381.183 1.00x
4096 354.884 354.570 1.00x
8192 326.927 353.063 1.08x
16384 345.202 330.987 0.99x

Avg Speedup: 1.02x


swiglu-backward-hidden4096-float32

M Old (GB/s) New (GB/s) Speedup
1024 349.163 343.402 0.98x
2048 342.355 321.585 0.94x
4096 331.145 345.983 1.04x
8192 343.890 342.923 1.00x
16384 333.262 353.621 1.06x

Avg Speedup: 1.00x


swiglu-backward-hidden2048-bfloat16

M Old (GB/s) New (GB/s) Speedup
1024 384.610 383.441 1.00x
2048 414.323 417.415 1.01x
4096 380.222 382.472 1.01x
8192 354.887 353.713 1.00x
16384 352.217 353.068 1.00x

Avg Speedup: 1.00x


swiglu-backward-hidden4096-bfloat16

M Old (GB/s) New (GB/s) Speedup
1024 369.999 412.272 1.11x
2048 326.090 379.439 1.16x
4096 327.641 352.632 1.08x
8192 332.303 351.517 1.06x
16384 333.074 352.809 1.06x

Avg Speedup: 1.09x

Description

CI Configuration

config:
  build: true
  # valid options are "ops", "benchmark", and "sanity"
  test: ["ops", "benchmark"]

Checklist

  • Code formatted and imports sorted via repo specifications (./format.sh)
  • Documentation updated (if needed)
  • CI configuration reviewed

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Mar 13, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

sigmoid_a = 1.0 / (1.0 + ct.exp(-a_tile_f32))
silu_a = a_tile_f32 * sigmoid_a
# Reuse shared helpers for consistent math path with forward.
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

@hannahli-nv
Copy link
Copy Markdown
Collaborator

/ok to test d18aaac

Comment thread src/tilegym/ops/cutile/swiglu.py Outdated
aghilann and others added 2 commits March 17, 2026 01:00
Co-authored-by: hannahli <165050866+hannahli-nv@users.noreply.github.com>
@hannahli-nv
Copy link
Copy Markdown
Collaborator

/ok to test baa63e7

@hannahli-nv hannahli-nv merged commit ea692b5 into NVIDIA:main Mar 17, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants