alxndrTL / mamba.py

A simple and efficient Mamba implementation in pure PyTorch and MLX.
MIT License
960 stars 86 forks source link

A fresh can't start the model #20

Closed Luchen-077 closed 6 months ago

Luchen-077 commented 6 months ago

I'm sorry that I'm a fresh, so I can't get the model running smoothly. When I start the 'example_llm.ipynb', I get the error like this 图片 and then I tried to copy the same code to .py file, I get the error like 图片

the same question had been met in 'mamba-minimal', I don't know how to solve it.Bless for help, thank you!

alxndrTL commented 6 months ago

Hello, it seems the error you're seeing in the example_llm.ipynb is due to torch.load not recognizing the mmap argument that is given to it. What is your torch version ?

Luchen-077 commented 6 months ago

pytorch version 1.13.0 and I had just deleted the sentence 'mmap=True', then my code succeed running, may my action cause some severe problem?

alxndrTL commented 6 months ago

If it runs then you're good, the mmap argument decides how the file loaded with torch.load (in this case, the model weights) is loaded. It can be directly loaded in RAM in one go (if mmap=False) or loaded in RAM in chunks, whenever a chunk is necessary for computation. If it works, just leave it as is. (but you may consider upgrading your torch in the future)

Luchen-077 commented 6 months ago

OK, thank you for help !