Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support for 5000 series Nvidia GPU's #26

@RodriMora

Description

@RodriMora

At the moment the dependecies install Torch 2.6.0. For the 5090 series GPU's pytorch 2.8.0 nightlies are needed.

When trying to manually install pytorch:

python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128

And running manually the app without uv so it doesn't check the dependencies and overwrites them:
python app.py

I get the following errors:

(.venv) ubuntuai@ubuntuai ~/dia (main)> CUDA_VISIBLE_DEVICES=1 python app.py --share
Using device: cuda
Loading Nari model...
/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/utils/weight_norm.py:143: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
  WeightNorm.apply(module, name, dim)
Launching Gradio interface...
* Running on local URL:  http://127.0.0.1:7862
* Running on public URL: https://xxxxx.gradio.live

This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)
Created temporary audio prompt file: /tmp/tmpkdcs_jm6.wav (orig sr: 48000)
Error during inference: Expected query, key, and value to have the same dtype, but got query.dtype: c10::BFloat16 key.dtype: float and value.dtype: float instead.
Traceback (most recent call last):
  File "/home/ubuntuai/dia/app.py", line 143, in run_inference
    output_audio_np = model.generate(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/model.py", line 374, in generate
    logits_Bx1xCxV, new_cache = decode_step(
  File "/home/ubuntuai/dia/dia/layers.py", line 743, in decode_step
    x, new_kv_cache = layer(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/layers.py", line 605, in forward
    sa_out, new_kv_cache = self.self_attention(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/layers.py", line 392, in forward
    attn_output = F.scaled_dot_product_attention(
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: c10::BFloat16 key.dtype: float and value.dtype: float instead.
Deleted temporary audio prompt file: /tmp/tmpkdcs_jm6.wav
Traceback (most recent call last):
  File "/home/ubuntuai/dia/app.py", line 143, in run_inference
    output_audio_np = model.generate(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/model.py", line 374, in generate
    logits_Bx1xCxV, new_cache = decode_step(
  File "/home/ubuntuai/dia/dia/layers.py", line 743, in decode_step
    x, new_kv_cache = layer(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/layers.py", line 605, in forward
    sa_out, new_kv_cache = self.self_attention(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/ubuntuai/dia/dia/layers.py", line 392, in forward
    attn_output = F.scaled_dot_product_attention(
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: c10::BFloat16 key.dtype: float and value.dtype: float instead.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events
    response = await route_utils.call_process_api(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api
    output = await app.get_blocks().process_api(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/gradio/blocks.py", line 2136, in process_api
    result = await self.call_function(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/gradio/blocks.py", line 1662, in call_function
    prediction = await anyio.to_thread.run_sync(  # type: ignore
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 967, in run
    result = context.run(func, *args)
  File "/home/ubuntuai/dia/.venv/lib/python3.10/site-packages/gradio/utils.py", line 883, in wrapper
    response = f(*args, **kwargs)
  File "/home/ubuntuai/dia/app.py", line 206, in run_inference
    raise gr.Error(f"Inference failed: {e}")
gradio.exceptions.Error: 'Inference failed: Expected query, key, and value to have the same dtype, but got query.dtype: c10::BFloat16 key.dtype: float and value.dtype: float instead.'

Enviroment:
Ubuntu 22.04
Nvidia 5090
Python 3.10 using a python env
Nvidia drivers 570.124.06
Cuda 12.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions