-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.3.0: Performance Improvement #2
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should be more beneficial, as followed by the discussions in Jax repository, see jax-ml/jax#6584 jax-ml/jax#6681 jax-ml/jax#9298 jax-ml/jax#9342
…ce fori_loop iterations
…her for functions add `@ad_tracing_name` to most functions to assist profiling also bump to Python 3.10 BREAKING CHANGE: Now requires Python 3.10
…l rows then concat and merge
This is very similar to map + vmap (minibatch processing) as the inner loop is too complex
under `vmap`, `lax.cond` are lowered to `select_n` in HLO which leads to execution in both branches, thus fails to 1) save computation when possible; 2) prevent unexpected values to be produced/unexpected branches to be executed (defensive), thus let the non-dummy branch to be executed anyway and only rule-out garbage value at the final stage all together to try to improve performance. See google/brax#8409 for more details about unconditional executation of cond under vmap
`True` if NOT back-facing
…only one fragment per pixel
Bump minimum Python version from 3.9 to 3.10; lower minimum jax & jaxlib to 0.3.25.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is mostly a performance improvement version.
primitive_chooser
. Default implementation will use the interpolatedz
as the depth and pick the closest valid triangle, reducing the number of involving primitives from the total number of primitives to 1 for each fragment. In a benchmark, it leads to 10x speedup. See Colab here.lax.cond
to avoid extra computation andselect_n
HLO op asvmap
+cond
will convertcond
toselect
, leading to an unconditional execution of all branches. See vmap of cond's predicate results in select, leading to unexpected compute/memory use jax-ml/jax#8409loop_unroll
option which may leads to a performance improvement with the cost of compilation time. Default is 1 (no unroll) which is optimal in the tested scene (960x540, many triangles).Also
jit
withinline=True
. This may not lead to any performance improvement (or degradation though).