经过简单设置后,MOSS可以在16GB显存的单张显卡上运行
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.3k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description

16G显存+32G内存勉强运行,速度比较慢,但也算可以用
只需要把moss_cli_demo.py中31至33行进行简单修改即可
model = load_checkpoint_and_dispatch(
raw_model, model_path, device_map="auto", no_split_module_classes=["MossBlock"], dtype=torch.float16, max_memory={0: "12GiB", "cpu": "26GiB"}
)
这边最大GPU内存设置为12GB是为了给CUDA kernels留出空间以避免OOM
参考:accelerate usage guides
希望可以帮到没有很多卡的业余玩家
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with moss_cli_demo.py lines 31–33 and review the linked Accelerate big-modeling guidance. Verify that the shown 16GB GPU and 32GB system-memory settings let the demo run, including the CUDA-memory limitation. Done means the supported low-memory setup and its caveats are documented in an appropriate project guide.
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
- Mostly clear
- Newbie friendliness
- 38/100