This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BinaryProvider # requires BinaryProvider 0.3.0 or later | |
| # Parse some basic command-line arguments | |
| const verbose = "--verbose" in ARGS | |
| const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) | |
| products = [ | |
| LibraryProduct(prefix, ["libfftw3"], :libfftw3), | |
| LibraryProduct(prefix, ["libfftw3f"], :libfftw3f), | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BinaryProvider # requires BinaryProvider 0.3.0 or later | |
| # Parse some basic command-line arguments | |
| const verbose = "--verbose" in ARGS | |
| const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) | |
| products = [ | |
| LibraryProduct(["libfftw3"], :libfftw3), | |
| LibraryProduct(["libfftw3f"], :libfftw3f), | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ strace -e trace=stat,lstat,open,close julia | |
| open("/home/sabae/local/dist/julia-release-1.2/bin/../lib/tls/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/home/sabae/local/dist/julia-release-1.2/bin/../lib/tls/x86_64", 0x7ffc823f5290) = -1 ENOENT (No such file or directory) | |
| open("/home/sabae/local/dist/julia-release-1.2/bin/../lib/tls/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/home/sabae/local/dist/julia-release-1.2/bin/../lib/tls", 0x7ffc823f5290) = -1 ENOENT (No such file or directory) | |
| open("/home/sabae/local/dist/julia-release-1.2/bin/../lib/x86_64/libjulia.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
| stat("/home/sabae/local/dist/julia-release-1.2/bin/../lib/x86_64", 0x7ffc823f5290) = -1 ENOENT (No such file or directory) | |
| open("/home/sabae/local/dist/julia-release-1.2/bin/../lib/libjulia.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| close(3) = 0 | |
| open("/home/sabae/local/dist/julia-release |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Base.Threads | |
| function softmax!(out::AbstractVecOrMat{T}, xs::AbstractVecOrMat{T}) where {T} | |
| # Remove `@threads` for non-threading timing | |
| @inbounds @threads for j = 1:size(xs, 2) | |
| # First, store column-wise maximum in the last element of `out` | |
| out[end, j] = xs[end, j] | |
| @inbounds for i = 1:(size(xs, 1) - 1) | |
| out[end, j] = max(out[end, j], xs[i, j]) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| ## Helper script to turn an `https://` clone of a github repository into something that you | |
| ## can push from. Supports both invocation as `github_remote`, as well as with an optional | |
| ## username, to add a particular user's fork as a remote, e.g. `github_remote avik-pal`. | |
| ORIGIN_URL=$(git remote get-url origin 2>/dev/null) | |
| if [[ -z "${ORIGIN_URL}" ]]; then | |
| echo "ERROR: No origin remote?!" | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct CachedConv | |
| conv::Conv | |
| cache::Ref{Tuple} | |
| end | |
| CachedConv(c::Conv) = CachedConv(c, ()) | |
| Flux.@treelike CachedConv | |
| function (m::CachedConv)(x::AbstractArray) | |
| # Has the user changed batch size on us? If so, clear our cache and re-up! | |
| if !isempty(m.cache[]) && size(m.cache[][2], 4) != size(x, 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Zygote, Statistics, Flux | |
| # We modify (the implementation of) batchnorm to be more ammenable to CPUs pretending to be TPUs. | |
| struct ZygoteBatchNorm{F,V,W} | |
| λ::F # activation function | |
| β::V # bias | |
| γ::V # scale | |
| μ::W # moving mean | |
| σ::W # moving std | |
| ϵ::Float32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| function red_echo() | |
| { | |
| tput setaf 1 | |
| echo "$*" | |
| tput sgr0 | |
| } | |
| if [[ "$*" == *--help* ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using NNlib, BenchmarkTools, JLD2 | |
| BenchmarkTools.DEFAULT_PARAMETERS.seconds = 1.0 | |
| results = Dict() | |
| idx = 0 | |
| total_trials = 2*2*2*2*2*2*2 | |
| # Note; this only works if you've run this with --project={old,new} | |
| version = basename(unsafe_string(Base.JLOptions().project)) |