Skip to content

Commit 6be0699

Browse files
authored
Merge branch 'master' into ct/small-tag
2 parents d88bf58 + d813023 commit 6be0699

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
23
on:
34
pull_request:
45
branches:
@@ -8,44 +9,39 @@ on:
89
- master
910
tags: '*'
1011
workflow_dispatch:
12+
13+
# needed to allow julia-actions/cache to delete old caches that it has created
14+
permissions:
15+
actions: write
16+
contents: read
17+
1118
jobs:
1219
test:
13-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
20+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
1421
runs-on: ${{ matrix.os }}
15-
continue-on-error: ${{ matrix.version == 'nightly' }}
1622
strategy:
1723
fail-fast: false
1824
matrix:
1925
version:
20-
- '1.6'
26+
- 'min'
27+
- 'lts'
2128
- '1'
22-
# - 'nightly'
2329
os:
2430
- ubuntu-latest
25-
arch:
26-
- x64
2731
steps:
2832
- uses: actions/checkout@v4
2933
- uses: julia-actions/setup-julia@v2
3034
with:
3135
version: ${{ matrix.version }}
32-
arch: ${{ matrix.arch }}
33-
- uses: actions/cache@v4
34-
env:
35-
cache-name: cache-artifacts
36-
with:
37-
path: ~/.julia/artifacts
38-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
39-
restore-keys: |
40-
${{ runner.os }}-test-${{ env.cache-name }}-
41-
${{ runner.os }}-test-
42-
${{ runner.os }}-
36+
- uses: julia-actions/cache@v2
4337
- uses: julia-actions/julia-buildpkg@v1
4438
- uses: julia-actions/julia-runtest@v1
4539
- uses: julia-actions/julia-processcoverage@v1
4640
- uses: codecov/codecov-action@v5
4741
with:
4842
files: lcov.info
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
fail_ci_if_error: true
4945
docs:
5046
name: Documentation
5147
runs-on: ubuntu-latest
@@ -54,6 +50,7 @@ jobs:
5450
- uses: julia-actions/setup-julia@v2
5551
with:
5652
version: '1'
53+
- uses: julia-actions/cache@v2
5754
- run: |
5855
julia --project=docs -e '
5956
using Pkg

docs/src/user/limitations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ function being differentiated):
77

88
- **The target function can only be composed of generic Julia functions.** ForwardDiff cannot propagate derivative information through non-Julia code. Thus, your function may not work if it makes calls to external, non-Julia programs, e.g. uses explicit BLAS calls instead of `Ax_mul_Bx`-style functions.
99

10+
- **The target function must be a composition of differentiable functions.** ForwardDiff can have issues to compute derivatives of functions, which are composed of at least one function, which is not differentiable in the point the derivative should be evaluated, even if the target function itself is differentiable. A simple example is `f(x) = norm(x)^2`, where `ForwardDiff.gradient(f, zeros(2))` returns a vector of `NaN`s since the Euclidean norm is not differentiable in zero. A possible solution to this issue is to, e.g., define `f(x) = sum(abs2, x)` instead. In situations, where rewriting the target function only as a composition of differentiable functions is more complicated (e.g. `f(x) = (1 + norm(x))exp(-norm(x))`)), one would need to define a custom derivative rule (see [this comment](https://github.com/JuliaDiff/ForwardDiff.jl/issues/303#issuecomment-2977990425)).
11+
1012
- **The target function must be unary (i.e., only accept a single argument).** [`ForwardDiff.jacobian`](@ref) is an exception to this rule.
1113

1214
- **The target function must be written generically enough to accept numbers of type `T<:Real` as input (or arrays of these numbers).** The function doesn't require a specific type signature, as long as the type signature is generic enough to avoid breaking this rule. This also means that any storage assigned used within the function must be generic as well (see [this comment](https://github.com/JuliaDiff/ForwardDiff.jl/issues/136#issuecomment-237941790) for an example).

0 commit comments

Comments
 (0)