Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cpu issue #181

Open
1 task done
team-boo opened this issue Jan 5, 2025 · 7 comments
Open
1 task done

Cpu issue #181

team-boo opened this issue Jan 5, 2025 · 7 comments
Labels
question Further information is requested

Comments

@team-boo
Copy link

team-boo commented Jan 5, 2025

Due diligence

  • I have done my due diligence in trying to find the answer myself.

Topic

The PyTorch implementation

Question

python -m moshi.server --device cpu --hf-repo kyutai/moshika-pytorch-bf16

doesn't work .

OS Debian 120+ core cpu 40GB RAM

I have always

"RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx"

@team-boo team-boo added the question Further information is requested label Jan 5, 2025
@LaurentMazare
Copy link
Member

Sorry the pytorch version requires an nvidia gpu to work (contrary to text models, a speech model like moshi needs to be real time and this would be very tricky on cpu only even with 120 cores).

@team-boo
Copy link
Author

team-boo commented Jan 5, 2025

There is any version that can work without nnvidia gpu?

i can give 200 cores if needed.

@LaurentMazare
Copy link
Member

You can try the rust version, everything should be cpu compatible but it's unlikely anyone tried this out so you may well run into issues (on top of the model likely not being real-time).

@team-boo
Copy link
Author

team-boo commented Jan 5, 2025

Thnx.

@team-boo
Copy link
Author

team-boo commented Jan 5, 2025

after python -m moshi.server --device cpu --hf-repo kyutai/moshiko-candle-bf16
again error

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/llll/myenv/src/moshi/moshi/moshi/server.py", line 275, in
main()
File "/home/llll/myenv/src/moshi/moshi/moshi/server.py", line 225, in main
lm = loaders.get_moshi_lm(args.moshi_weight, args.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/llll/myenv/src/moshi/moshi/moshi/models/loaders.py", line 152, in get_moshi_lm
load_model(model, filename)
File "/home/llll/myenv/lib/python3.11/site-packages/safetensors/torch.py", line 221, in load_model
raise RuntimeError(error)
RuntimeError: Error(s) in loading state_dict for LMModel:
Missing key(s) in state_dict: "depformer.layers.0.gating.0.linear_in.weight"

@rayfiyo
Copy link

rayfiyo commented Jan 25, 2025

Sorry if this is totally misguided.
In summary, I believe this issue is caused by a mismatch between the model checkpoint
and the current Moshi code (specifically missing parameters in depformer/gating).
It appears to be beyond the scope of the kyutai-labs/moshi repository itself, since updating
the checkpoint or reverting code versions would be required to resolve it.

Therefore, I recommend closing this issue here.
Any necessary updates likely need to happen on the model side or in a fork that aligns
with the older model format.

after python -m moshi.server --device cpu --hf-repo kyutai/moshiko-candle-bf16
again error

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/llll/myenv/src/moshi/moshi/moshi/server.py", line 275, in
main()
File "/home/llll/myenv/src/moshi/moshi/moshi/server.py", line 225, in main
lm = loaders.get_moshi_lm(args.moshi_weight, args.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/llll/myenv/src/moshi/moshi/moshi/models/loaders.py", line 152, in get_moshi_lm
load_model(model, filename)
File "/home/llll/myenv/lib/python3.11/site-packages/safetensors/torch.py", line 221, in load_model
raise RuntimeError(error)
RuntimeError: Error(s) in loading state_dict for LMModel:
Missing key(s) in state_dict: "depformer.layers.0.gating.0.linear_in.weight"

@LaurentMazare
Copy link
Member

The kyutai/moshiko-candle-bf16 contains the candle/rust version of the weights, the weights to be used with pytorch are in kyutai/moshiko-pytorch-bf16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants