Skip to content

Batched push#2763

Merged
wsmoses merged 2 commits intomainfrom
bp
Nov 11, 2025
Merged

Batched push#2763
wsmoses merged 2 commits intomainfrom
bp

Conversation

@wsmoses
Copy link
Member

@wsmoses wsmoses commented Nov 10, 2025

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic main) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/array.jl b/test/array.jl
index ca5233a9..a830aae3 100644
--- a/test/array.jl
+++ b/test/array.jl
@@ -203,50 +203,50 @@ for RTA in (false, true)
     @test x ≈ [2.3, 2.0]
 
 
-    function pusher_ref(x, y, z)
-        push!(x, y[])
-        z[] = x[1] + x[2]
-        nothing
-    end
-
-    yr = Ref(2.0)
-    dyr = Ref(0.0)
-    dyr2 = Ref(0.0)
+        function pusher_ref(x, y, z)
+            push!(x, y[])
+            z[] = x[1] + x[2]
+            nothing
+        end
 
-    zr = Ref(2.0)
-    dzr = Ref(1.0)
-    dzr2 = Ref(2.7)
+        yr = Ref(2.0)
+        dyr = Ref(0.0)
+        dyr2 = Ref(0.0)
+
+        zr = Ref(2.0)
+        dzr = Ref(1.0)
+        dzr2 = Ref(2.7)
+
+        x = [2.3]
+        dx = [0.0]
+        dx2 = [0.0]
+        rf = @static if VERSION < v"1.11-"
+            nothing
+        else
+            dx.ref.mem
+        end
 
-    x = [2.3]
-    dx = [0.0]
-    dx2 = [0.0]
-    rf = @static if VERSION < v"1.11-"
-        nothing
-    else
-        dx.ref.mem
-    end
+        rf2 = @static if VERSION < v"1.11-"
+            nothing
+        else
+            dx2.ref.mem
+        end
 
-    rf2 = @static if VERSION < v"1.11-"
-        nothing
-    else
-        dx2.ref.mem
-    end
+        Enzyme.autodiff(set_runtime_activity(Reverse, RTA), pusher_ref, BatchDuplicated(x, (dx, dx2)), BatchDuplicated(yr, (dyr, dyr2)), BatchDuplicated(zr, (dzr, dzr2)))
 
-    Enzyme.autodiff(set_runtime_activity(Reverse, RTA), pusher_ref, BatchDuplicated(x, (dx, dx2)), BatchDuplicated(yr, (dyr, dyr2)), BatchDuplicated(zr, (dzr, dzr2)))
+        @test 1.0 ≈ dyr[]
+        @test 2.7 ≈ dyr2[]
 
-    @test 1.0 ≈ dyr[]
-    @test 2.7 ≈ dyr2[]
-    
-    @static if VERSION < v"1.11-"
-        @test dx ≈ [1.0]
-        @test dx2 ≈ [2.7]
-    else
-        @test dx ≈ [0.0, 0.0]
-        @test dx2 ≈ [0.0, 0.0]
-        @test rf ≈ [1.0]
-        @test rf2 ≈ [2.7]
-    end
-    @test x ≈ [2.3, 2.0]
+        @static if VERSION < v"1.11-"
+            @test dx ≈ [1.0]
+            @test dx2 ≈ [2.7]
+        else
+            @test dx ≈ [0.0, 0.0]
+            @test dx2 ≈ [0.0, 0.0]
+            @test rf ≈ [1.0]
+            @test rf2 ≈ [2.7]
+        end
+        @test x ≈ [2.3, 2.0]
 
     function double_push(x)
         a = [0.5]

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

Benchmark Results

main 9602cd9... main / 9602cd9...
basics/make_zero/namedtuple 0.0531 ± 0.0028 μs 0.0535 ± 0.0026 μs 0.991 ± 0.072
basics/make_zero/struct 0.256 ± 0.0067 μs 0.257 ± 0.0065 μs 0.995 ± 0.036
basics/overhead 4.64 ± 0.011 ns 4.34 ± 0.01 ns 1.07 ± 0.0035
basics/remake_zero!/namedtuple 0.243 ± 0.0067 μs 0.243 ± 0.0071 μs 1 ± 0.04
basics/remake_zero!/struct 0.233 ± 0.0073 μs 0.232 ± 0.0081 μs 1 ± 0.047
fold_broadcast/multidim_sum_bcast/1D 10.4 ± 1.7 μs 10.3 ± 0.25 μs 1.01 ± 0.17
fold_broadcast/multidim_sum_bcast/2D 12.1 ± 0.25 μs 12.1 ± 0.26 μs 0.997 ± 0.03
time_to_load 1.25 ± 0.0021 s 1.26 ± 0.017 s 0.991 ± 0.013

Benchmark Plots

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

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.92%. Comparing base (7e3d060) to head (9602cd9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2763   +/-   ##
=======================================
  Coverage   68.91%   68.92%           
=======================================
  Files          58       58           
  Lines       19861    19861           
=======================================
+ Hits        13688    13689    +1     
+ Misses       6173     6172    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wsmoses wsmoses merged commit 6b30dda into main Nov 11, 2025
48 of 50 checks passed
@wsmoses wsmoses deleted the bp branch November 11, 2025 17:04
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