Skip to content

Exploit band-diagonal structure in quasisep transitions for better scaling#240

Merged
dfm merged 2 commits intomainfrom
band-diag
Jul 8, 2025
Merged

Exploit band-diagonal structure in quasisep transitions for better scaling#240
dfm merged 2 commits intomainfrom
band-diag

Conversation

@dfm
Copy link
Copy Markdown
Owner

@dfm dfm commented Jul 2, 2025

This PR builds on the fact that most real applications of quasiseparable kernels have internal block diagonal structure. If we ignore this fact than the computational cost scales as the cube of the model "width" (approximately the number of kernel terms), but we can get better scaling (quadratic in width) if we exploit this structure.

Here is the scaling in model width before and after this change:

runtime

As expected, for wide models, this makes a dramatic difference in the runtime performance.

I'll note that we do end up paying a non-trivial compile time cost:

compile

But I think that that's probably worth it.

(Note that in all these examples I've set the environment variable: XLA_FLAGS=--xla_backend_extra_options=xla_cpu_small_while_loop_byte_threshold=1000000.)

In this PR, I'll enable the new behavior by default, but we could consider adding an option to disable it.

@dfm dfm merged commit 190c0ec into main Jul 8, 2025
8 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.

1 participant