Skip to content

Conversation

@mcgibbon
Copy link
Contributor

@mcgibbon mcgibbon commented Feb 10, 2026

This PR updates the conditional sfno FourierNeuralOperatorBlock and its children to pass Timer contexts.

These will be used in a later PR to perform CUDA profiling. For now, they are added without breaking changes to the code.

Changes:

  • Updated conditional SFNO FourierNeuralOperatorBlock and its dependents to pass timer: Timer arguments during forward pass and use them to record times during code segments.

  • Tests added

@mcgibbon
Copy link
Contributor Author

mcgibbon commented Feb 10, 2026

These contexts are used more fully in the benchmarking branch #803, getting merged in parts. See that PR for an example plot of the timing split.

Copy link
Contributor

@Arcomano1234 Arcomano1234 left a comment

Choose a reason for hiding this comment

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

Left 1 comment but it LGTM

assert(x.shape[-1] == self.mmax)

with torch.autocast("cuda", enabled=False):
with timer.child("contraction"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend for both the SHT and ISHT to have the same contraction timer?

Copy link
Contributor Author

@mcgibbon mcgibbon Feb 10, 2026

Choose a reason for hiding this comment

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

Because of how child timers are nested, these are distinct timers, stored and plotted separately. But yes, I did intend the same name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that makes sense I didn't look too closely at the timers PR and just wanted to make sure

Base automatically changed from feature/cuda_timer to main February 10, 2026 21:40
@mcgibbon mcgibbon enabled auto-merge (squash) February 10, 2026 22:22
@mcgibbon mcgibbon merged commit 81987f2 into main Feb 10, 2026
7 checks passed
@mcgibbon mcgibbon deleted the feature/sfno_timers branch February 10, 2026 22:40
jpdunc23 added a commit that referenced this pull request Feb 12, 2026
jpdunc23 added a commit that referenced this pull request Feb 12, 2026
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