Skip to content
Discussion options

You must be logged in to vote

XLA does CSE among other optimizations, and I suspect that it will do something like it here, but it gives no universal guarantees to this end. Compiler optimizations often consider trading off various resources (e.g. memory vs. computation). In principle they could even decide to carry out redundant computation, e.g. in order to re-materialize an intermediate value rather than holding it in memory while scheduling other operations.

As for how to find out post hoc whether an optimization seems to have taken place, you're right to consider profiling tools, XLA output, or even timing against expectations. But note again that, in principle, even for a fixed JAX-side program, the compiler's c…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@n2cholas
Comment options

@tetterl
Comment options

@froystig
Comment options

Answer selected by n2cholas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants