Skip to content

Commit

Permalink
Merge branch 'master' into sds/move_nnlib
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonschaub committed Dec 8, 2020
2 parents 3299f7a + bfba50c commit fd60d1d
Show file tree
Hide file tree
Showing 18 changed files with 155 additions and 185 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI
# env:
# JULIA_NUM_THREADS: 2
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.3' # Replace this with the minimum Julia version that your package supports.
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
# include:
# - os: windows-latest
# version: '1'
# arch: x64
# - os: macOS-latest
# version: '1'
# arch: x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
# `allow-failure` not available yet https://github.com/actions/toolkit/issues/399
continue-on-error: ${{ matrix.version == 'nightly' }} # comment out to report nightly failures
- uses: julia-actions/julia-runtest@v1
continue-on-error: ${{ matrix.version == 'nightly' }} # comment out to report nightly failures
- uses: julia-actions/julia-processcoverage@v1
continue-on-error: ${{ matrix.version == 'nightly' }} # comment out to report nightly failures
- uses: codecov/codecov-action@v1
continue-on-error: ${{ matrix.version == 'nightly' }} # comment out to report nightly failures
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using Zygote
doctest(Zygote)' # change MYPACKAGE to the name of your package
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
21 changes: 6 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
include:
- 'https://raw.githubusercontent.com/JuliaGPU/gitlab-ci/master/templates/v6.yml'

image: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04

julia:1.4:
extends:
- .julia:1.4
- .test
tags:
- nvidia

julia:1.5:
extends:
- .julia:1.5
Expand All @@ -25,9 +16,9 @@ julia:nightly:
- nvidia
allow_failure: true

documentation:
extends:
- .julia:1.4
- .documentation
tags:
- nvidia
# documentation:
# extends:
# - .julia:1.4
# - .documentation
# tags:
# - nvidia
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

16 changes: 13 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Future = "9fa8497b-333b-5362-9e8d-4d0656e87820"
IRTools = "7869d1d1-7146-5819-86e3-90919afe41df"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -24,15 +23,26 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[compat]
AbstractFFTs = "0.5"
ChainRules = "0.7.16"
ChainRules = "0.7.34"
DiffRules = "1.0"
FillArrays = "0.8, 0.9, 0.10"
ForwardDiff = "0.10"
IRTools = "0.4"
LoopVectorization = "0.8.15"
LoopVectorization = "0.8.15, 0.9"
MacroTools = "0.5"
NaNMath = "0.3"
Requires = "0.5, 1.0"
SpecialFunctions = "0.10, 1.0"
ZygoteRules = "0.2"
julia = "1.3"

[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["CUDA", "Distances", "FFTW", "FiniteDifferences", "StatsFuns", "Test"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<img width="400px" src="https://raw.githubusercontent.com/FluxML/fluxml.github.io/master/zygote.png"/>
</p>

[![Build Status](https://travis-ci.org/FluxML/Zygote.jl.svg?branch=master)](https://travis-ci.org/FluxML/Zygote.jl) [![Dev Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://fluxml.ai/Zygote.jl/dev)
<!-- [![Build Status](https://travis-ci.org/FluxML/Zygote.jl.svg?branch=master)](https://travis-ci.org/FluxML/Zygote.jl) -->
![CI Testing](https://github.com/FluxML/Zygote.jl/workflows/CI/badge.svg)
[![Dev Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://fluxml.ai/Zygote.jl/dev)

`] add Zygote`

Expand Down
46 changes: 0 additions & 46 deletions appveyor.yml

This file was deleted.

26 changes: 13 additions & 13 deletions examples/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinDeps]]
deps = ["Libdl", "Pkg", "SHA", "URIParser", "Unicode"]
git-tree-sha1 = "46cf2c1668ad07aba5a9d331bdeea994a1f13856"
git-tree-sha1 = "1289b57e8cf019aede076edab0587eb9644175bd"
uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
version = "1.0.1"
version = "1.0.2"

[[BinaryProvider]]
deps = ["Libdl", "Logging", "SHA"]
Expand Down Expand Up @@ -113,15 +113,15 @@ uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[DiffResults]]
deps = ["StaticArrays"]
git-tree-sha1 = "da24935df8e0c6cf28de340b958f6aac88eaa0cc"
git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.0.2"
version = "1.0.3"

[[DiffRules]]
deps = ["NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "eb0c34204c8410888844ada5359ac8b96292cfd1"
git-tree-sha1 = "214c3fcac57755cfda163d91c58893a8723f93e9"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.0.1"
version = "1.0.2"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
Expand Down Expand Up @@ -152,9 +152,9 @@ version = "0.9.0"

[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "1d090099fb82223abc48f7ce176d3f7696ede36d"
git-tree-sha1 = "67d5fdd067626132aa9e7d2830ee9cdd09018775"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.12"
version = "0.10.13"

[[GPUArrays]]
deps = ["Adapt", "FFTW", "FillArrays", "LinearAlgebra", "Printf", "Random", "Serialization", "Test"]
Expand Down Expand Up @@ -235,9 +235,9 @@ uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
version = "0.6.6"

[[NaNMath]]
git-tree-sha1 = "c84c576296d0e2fbb3fc134d3e09086b3ea617cd"
git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.4"
version = "0.3.5"

[[OrderedCollections]]
git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db"
Expand Down Expand Up @@ -315,9 +315,9 @@ version = "0.8.0"

[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "da4cf579416c81994afd6322365d00916c79b8ae"
git-tree-sha1 = "794e88df12426adc7eb3370b4ec3aee12f8d6911"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.12.5"
version = "1.0.0"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
Expand Down Expand Up @@ -381,4 +381,4 @@ git-tree-sha1 = "d3c2ae55d116b5360a73b1e88d1a974b446d933a"
repo-rev = "ffc50480ff8f7662110bfb82b0b6d4f9cef6e59d"
repo-url = "https://github.com/FluxML/Zygote.jl.git"
uuid = "e88e6eb3-aa80-5325-afca-941959d7151f"
version = "0.5.9+"
version = "0.5.13+"
7 changes: 1 addition & 6 deletions src/compiler/interface.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using InteractiveUtils
using InteractiveUtils: typesof
using Core: Typeof

@static if VERSION >= v"1.1"
import Base: copy!
else
import Future: copy!
end
import Base: copy!

mutable struct Context <: AContext
cache::Union{IdDict{Any,Any},Nothing}
Expand Down
6 changes: 2 additions & 4 deletions src/compiler/interface2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ end
forw = varargs!(meta, forw, 3)
# IRTools.verify(forw)
forw = slots!(pis!(inlineable!(forw)))
@static if VERSION >= v"1.3" # no edges pre-1.3
# be ready to swap to using chainrule if one is declared
cr_edge != nothing && edge!(meta, cr_edge)
end
# be ready to swap to using chainrule if one is declared
cr_edge != nothing && edge!(meta, cr_edge)
return update!(meta.code, forw)
end

Expand Down
24 changes: 2 additions & 22 deletions src/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,23 +314,8 @@ end
end
end

# LinAlg
# ======

# TODO: remove these once https://github.com/JuliaDiff/ChainRules.jl/pull/305 is merged
@adjoint function(A::AbstractMatrix * x::AbstractVector)
return A * x, Δ::AbstractVector->* x', A' * Δ)
end

@adjoint function *(x::Union{Transpose{<:Any, <:AbstractVector},
LinearAlgebra.Adjoint{<:Any, <:AbstractVector}},
y::AbstractVector)
return x * y, Δ->* y', x' * Δ)
end

@adjoint function(a::AbstractVector * x::AbstractMatrix)
return a * x, Δ::AbstractMatrix->(vec* x'), a' * Δ)
end
# LinearAlgebra
# =============

@adjoint function transpose(x)
back(Δ) = (transpose(Δ),)
Expand Down Expand Up @@ -436,11 +421,6 @@ end
end
end

function _pullback(cx::AContext, ::typeof(norm), x::AbstractArray, p::Real = 2)
fallback = (x, p) -> sum(abs.(x).^p .+ eps(0f0)) ^ (one(eltype(x)) / p) # avoid d(sqrt(x))/dx == Inf at 0
_pullback(cx, fallback, x, p)
end

# LinAlg Matrix Types
# ===================

Expand Down
Loading

0 comments on commit fd60d1d

Please sign in to comment.