grok-1 README

The project's README from github.com/xai-org/grok-1. As one markdown file: README.md.

Grok-1

This repository contains JAX example code for loading and running the Grok-1 open-weights model.

Make sure to download the checkpoint and place the ckpt-0 directory in checkpoints - see Downloading the weights

Then, run

pip install -r requirements.txt
python run.py

to test the code.

The script loads the checkpoint and samples from the model on a test input.

Due to the large size of the model (314B parameters), a machine with enough GPU memory is required to test the model with the example code. The implementation of the MoE layer in this repository is not efficient. The implementation was chosen to avoid the need for custom kernels to validate the correctness of the model.

Model Specifications

Grok-1 is currently designed with the following specifications:

Downloading the weights

You can download the weights using a torrent client and this magnet link:

magnet:?xt=urn:btih:5f96d43576e3d386c9ba65b883210a393b68210e&tr=https%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce

or directly using HuggingFace 🤗 Hub:

git clone https://github.com/xai-org/grok-1.git && cd grok-1
pip install huggingface_hub[hf_transfer]
huggingface-cli download xai-org/grok-1 --repo-type model --include ckpt-0/* --local-dir checkpoints --local-dir-use-symlinks False

License

The code and associated Grok-1 weights in this release are licensed under the Apache 2.0 license. The license only applies to the source files in this repository and the model weights of Grok-1.

grok-1 (xai-org/grok-1)

Searching Database…

52.2K ·GitHub
这是什么?Grok-1 是 xAI 开源的 314B 参数混合专家(MoE)语言模型;这个仓库存放的是加载和运行它的 JAX 示例代码。
模型权重包含在里面吗,还是只有代码?只有代码——开放权重需要单独下载:你可以通过磁力链接用 BT 下载工具获取,也可以直接从 HuggingFace Hub 下载。
拿到权重之后怎么把它跑起来?把下载好的 ckpt-0 目录放进 checkpoints,然后运行测试脚本:它会加载 checkpoint,并用一个测试输入从模型里采样生成内容。
仓库里的代码效率高吗?不高——MoE 层的实现是刻意做得低效的:它没有使用自定义内核,以便于轻松验证模型的正确性。
Apache 2.0 许可证是否同时覆盖代码和权重?是的——代码和 Grok-1 权重都在 Apache 2.0 之下,该许可证同时适用于这个仓库的源代码文件和 Grok-1 的模型权重。
普通的显卡能跑吗?基本跑不动——模型有 314B 参数,按照 README 的要求,哪怕只是用示例代码测试一下,也需要一台显存足够大的机器。
这个模型具体有多大?314B 参数,采用 8 专家混合(Mixture-of-8-Experts)架构,每个 token 使用 2 个专家,共 64 层,48 个查询头(其中 8 个用于键/值),嵌入维度为 6,144。
它能处理多长的上下文?上下文最长可达 8,192 个 token,文本由 SentencePiece 分词器处理,其词表包含 131,072 个 token。
它支持量化或分片吗?支持——模型支持激活分片(activation sharding)和 8 位量化,并使用旋转位置编码(RoPE)来提供位置信息。
Creator
xai-org
Size
1 MB
Stars
52.2K
Updated
CommitMar 19
Age
2y
Commits · 90 Days