Giter VIP home page Giter VIP logo

Comments (3)

tgymnich avatar tgymnich commented on July 29, 2024

These might help:
https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsum
https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowsum
https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnsum

from metal.jl.

maleadt avatar maleadt commented on July 29, 2024

Yeah, mapreduce is known to be slow, #46. We had sped it up at some point, but had to revert (JuliaGPU/GPUArrays.jl#454), and I haven't had the time to revisit.

Adding specializations that use MPS might be a good workaround for the common cases.

from metal.jl.

maleadt avatar maleadt commented on July 29, 2024

Regarding the performance of mapreduce: I think we're fine, see #303 (comment) for a benchmark


Regarding the allocations: I think we can close this in favor of JuliaInterop/ObjectiveC.jl#13

Basically, these aren't caused by the mapreduce implementation, but are a consequence of how the ObjectiveC object wrappers are designed (all objects being abstract types resulting in dynamic dispatch everywhere).
For example, with the simplest kernel possible:

julia> f() = @metal identity(nothing)
f (generic function with 2 methods)

julia> @time f()
  0.000177 seconds (55 allocations: 1.578 KiB)
Metal.HostKernel{typeof(identity), Tuple{Nothing}}(identity, Metal.MTL.MTLComputePipelineStateInstance (object of type AGXG15XFamilyComputePipeline))

Because of these allocations almost all coming from object instances, they are generally small and thus very fast. As such, I don't think this is a performance issue/priority right now.

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