Skip to content

add some benchmarks for remake_zero!#2608

Merged
vchuravy merged 1 commit intomainfrom
vc/remake_zero_benchmarks
Sep 22, 2025
Merged

add some benchmarks for remake_zero!#2608
vchuravy merged 1 commit intomainfrom
vc/remake_zero_benchmarks

Conversation

@vchuravy
Copy link
Member

(cherry picked from commit f19b040)

(cherry picked from commit f19b040)
@vchuravy
Copy link
Member Author

Since CI for #2607 will only pick it up from master.

Any other ideas instead of just adding deeper and deeper nestings?

@github-actions
Copy link
Contributor

Benchmark Results

main b937c2c... main / b937c2c...
basics/overhead 5.25 ± 0.01 ns 4.34 ± 0.01 ns 1.21 ± 0.0036
time_to_load 1.29 ± 0.0087 s 1.26 ± 0.012 s 1.03 ± 0.012

Benchmark Plots

A plot of the benchmark results has been uploaded as an artifact at https://github.com/EnzymeAD/Enzyme.jl/actions/runs/17926021751/artifacts/4075821771.

@wsmoses
Copy link
Member

wsmoses commented Sep 22, 2025

so my thought on how to do this properly is we should have a function make_zero_internal or something which is the user definable one (or alternatively just make_zero(x, ::Union{Nothing, IdSet}))

then the generated function for make_zero(x) has a back edge from all the other internal utilities, and does a recursion through type space until it hits primitives like above, or guaranteed_const types. Types that are active don't need the id check, only duplicated

@vchuravy vchuravy merged commit 4a74662 into main Sep 22, 2025
6 checks passed
@vchuravy vchuravy deleted the vc/remake_zero_benchmarks branch September 22, 2025 19:38
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