mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-28 20:35:09 -04:00
444 B
444 B
cbridge
We'll use this directory for the PyTorch -> C bridge. So we have some PyTorch code and we'd like to have the equivalent C implementation (usually that one in turn serves as reference for the CUDA kernels later).
For starters we have RoPE. E.g. generate the reference with PyTorch and then match it in C:
python rope.py
gcc -o rope rope.c -lm
./rope
The .py file writes a robe.bin file with the intermediate tensors.