High CPU utilization even though it is using the GPU #1453
Unanswered
ForrestBakerIV
asked this question in
Q&A
Replies: 1 comment 3 replies
-
change model size ? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
So I am processing a bunch of little files ( about 3 - 10 seconds each ) on 4 separate threads which pegs the CPU utilization at close to 80 - 100% whereas the GPU is only hitting about 10%.
Any thoughts as to why the CPU is my bottle neck? The audio I am sending over is 16k pcm wave where I am taking the head off.
import numpy as np
import torch
import sys
print("Model Loading", datetime.datetime.now())
torch.cuda.is_available()
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
print(DEVICE)
model = whisper.load_model("tiny", device=DEVICE)
audio = file_data[59:] # Extract the remaining bytes as binary data
data_s16 = np.frombuffer(audio, dtype=np.int16).flatten().astype(np.float32) / 32768.0
text = model.transcribe(data_s16)["text"]
Is there something I am doing that is an obvious additional work load onto the CPU? I know it is running on cuda based on the DEVICE...
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions