Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big interface overhaul #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,61 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinaryProvider]]
deps = ["Libdl", "SHA"]
git-tree-sha1 = "5b08ed6036d9d3f0ee6369410b830f8873d4024c"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.8"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[NNPACK_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "c3d1a616362645754b18e12dbba96ec311b0867f"
uuid = "a6bfbf70-4841-5cb9-aa18-3a8ad3c413ee"
version = "2018.6.22+0"

[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -29,6 +72,9 @@ uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -37,6 +83,13 @@ uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.6.4"
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NNPACK_jll = "a6bfbf70-4841-5cb9-aa18-3a8ad3c413ee"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

Expand Down
50 changes: 0 additions & 50 deletions deps/build.jl

This file was deleted.

54 changes: 29 additions & 25 deletions src/NNlib.jl
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
module NNlib
using Requires

# Include APIs
include("dim_helpers.jl")
# Start with the simplest stuff in here; activation functions
include("activation/activation.jl")
include("activation/softmax.jl")

# NNPACK support
include(joinpath(@__DIR__, "..", "deps", "deps.jl"))
if check_deps() == nothing
include("nnpack/NNPACK.jl")
else
is_nnpack_available() = false
end
# Load dimensionality helpers for convolution dispatching
include("dim_helpers/dim_helpers.jl")

# Define our convolution/pooling interface backend holders
include("interface.jl")

include("activation.jl")
include("softmax.jl")
include("gemm.jl")
include("conv.jl")
include("pooling.jl")
# Begin with straightforward direct implementations
include("direct/direct.jl")
# Next, im2col implementations
include("im2col/im2col.jl")

## Include implementations
include("impl/padding_edges.jl")
# Next, NNPACK implementations
using NNPACK_jll

# Direct implementations of convolutional and depthwise-convolutional algorithms
include("impl/conv_direct.jl")
include("impl/depthwiseconv_direct.jl")
# im2col implementations of convolutional and depthwise-convolutional algorithms
include("impl/conv_im2col.jl")
include("impl/depthwiseconv_im2col.jl")
# Check to see if NNPACK_jll is loadable
if isdefined(NNPACK_jll, :libnnpack)
include("nnpack/NNPACK.jl")
else
# Otherwise, signal to the rest of the world that this is unavailable
"""
is_nnpack_available()

Checks if the current platform/hardware is supported by NNPACK.
Your platform sadly, is not supported by NNPACK.
"""
is_nnpack_available() = false
end

# Direct implementations of pooling
include("impl/pooling_direct.jl")
# Finally, generate all the goodies for conv() and maxpool() and friends!
include("interface_impl.jl")

end # module NNlib
2 changes: 2 additions & 0 deletions src/activation.jl → src/activation/activation.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Requires

export σ, sigmoid, relu, leakyrelu, elu, gelu, swish, selu, softplus, softsign, logσ,
logsigmoid, logcosh, mish

Expand Down
File renamed without changes.
181 changes: 0 additions & 181 deletions src/conv.jl

This file was deleted.

File renamed without changes.
Loading