Scalarized gca_gca_intersection - #1688
Draft
cmdupuis3 wants to merge 6 commits into
Draft
Conversation
Add scalar-argument L1/L2 siblings (_accux_gca_scalar, _try_gca_gca_intersection_scalar) and rewire gca_gca_intersection to them, cutting 4 heap allocations per edge to 1. Bit-identical output; ~2.7x on the function in isolation, ~1.24x on serial face bounds.
gca_gca_intersection no longer calls the array-form _accux_gca / _try_gca_gca_intersection, so benchmarking them no longer reflects the dispatcher's actual cost. Point at the scalar siblings instead, skipping gracefully (via skip_benchmark_if) on commits that predate them.
Collaborator
Author
|
pre-commit.ci autofix |
Collaborator
Author
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
ASV BenchmarkingBenchmark Comparison ResultsBenchmarks that have improved:
Benchmarks that have stayed the same:
|
This file contains hidden or 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
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.
Tangent issue to #1623, also related to #1648
Overview
The existing
gca_gca_intersectionuses fournp.ndarrayobjects of size 3. The overhead incurred by using these python objects is njit compiled loops is significant, and we get about a 2x speedup in there by scalarizinggca_gca_intersection,_try_gca_gca_intersection, and_accux_gca, and using_on_minor_arc_xyzinstead ofon_minor_arc.PR Checklist
General
Testing & Benchmarking
Documentation
docs/api.rst_)AI Disclosure
AI Usage: Claude Opus 5 / Sonnet 5