Relax! Flux is the ML library that doesn't make you tensor
Go to file
bors[bot] 9ebbe8cb4c
Merge #1141
1141: Speedup matmul of CuMatrix and OneHotMatrix r=CarloLucibello a=AStupidBear

This solves #189.

```julia
julia> using Flux


julia> using Flux: CuArrays

julia> A = zeros(300, 10000) |> gpu;

julia> B = Flux.onehotbatch(rand(1:10000, 256), 1:10000) |> gpu;

julia> A * B; CuArrays.@time A * B;
┌ Warning: Performing scalar operations on GPU arrays: This is very slow, consider disallowing these operations with `allowscalar(false)`
└ @ GPUArrays ~/shared/.julia/packages/GPUArrays/OXvxB/src/host/indexing.jl:43
  0.002824 seconds (951 CPU allocations: 38.156 KiB) (2 GPU allocations: 301.000 KiB, 2.32% gc time of which 46.42% spent allocating)

julia> import Base: *

julia> A::AbstractMatrix * B::Flux.OneHotMatrix = @inbounds A[:, map(x->x.ix, B.data)]
* (generic function with 522 methods)

julia> A * B; CuArrays.@time A * B;
  0.000343 seconds (169 CPU allocations: 5.000 KiB) (2 GPU allocations: 301.000 KiB, 15.53% gc time of which 65.97% spent allocating)
```

Co-authored-by: Yao Lu <luyaocns@gmail.com>
2020-06-06 17:00:01 +00:00
.github Update pull_request_template.md 2020-05-27 12:12:13 +01:00
docs Merge #1208 2020-06-05 09:17:12 +00:00
paper use https instead of http for web links 2019-04-25 11:04:03 +00:00
src Merge #1141 2020-06-06 17:00:01 +00:00
test Merge #1177 2020-05-21 14:33:20 +00:00
.gitattributes Restore purity 2019-09-08 16:15:35 +01:00
.gitignore modernize documentation 2019-01-10 15:06:11 +01:00
.gitlab-ci.yml test on julia 1.3+ 2020-01-13 13:45:40 +05:30
.travis.yml yaml syntax fix 2020-05-04 18:01:33 +05:30
CITATION.bib Create CITATION.bib 2019-05-04 18:49:19 -04:00
LICENSE.md Update LICENSE.md 2019-04-15 16:59:16 -04:00
Manifest.toml CompatHelper: add new compat entry for "Functors" at version "0.1" 2020-05-13 00:13:46 +00:00
NEWS.md add news 2020-05-19 16:34:28 +05:30
Project.toml Merge #1133 2020-05-15 17:15:07 +00:00
README.md Update README.md 2019-12-19 09:44:17 -05:00
bors.toml bump version to 10.1 2020-01-13 13:41:25 +05:30

README.md

Build Status DOI

Flux is an elegant approach to machine learning. It's a 100% pure-Julia stack, and provides lightweight abstractions on top of Julia's native GPU and AD support. Flux makes the easy things easy while remaining fully hackable.

] add Flux

See the documentation or the model zoo for examples.

If you use Flux in your research, please cite our work.