Skip to content

Commit 0f0f657

Browse files
committed
exp: investigate new allocations on sparse ForwardDiff Jacobian
1 parent bbc39fd commit 0f0f657

4 files changed

Lines changed: 15 additions & 261 deletions

File tree

.github/workflows/Documentation.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/Test.yml

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,14 @@ jobs:
2525
actions: write
2626
contents: read
2727
strategy:
28-
fail-fast: true # TODO: toggle
28+
fail-fast: false # TODO: toggle
2929
matrix:
3030
version:
3131
- '1.10'
3232
- '1.11'
3333
- '1.12'
3434
group:
35-
- Core/Internals
36-
- Back/DifferentiateWith
37-
- Core/SimpleFiniteDiff
38-
- Back/SparsityDetector
39-
- Core/ZeroBackends
40-
- Back/ChainRules
41-
# - Back/Diffractor
42-
- Back/Enzyme
43-
- Back/FastDifferentiation
44-
- Back/FiniteDiff
45-
- Back/FiniteDifferences
4635
- Back/ForwardDiff
47-
- Back/GTPSA
48-
- Back/Mooncake
49-
- Back/PolyesterForwardDiff
50-
- Back/ReverseDiff
51-
- Back/Symbolics
52-
- Back/Tracker
53-
- Back/Zygote
5436
skip_lts:
5537
- ${{ github.event.pull_request.draft }}
5638
skip_pre:
@@ -103,62 +85,3 @@ jobs:
10385
flags: DI
10486
token: ${{ secrets.CODECOV_TOKEN }}
10587
fail_ci_if_error: false
106-
107-
test-DIT:
108-
name: ${{ matrix.version }} - DIT (${{ matrix.group }})
109-
runs-on: ubuntu-latest
110-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
111-
timeout-minutes: 60
112-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
113-
actions: write
114-
contents: read
115-
strategy:
116-
fail-fast: true
117-
matrix:
118-
version:
119-
- '1.10'
120-
- '1.11'
121-
- '1.12'
122-
group:
123-
- Formalities
124-
- Zero
125-
- Standard
126-
- Weird
127-
skip_lts:
128-
- ${{ github.event.pull_request.draft }}
129-
skip_pre:
130-
- ${{ github.event.pull_request.draft }}
131-
exclude:
132-
- skip_lts: true
133-
version: '1.10'
134-
- skip_pre: true
135-
version: '1.12'
136-
env:
137-
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
138-
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
139-
steps:
140-
- uses: actions/checkout@v5
141-
- uses: julia-actions/setup-julia@v2
142-
with:
143-
version: ${{ matrix.version }}
144-
arch: x64
145-
- uses: julia-actions/cache@v2
146-
- name: Install dependencies & run tests
147-
run: julia --project=./DifferentiationInterfaceTest --color=yes -e '
148-
using Pkg;
149-
Pkg.Registry.update();
150-
Pkg.develop(path="./DifferentiationInterface");
151-
if ENV["JULIA_DI_PR_DRAFT"] == "true";
152-
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true, julia_args=["-O1"]);
153-
else;
154-
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true);
155-
end;'
156-
- uses: julia-actions/julia-processcoverage@v1
157-
with:
158-
directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test
159-
- uses: codecov/codecov-action@v5
160-
with:
161-
files: lcov.info
162-
flags: DIT
163-
token: ${{ secrets.CODECOV_TOKEN }}
164-
fail_ci_if_error: false

DifferentiationInterface/test/Back/ForwardDiff/benchmark.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ using Test
1111

1212
LOGGING = get(ENV, "CI", "false") == "false"
1313

14+
@info "Printing allocs"
15+
const f! = DIT.diffsquare!
16+
x, y = rand(10), zeros(9);
17+
backend = MyAutoSparse(AutoForwardDiff());
18+
prep = prepare_jacobian(f!, y, backend, x);
19+
J = similar(sparsity_pattern(prep), Float64)
20+
jacobian!(f!, y, J, prep, backend, x)
21+
22+
Profile.Allocs.clear()
23+
Profile.Allocs.@profile sample_rate = 1 jacobian!(f!, y, J, prep, backend, x)
24+
Profile.Allocs.print()
25+
26+
@info "Printing allocs done"
27+
1428
@testset verbose = true "Benchmarking static" begin
1529
filtered_static_scenarios = filter(static_scenarios(; include_batchified = false)) do scen
1630
DIT.function_place(scen) == :out && DIT.operator_place(scen) == :out

DifferentiationInterface/test/Back/ForwardDiff/test.jl

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)