Buckets:
893 GB
92 files
Updated 9 days ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| README.md | 951 Bytes xet | e43f9389 | |
| config.json | 1.24 kB xet | 9138e399 | |
| convert.py | 6.64 kB xet | 982bd251 | |
| generate.py | 5.8 kB xet | b500e4aa | |
| kernel.py | 22.2 kB xet | 78781eac | |
| model.py | 45.1 kB xet | 7efedf5c | |
| requirements.txt | 92 Bytes xet | 0acba707 |
Inference code for DeepSeek models
First convert huggingface model weight files to the format of this project.
export EXPERTS=256
export MP=4
export CONFIG=config.json
python convert.py --hf-ckpt-path ${HF_CKPT_PATH} --save-path ${SAVE_PATH} --n-experts ${EXPERTS} --model-parallel ${MP}
Then chat with DeepSeek model at will!
torchrun --nproc-per-node ${MP} generate.py --ckpt-path ${SAVE_PATH} --config ${CONFIG} --interactive
Or batch inference from file.
torchrun --nproc-per-node ${MP} generate.py --ckpt-path ${SAVE_PATH} --config ${CONFIG} --input-file ${FILE}
Or multi nodes inference.
torchrun --nnodes ${NODES} --nproc-per-node $((MP / NODES)) --node-rank $RANK --master-addr $ADDR generate.py --ckpt-path ${SAVE_PATH} --config ${CONFIG} --input-file ${FILE}
If you want to use fp8, just remove "expert_dtype": "fp4" in config.json and specify --expert-dtype fp8 in convert.py.
- Total size
- 893 GB
- Files
- 92
- Last updated
- Jul 21
- Pre-warmed CDN
- US EU US EU