Giter Club home page Giter Club logo

Comments (7)

roastduck avatar roastduck commented on August 16, 2024 1

Performance note, tou can (and should) remove the -fno-vectorize -fno-unroll-loops when using ClangEnzyme.

Regardless investigating.

Please update the guide https://enzyme.mit.edu/getting_started/CUDAGuide/.

from enzyme.

wsmoses avatar wsmoses commented on August 16, 2024 1

Indeed and in progress, see EnzymeAD/www#14

from enzyme.

wsmoses avatar wsmoses commented on August 16, 2024

Performance note, tou can (and should) remove the -fno-vectorize -fno-unroll-loops when using ClangEnzyme.

Regardless investigating.

from enzyme.

wsmoses avatar wsmoses commented on August 16, 2024

This does appear to be a memory error. Specifically because it thinks your input and output could overlap, it is caching each variable -- taking gigabytes per thread -- and thus clearly oom'ing.

Marking the two function inputs as restrict removes the caching, but something weird is still going on.

from enzyme.

roastduck avatar roastduck commented on August 16, 2024

This does appear to be a memory error. Specifically because it thinks your input and output could overlap, it is caching each variable -- taking gigabytes per thread -- and thus clearly oom'ing.

I also suspect there could be OOM, so I checked the execution with cuda-memcheck, and found nothing. (And just to confirm, I think Enzyme would also check for failed cuda memory allocation, right?) So I think there could be other errors happen even before the OOM. For example, if you are using 32-bit integers, the address or size can overflow for a gigabyte-sized buffer.

from enzyme.

wsmoses avatar wsmoses commented on August 16, 2024

Enzyme will assume allocation functions will succeed or assert (which apparently is not the case here). I'm guessing what could be happening is that the allocation itself crashes the kernel before any load/stores and perhaps cuda-memcheck doesn't check that?

But perhaps looking at an error code after the kernel launch could?

from enzyme.

roastduck avatar roastduck commented on August 16, 2024

Of course it is the best practice to check the error code after each kernel launch. You can check invalid kernel launch arguments by calling cudaGetLastError after the kernel launches, and check runtime error inside the kernel by checking the error code returned from a following synchronization call. In my practice, both are needed.

But AFAIK, cuda-memcheck not only checks each load/store, but also checks the error code from each kernel launch or CUDA API call.

from enzyme.

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.