Git Product home page Git Product logo

Comments (7)

denizyuret avatar denizyuret commented on July 23, 2024 1

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.

denizyuret avatar denizyuret commented on July 23, 2024 1

@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.

denizyuret avatar denizyuret commented on July 23, 2024

... 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.

jonathan-laurent avatar jonathan-laurent commented on July 23, 2024

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.

denizyuret avatar denizyuret commented on July 23, 2024

@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.

maleadt avatar maleadt commented on July 23, 2024

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.

denizyuret avatar denizyuret commented on July 23, 2024

Thanks, that helps. The problem was with the == comparison of Array vs CuArray.

from knet.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.