Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .devops/Dockerfile.dev.frontend

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
tag_name="v${raw_tag}"
fi
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"

# macOS Jobs
macos-arm64-cpu:
name: macOS Apple Silicon (arm64) CPU
needs: release-metadata
Expand Down Expand Up @@ -134,8 +132,6 @@ jobs:
path: llm.cpp-${{ needs.release-metadata.outputs.tag_name }}-ios-xcframework.tar.gz
if-no-files-found: error
retention-days: 30

# Ubuntu Jobs
ubuntu-x64-cpu:
name: Ubuntu x64 (CPU)
needs: release-metadata
Expand Down Expand Up @@ -457,8 +453,6 @@ jobs:
path: llm.cpp-${{ needs.release-metadata.outputs.tag_name }}-bin-ubuntu-x64-sycl-fp16.tar.gz
if-no-files-found: error
retention-days: 30

# Android Job
android-arm64-cpu:
name: Android arm64 (CPU)
needs: release-metadata
Expand Down Expand Up @@ -516,8 +510,6 @@ jobs:
path: llm.cpp-${{ needs.release-metadata.outputs.tag_name }}-bin-android-arm64-cpu.tar.gz
if-no-files-found: error
retention-days: 30

# Windows Jobs
windows-x64-cpu:
name: Windows x64 (CPU)
needs: release-metadata
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ Thumbs.db
*.swo
.idea
docker-compose.override.yml
libs/lmgnu/build/
libs/lmgnu/dist/
libs/lmgnu/*.egg-info/
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "libs/lmgnu"]
path = libs/lmgnu
url = https://github.com/LMGNU/LMGNU.git
branch = master
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Alongside it sits a parallel PyTorch implementation in [engine/main.py](engine/m

The point of this repo is the C++ core. The PyTorch, FastAPI, and frontend layers exist to make the model usable, but if you're here to learn how a GPT is actually built and trained without a framework doing the work for you, [include/backward.h](include/backward.h) is where to start reading.

<h1 align="center">
<img width="824" height="250" alt="image" src="https://github.com/user-attachments/assets/5c65daa2-903a-4392-85e3-56442bb82cac" />


</h1>

***technical notes***: [docs](https://eamon2009.github.io/LLMs/)


Expand Down
Binary file added assets/run_2026-07-16 165731.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ static const std::string DEFAULT_CLEANED_PATH = "data/input.txt";
static const std::string DATA_PATH_ENV_VAR = "GPT_DATA_PATH";
static const unsigned int SEED = 1337;
static const double TRAIN_SPLIT = 0.9; // 90% train, 10% val
static const int BATCH_SIZE = 16;
static const int BLOCK_SIZE = 64; // Context length
static const int MAX_ITERS = 50;
static const int EVAL_INTERVAL = 250;
static const float LEARNING_RATE = 5e-4f;
static const int EVAL_ITERS = 100;
static const int BATCH_SIZE = 16;
static const int BLOCK_SIZE = 64; // Context length
static const int MAX_ITERS = 50;
static const int EVAL_INTERVAL = 250;
static const float LEARNING_RATE = 1e-4f;
static const int EVAL_ITERS = 100;
static const int N_EMBD = 128;
static const int N_HEAD = 4;
static const int N_LAYER = 4;
static const float DROPOUT = 0.05f;
static const float DROPOUT = 0.05f;
static const std::string BEST_MODEL_PATH = "best_model.bin";
static const std::string MODEL_PATH_ENV_VAR = "GPT_MODEL_PATH";
12 changes: 6 additions & 6 deletions data/data_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import os

# Settings
target_size_mb = 30
target_size_mb = 10_000
target_size_bytes = target_size_mb * 1024 * 1024
output_file = "cleaned.txt"
output_file = "input.txt"

print(f"Streaming TinyStories until {target_size_mb} MB is reached...")

Expand All @@ -15,14 +15,14 @@
with open(output_file, "w", encoding="utf-8") as f:
for entry in dataset:
story_text = entry["text"] + "\n\n"

# Calculate size of this story in bytes
story_bytes = len(story_text.encode('utf-8'))

if current_size + story_bytes > target_size_bytes:
break

f.write(story_text)
current_size += story_bytes

print(f"Done! Created '{output_file}' ({current_size / (1024*1024):.2f} MB)")
print(f"Done! Created '{output_file}' ({current_size / (1024*1024):.2f} MB)")
Loading
Loading