Comments (7)
Started working on this, just fixing a few minor incompatibilities and a possibly major one effecting inplace operations in test/karray.jl
. Latest work at the dy/cudnn branch.
from knet.jl.
@jonathan-laurent The CUDA 3 compatible Knet-1.4.7 is passing tests, I will release today. The tests still seem slower but not for any simple reason I could detect. My profiling script Knet/prof/ops20.jl
gives similar timings for 1.4.6 and 1.4.7. If you have something that can help me debug performance issues I can work on it for the next release.
from knet.jl.
... hmm, and there is an issue of across the board slow-down, which may be related to aforementioned inplace operations or not. This is going to take a bit longer than I thought.
from knet.jl.
I think I observed the slow-down you mentioned. Indeed, Knet used to be 20-30% faster than Flux on my connect four benchmark. However, when I tried Knet#master with CUDA 3.3.0, it was about 20% slower than the latest version of Flux. (You should take these numbers with a grain of salt though as my measurements weren't very rigorous.)
from knet.jl.
@maleadt Knet tests with CUDA 3.0 give me some errors that I do not understand, maybe you can point me in the right direction:
First pkg"test Knet"
fails with errors of the following type when testing in-place addition:
Test threw exception
Expression: (a4 .+= a3) == (k4 .+= k3)
Scalar indexing is disallowed.
Invocation of getindex resulted in scalar indexing of a GPU array.
This is typically caused by calling an iterating implementation of a method.
Such implementations *do not* execute on the GPU, but very slowly on the CPU,
and therefore are only permitted from the REPL for prototyping purposes.
If you did intend to index this array, annotate the caller with @allowscalar.
However when I include the individual test file with include(Knet.dir("test/karray.jl"))
, I do not get an error but just a warning and the tests pass:
julia> include(Knet.dir("test/karray.jl"))
┌ Warning: Performing scalar indexing on task Task (runnable) @0x00007f338d034010.
│ Invocation of getindex resulted in scalar indexing of a GPU array.
│ This is typically caused by calling an iterating implementation of a method.
│ Such implementations *do not* execute on the GPU, but very slowly on the CPU,
│ and therefore are only permitted from the REPL for prototyping purposes.
│ If you did intend to index this array, annotate the caller with @allowscalar.
└ @ GPUArrays ~/.julia/packages/GPUArrays/8dzSJ/src/host/indexing.jl:56
Test Summary: | Pass Total
karray | 318 318
None of this happened pre-CUDA-3.x.
- Did something change with the default behavior of
allowscalar
? - Do you have any idea why
Pkg.test
would fail but including the failing test file would pass? - Finally, none of these calls should result in scalar indexing in the first place, did anything change with array indexing?
(a4 .+= a3) == (k4 .+= k3)
(a4 .= a3) == (k4 .= k3)
(a4[:] .= a3[:]) == (k4[:] .= k3[:])
(a4[:, :] .= a3) == (k4[:, :] .= k3)
from knet.jl.
Scalar iteration is now disallowed by default, but allowed with a warning in interactive sessions. This to facilitate debugging. But you can always force it to be off in your interactive session too by calling CUDA.allowscalar(false)
.
I don't recall changing iteration specifically, but lots has change since pre-3.0. Doesn't the backtrace tell you anything?
from knet.jl.
Thanks, that helps. The problem was with the ==
comparison of Array vs CuArray.
from knet.jl.
Related Issues (20)
- dropout seeds the global RNG
- MethodError: no method matching LinearIndices HOT 2
- ERROR: LoadError: KeyError: key :nw not found
- missing docstring error for "File I/O" section
- Create a DeepMap.jl package
- Knet 1.4.7: libknet8 library not found HOT 4
- LoadError: Failed to precompile Knet [1902f260-5fb4-5aff-8c31-6271790ab950] to my julia directory HOT 3
- TagBot trigger issue HOT 2
- load/save problem with CuArrays in tutorial/60.rnn.ipynb HOT 2
- Derivative of a Function That Includes @diff Macro HOT 4
- R1 Regularization HOT 9
- type DataType has no field mutable HOT 2
- Quick Start tutorial notebook is broken HOT 1
- Cannot locate artifact 'libknet8' for aarch64-linux-gnu-libgfortran5-cxx11-libstdcxx29-julia_version+1.7.1 in Docker Container on Apple Silicon HOT 9
- Fix deprecations from MLDatasets in tutorial notebooks
- Problem with conv4 on gpu HOT 4
- UndefVarError: accuracy not defined in tutorial 30.lin.ipynb HOT 1
- CuArray{Float32} in ytype raised error HOT 4
- how to use the resnet modules in example folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knet.jl.