Giter Club home page Giter Club logo

Comments (7)

denizyuret avatar denizyuret commented on August 17, 2024

Is permutedims for 4D and 5D practical? Necessary?

from knet.jl.

denizyuret avatar denizyuret commented on August 17, 2024

I am leaving this issue open for the general N-D implementation.

from knet.jl.

denizyuret avatar denizyuret commented on August 17, 2024

@ilkerkesen do we actually have a general N-D implementation (beyond 5-D) that works? If so, let's close this.

from knet.jl.

ilkerkesen avatar ilkerkesen commented on August 17, 2024

from knet.jl.

ilkerkesen avatar ilkerkesen commented on August 17, 2024

So far so good,

  1. Current implementation works correctly.
  2. Yes, it takes advantage of parallel programming, but ignores its crucial core concepts.
  3. I did have a generic implementation, couldn't have ported it into Knet, but let's discuss it later since it is going to be as slower as the current implementation.

I've looked at PyTorch's source code and I think this is the part where transpose magic happens. As different from Julia, PyTorch doesn't have a permutedims actually, it has transpose for multi-dimensional arrays also. Let's see the differences,

  • PyTorch equivalent of permutedims(a, (1, 3, 2)) is a.transpose(1, 2) (let's do not forget Python has indexes starting from zero).
  • PyTorch equivalent of permutedims(a, (3, 1, 2)) is a.transpose(0, 2).transpose(1, 2) which is cascaded.
  • PyTorch arrays are row majored. So, we need to convert that CUBLAS calls as column majored.

As a first step, I'm going to implement a transposedim operation mimicking PyTorch's transpose method. We'll discuss the remaining features later.

from knet.jl.

ilkerkesen avatar ilkerkesen commented on August 17, 2024

Caffe2 has a multi-dimensional transpose operation in the way we desire. It takes advantage of cudnn's cudnnTransformTensor kernel. I'm on it.

from knet.jl.

denizyuret avatar denizyuret commented on August 17, 2024

Solved using CuArrays under permutedims branch, please test.

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.