使用纯 CMake 实现 GPT-2
Implementation of GPT-2 in pure CMake

原始链接: https://github.com/AlpinDale/gpt2.cmake

使用纯 CMake 实现的 GPT-2,采用 Q16.16 定点数运算。 mkdir -p checkpoint curl -L -o checkpoint/model.safetensors https://huggingface.co/openai-community/gpt2/resolve/main/model.safetensors curl -L -o checkpoint/vocab.json https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json curl -L -o checkpoint/merges.txt https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt python3 tools/gen_full.py cmake -P gpt2_full.cmake -DPROMPT="Hello" -DN=2 python3 tools/gen_tables.py python3 tools/gen_model.py cmake -P gpt2.cmake 采用 BSD 3-Clause 许可证。详情请参阅 LICENSE 文件。

Hacker News 新闻 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 使用纯 CMake 实现 GPT-2 (github.com/alpindale) 9 点,由 porridgeraisin 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 1 条评论 帮助 ahartmetz 4 分钟前 [–] 仅供参考,这很可能连当作笑料看它有多慢都不够格——要达到那种效果,你至少得等个把小时才能看到点动静。它一次只能使用一个核心,但这还不是最糟糕的:CMake 是解释型语言且强依赖字符串,所以每个数字在每次使用时都必须进行“字符串转数字”以及通常再转回来的过程。回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系 搜索:
相关文章

原文

GPT-2 in pure CMake, executed with Q16.16 integer arithmetic.

mkdir -p checkpoint
curl -L -o checkpoint/model.safetensors https://huggingface.co/openai-community/gpt2/resolve/main/model.safetensors
curl -L -o checkpoint/vocab.json      https://huggingface.co/openai-community/gpt2/resolve/main/vocab.json
curl -L -o checkpoint/merges.txt      https://huggingface.co/openai-community/gpt2/resolve/main/merges.txt
python3 tools/gen_full.py
cmake -P gpt2_full.cmake -DPROMPT="Hello" -DN=2
python3 tools/gen_tables.py
python3 tools/gen_model.py
cmake -P gpt2.cmake

BSD 3-Clause. See LICENSE.

联系我们 contact @ memedata.com