GithubHelp home page GithubHelp logo

Comments (4)

tae-jun avatar tae-jun commented on August 16, 2024

Hi, the most of computing time is from source separation (Demucs), so Demucs should support mps.

However, I did a bit search and I guess it's not possible for now sadly 😢
facebookresearch/demucs#432

from all-in-one.

filtercodes avatar filtercodes commented on August 16, 2024

Hi @tae-jun, thanks for clarification. The issue seems to be that mps doesn't support complex number operations or any other float than float32... and then it's a matter of finding a right spot and using .to("cpu") function to drag back processing of that particular math operation back to cpu.

https://github.com/facebookresearch/demucs/blob/main/demucs/htdemucs.py#L628C1-L634C24

# to cpu as mps doesnt support complex numbers
        # demucs issue #435 ##432
        # NOTE: in this case z already is on cpu
        # TODO: remove this when mps supports complex numbers
        x_is_mps = x.device.type == "mps"
        if x_is_mps:
        x = x.cpu()

and then

https://github.com/facebookresearch/demucs/blob/main/demucs/htdemucs.py#L645

# back to mps device
    if x_is_mps:
    x = x.to("mps")

But then we still have cpu doing most of the work. The real solution would be to not use complex numbers at all... if the algorithm can be adopted to use only real number like for example FFT, can be done with or without complex numbers.

Are there any other source separation alternatives that we could use instead of Demucs?

from all-in-one.

tae-jun avatar tae-jun commented on August 16, 2024

There are many publicly available source separation tools nowadays, such as Spleeter.

However, I have not tested all-in-one on other source separation models, and since all-in-one is trained on outputs of Demucs, I can't guarantee its performance.

But I think it's worth a try!

from all-in-one.

filtercodes avatar filtercodes commented on August 16, 2024

I found this one with MPS support

https://github.com/karaokenerds/python-audio-separator

It seems like with the latest os Sonoma+ it is possible to get complex numbers working

pytorch/pytorch#78044 (comment)

from all-in-one.

Related Issues (12)

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.