asteroid-team / asteroid-team/asteroid

How to use GPU rather than CPU

Open
#698 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
2.6k
Forks
450
PR merge metrics
No merged PRs in 30d

Description

Hello,

Trying the first example to separate an mp3. ie

```
from asteroid.models import BaseModel
import soundfile as sf

model = BaseModel.from_pretrained("mpariente/DPRNNTasNet-ks2_WHAM_sepclean")
model.separate("music.mp3",resample=True)
```
It worked (well worked as in just made 2 distorted versions of the source music without separating anything it seems) but it uses 100% CPU and seems to ignore the GPU.
How do I tell it to use the GPU?
Thanks.

Contributor guide

Open the contributing guide

Research direction

Start with the shown BaseModel.from_pretrained and model.separate entry points and inspect how device selection is handled for the first example. Document the required GPU usage guidance and verify that the example performs separation on the GPU rather than only using the CPU.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.