Coder Social home page Coder Social logo

Add CudaBytes about cudarc HOT 8 CLOSED

coreylowman avatar coreylowman commented on August 28, 2024
Add CudaBytes

from cudarc.

Comments (8)

coreylowman avatar coreylowman commented on August 28, 2024 1

I'm envisioning a single workspace held in Cuda, that all conv ops shared. It would be re-allocated if a bigger workspace is needed. So after the first forward pass it would be the size of the biggest workspace, and then any subsequent passes wouldn't have to re-allocate

from cudarc.

M1ngXU avatar M1ngXU commented on August 28, 2024

what's the difference to CudaSlice?

from cudarc.

coreylowman avatar coreylowman commented on August 28, 2024

Not much, only that it wouldn't have a type generic on it. Although now that I think about it, we probably don't need this. What we really need is a way to reinterpret a CudaSlice<T> into another type.

What i'd like to do for workspaces is store a CudaSlice<u8> on Cuda, and then grab a view of those bytes as another type.

So maybe something like:

let mut workspace: CudaSlice<u8> = ...;
let _: CudaView<'_, f32> = workspace.transmute()

from cudarc.

M1ngXU avatar M1ngXU commented on August 28, 2024

ah ok; why not directly store it as f32 (dtype)?

from cudarc.

coreylowman avatar coreylowman commented on August 28, 2024

Because it needs to support f16, f32, and f64 dtypes, and the device won't necessarily know which one since it doesn't have a dtype generic on it (and I'd prefer not to add it).

from cudarc.

M1ngXU avatar M1ngXU commented on August 28, 2024

Because it needs to support f16, f32, and f64 dtypes, and the device won't necessarily know which one since it doesn't have a dtype generic on it (and I'd prefer not to add it).

but doesn’t e.g. conv2d has a dtype? and the workspace would have the same dtype, wouldn’t it? or where do you plan to use it

from cudarc.

coreylowman avatar coreylowman commented on August 28, 2024

coreylowman/dfdx@main...workspace

from cudarc.

M1ngXU avatar M1ngXU commented on August 28, 2024

hmm, ok, so everything runs on a single stream/one cudnn handle?

from cudarc.

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.