Skip to content

Commit fe1c9d7

Browse files
committed
merge branch 'master' into n-arity-v4
2 parents acbef0f + 4c9508f commit fe1c9d7

File tree

3 files changed

+12
-60
lines changed

3 files changed

+12
-60
lines changed

.github/workflows/benchmark_pr.yml

Lines changed: 8 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,14 @@
1-
name: Benchmark a pull request
2-
1+
name: Benchmark this PR
32
on:
43
pull_request_target:
5-
branches:
6-
- master
7-
4+
branches: [master]
85
permissions:
96
pull-requests: write
107

118
jobs:
12-
generate_plots:
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- uses: actions/checkout@v2
17-
- uses: julia-actions/setup-julia@v1
18-
with:
19-
version: "1"
20-
- uses: julia-actions/cache@v1
21-
- name: Extract Package Name from Project.toml
22-
id: extract-package-name
23-
run: |
24-
PACKAGE_NAME=$(grep "^name" Project.toml | sed 's/^name = "\(.*\)"$/\1/')
25-
echo "::set-output name=package_name::$PACKAGE_NAME"
26-
- name: Build AirspeedVelocity
27-
env:
28-
JULIA_NUM_THREADS: 2
29-
run: |
30-
# Lightweight build step, as sometimes the runner runs out of memory:
31-
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.add(;url="https://github.com/MilesCranmer/AirspeedVelocity.jl.git")'
32-
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.build("AirspeedVelocity")'
33-
- name: Add ~/.julia/bin to PATH
34-
run: |
35-
echo "$HOME/.julia/bin" >> $GITHUB_PATH
36-
- name: Run benchmarks
37-
run: |
38-
echo $PATH
39-
ls -l ~/.julia/bin
40-
mkdir results
41-
benchpkg ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --url=${{ github.event.repository.clone_url }} --bench-on="${{github.event.pull_request.head.sha}}" --output-dir=results/ --tune --exeflags="-O3 --threads=auto"
42-
- name: Create markdown table from benchmarks
43-
run: |
44-
benchpkgtable ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --input-dir=results/ --ratio > table.md
45-
echo '### Benchmark Results' > body.md
46-
echo '' >> body.md
47-
echo '' >> body.md
48-
cat table.md >> body.md
49-
echo '' >> body.md
50-
- name: Find Comment
51-
uses: peter-evans/find-comment@v2
52-
id: fcbenchmark
53-
with:
54-
issue-number: ${{ github.event.pull_request.number }}
55-
comment-author: 'github-actions[bot]'
56-
body-includes: Benchmark Results
57-
58-
- name: Comment on PR
59-
uses: peter-evans/create-or-update-comment@v3
60-
with:
61-
comment-id: ${{ steps.fcbenchmark.outputs.comment-id }}
62-
issue-number: ${{ github.event.pull_request.number }}
63-
body-path: body.md
64-
edit-mode: replace
9+
bench:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
13+
with:
14+
julia-version: '1'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Optim = "0.19, 1"
3838
PrecompileTools = "1"
3939
Reexport = "1"
4040
SymbolicUtils = "0.19, ^1.0.5, 2, 3"
41-
Zygote = "0.6"
41+
Zygote = "0.7"
4242
julia = "1.10"
4343

4444
[extras]

src/ChainRules.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ using ChainRulesCore:
77
ZeroTangent,
88
Tangent,
99
@thunk,
10+
unthunk,
1011
canonicalize
1112
using ..OperatorEnumModule: OperatorEnum
1213
using ..NodeModule: AbstractExpressionNode, with_type_parameters, tree_mapreduce
@@ -52,7 +53,8 @@ struct EvalPullback{N,A,O} <: Function
5253
end
5354

5455
# TODO: Preferable to use the primal in the pullback somehow
55-
function (e::EvalPullback)((dY, _))
56+
function (e::EvalPullback)((thunked_dY, _))
57+
dY = unthunk(thunked_dY)
5658
_, dX_constants_dY, complete = eval_grad_tree_array(
5759
e.tree, e.X, e.operators; variable=Val(:both)
5860
)

0 commit comments

Comments
 (0)