Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
0136107
chore: bump postcss from 8.5.15 to 8.5.19 in /frontend (#29)
dependabot[bot] Jul 14, 2026
28dbb3e
Remove LibTorch C++ inference implementation
Eamon2009 Jul 14, 2026
b03d554
Remove LibTorch C++ inference implementation (#30)
Eamon2009 Jul 14, 2026
d2612d0
Merge pull request #31 from LMGNU/dev-master
Eamon2009 Jul 14, 2026
1334289
Delete .env.example
Eamon2009 Jul 14, 2026
afb931d
Delete index.html
Eamon2009 Jul 14, 2026
145f789
Delete manifest.webmanifest
Eamon2009 Jul 14, 2026
9a3bc9d
Delete postcss.config.js
Eamon2009 Jul 14, 2026
9b3e2b7
Delete icon.svg
Eamon2009 Jul 14, 2026
5d9a47c
Delete manifest.webmanifest
Eamon2009 Jul 14, 2026
616264e
Delete sw.js
Eamon2009 Jul 14, 2026
f861880
Delete chat.ts
Eamon2009 Jul 14, 2026
f67dcb4
Delete client.ts
Eamon2009 Jul 14, 2026
21f9fb4
Delete health.ts
Eamon2009 Jul 14, 2026
86de292
Merge pull request #32 from LMGNU/dev-master
Eamon2009 Jul 14, 2026
f61e54e
Delete sessions.ts
Eamon2009 Jul 14, 2026
d78725d
Delete App.tsx
Eamon2009 Jul 14, 2026
9a37031
Delete ChatView.tsx
Eamon2009 Jul 14, 2026
165274a
Delete EmptyState.tsx
Eamon2009 Jul 14, 2026
ba5fa5e
Delete MessageAvatar.tsx
Eamon2009 Jul 14, 2026
7d046d6
Delete MessageList.tsx
Eamon2009 Jul 14, 2026
1a01782
Delete torch_bridge.h
Eamon2009 Jul 14, 2026
1e847bb
Delete tensor.h
Eamon2009 Jul 14, 2026
fc81c14
Delete sampler.h
Eamon2009 Jul 14, 2026
8aa3cda
Merge pull request #33 from LMGNU/dev-master
Eamon2009 Jul 14, 2026
e2f8bdb
Delete MessageRow.tsx
Eamon2009 Jul 14, 2026
9560a7a
Delete StarterPrompts.tsx
Eamon2009 Jul 14, 2026
efed501
Delete ThinkingIndicator.tsx
Eamon2009 Jul 14, 2026
979ebfb
Delete CharCounter.tsx
Eamon2009 Jul 14, 2026
8f00f27
Delete InputBar.tsx
Eamon2009 Jul 14, 2026
e490368
Delete AppLayout.tsx
Eamon2009 Jul 14, 2026
dc8ffa6
Delete Sidebar.tsx
Eamon2009 Jul 14, 2026
be4cc56
Delete Topbar.tsx
Eamon2009 Jul 14, 2026
fa9ffd9
Delete ModelBadge.tsx
Eamon2009 Jul 14, 2026
f4c22b4
Delete StatsPanel.tsx
Eamon2009 Jul 14, 2026
c7ee74c
Delete SessionItem.tsx
Eamon2009 Jul 14, 2026
c1efc28
Merge branch 'dev-master' into master
Eamon2009 Jul 14, 2026
3dd24c4
mha: Clean up formatting and remove redundant headers in attention heads
Eamon2009 Jul 14, 2026
4ed5a47
backward: Clean up formatting and remove redundant divider comments …
Eamon2009 Jul 14, 2026
e3252fd
Merge tag 'v1.3.12-cleanup' of local://dev-master into master
Eamon2009 Jul 14, 2026
128d919
block: Clean up constructor initialization and comments in Transforme…
Eamon2009 Jul 14, 2026
705cbe1
style: Add strict LLVM-based .clang-format configuration
Eamon2009 Jul 14, 2026
7174628
llm: migrate main entry point to Objective-C++
Eamon2009 Jul 14, 2026
26e4fea
llm: port C architecture implementation to Objective-C
Eamon2009 Jul 14, 2026
c03e9ad
bench: Port the standalone C++ benchmark runner to Objective-C++ (.mm…
Eamon2009 Jul 14, 2026
9162de6
Add CITATION.cff for llm.cpp software This file contains citation met…
Eamon2009 Jul 15, 2026
a49ac94
Rename executable from quadtrix.exe to llm.exe
Eamon2009 Jul 15, 2026
f5f9c84
Update executable name in README instructions
Eamon2009 Jul 15, 2026
b49f273
Add new image to README banner for llm.cpp
Eamon2009 Jul 15, 2026
aa4c65e
Delete Makefile
Eamon2009 Jul 15, 2026
98d1846
chore: bump react-dom and @types/react-dom in /frontend (#25)
dependabot[bot] Jul 16, 2026
90687cd
chore(deps): bump zustand from 5.0.12 to 5.0.14 in /frontend (#28)
dependabot[bot] Jul 16, 2026
7f989b2
chore(deps-dev): bump @vitejs/plugin-react from 4.7.0 to 6.0.3 in /fr…
dependabot[bot] Jul 16, 2026
348305c
Update README with image and quick start section
Eamon2009 Jul 16, 2026
0b23e26
doc: Add training and validation loss curves to assets (#35)
Eamon2009 Jul 16, 2026
cd1318b
main: Configure GPT-style model hyperparameters and tokenizer (#36)
Eamon2009 Jul 16, 2026
f396d72
V1.3.15 (#37)
Eamon2009 Jul 16, 2026
c579d10
docs: Add README covering Python setups, PyTorch inference, and C++ b…
Eamon2009 Jul 16, 2026
3bb8b6c
doc: Update training plots with generalization gap and 7k iter metric…
Eamon2009 Jul 16, 2026
45c2d2d
maint: Add config.hpp with default model hyperparameters and constant…
Eamon2009 Jul 16, 2026
e6d2d5c
data: Add script to stream and compile TinyStories dataset (#42)
Eamon2009 Jul 16, 2026
4714a14
main: Add foundational training and inference libraries to requiremen…
Eamon2009 Jul 16, 2026
aafad11
ci: Add multi-platform automated compilation and release workflow (#44)
Eamon2009 Jul 16, 2026
ade9cdf
docker: Remove development Dockerfile for the frontend (#45)
Eamon2009 Jul 16, 2026
b879700
Add mypy configuration with strict settings for .py
Eamon2009 Jul 16, 2026
9dda211
maint: Add lmgnu as a Git submodule in libs/lmgnu (#46)
Eamon2009 Jul 16, 2026
4fb79cb
maint: Implement comprehensive .gitignore rule suite (#47)
Eamon2009 Jul 16, 2026
01c1b29
Add lmgnu as a Git submodule in libs/lmgnu (#48)
Eamon2009 Jul 16, 2026
abf99cf
Fix typos and improve wording in README.md
Eamon2009 Jul 16, 2026
c2c2db2
Delete backward.h
Eamon2009 Jul 17, 2026
23897cb
Delete block.h
Eamon2009 Jul 17, 2026
501b35d
Delete char_level.h
Eamon2009 Jul 17, 2026
8adb1c7
Delete dataloader.h
Eamon2009 Jul 17, 2026
ddfa4f2
Delete embedding.h
Eamon2009 Jul 17, 2026
b647bca
Delete feedforward.h
Eamon2009 Jul 17, 2026
635c1f7
Delete gpt.h
Eamon2009 Jul 17, 2026
9f2e986
Delete layernorm.h
Eamon2009 Jul 17, 2026
53127a6
Delete linear.h
Eamon2009 Jul 17, 2026
60373a1
Delete quadtrix.h
Eamon2009 Jul 17, 2026
2bbca74
math: Implement fundamental Tensor struct with AVX/SSE acceleration (…
Eamon2009 Jul 17, 2026
27991e1
Add Python version specification for code
Eamon2009 Jul 18, 2026
7e278df
Update README.md
Eamon2009 Jul 18, 2026
1ab5430
Update README to enhance clarity on project purpose
Eamon2009 Jul 18, 2026
b2e106c
Revise README for clarity and additional details
Eamon2009 Jul 19, 2026
33ecdc9
config: Tune training scale hyperparameters (#50)
Eamon2009 Jul 19, 2026
0e317cd
Enhance README with BPE and training instructions
Eamon2009 Jul 19, 2026
774c117
Delete benches/python_benchmark.py no need
Eamon2009 Jul 19, 2026
583ac89
Enhance release badge in README for clarity
Eamon2009 Jul 19, 2026
56fd347
Update README badges and license information
Eamon2009 Jul 19, 2026
a7ada5c
Update README.md with new BPE version of llm.cpp
Eamon2009 Jul 19, 2026
39ab4e8
Update README.md with license info
Eamon2009 Jul 19, 2026
109759b
chore(deps-dev): bump vite from 8.0.16 to 8.1.5 in /frontend (#27)
dependabot[bot] Jul 19, 2026
2c1df4d
chore(deps): bump actions/upload-pages-artifact from 3 to 5 (#24)
dependabot[bot] Jul 19, 2026
5f60fa9
Clean up README by removing obsolete sections
Eamon2009 Jul 19, 2026
e7dd169
Enhance README with references and citation section
Eamon2009 Jul 19, 2026
66205b4
refactor: overhaul logging loop Refactor core Transformer classes a…
Eamon2009 Jul 20, 2026
754059d
refactor: Rename model modules to MiniQuadtrix and overhaul logging l…
Eamon2009 Jul 20, 2026
9754310
infer: Add distributed inference script with multi-GPU response gathe…
Eamon2009 Jul 20, 2026
00203de
train: Add DistributedDataParallel (DDP) training script with CLI cha…
Eamon2009 Jul 20, 2026
c9f40cc
math: Implement analytical backpropagation routines and activation tr…
Eamon2009 Jul 20, 2026
b4dad3a
math: Add Head and MultiHeadAttention causal self-attention modules
Eamon2009 Jul 20, 2026
bbc49ee
data: improved mm C++ Byte-Pair Encoding (BPE) DataLoader and tokeniz…
Eamon2009 Jul 20, 2026
7788b73
main: Add CLI application entry point supporting training, chat, and …
Eamon2009 Jul 20, 2026
0f82905
Fix image attributes in README.md
Eamon2009 Jul 20, 2026
c0b9119
Revise file structure section in README
Eamon2009 Jul 20, 2026
41f83f9
Delete package-lock.json
Eamon2009 Jul 21, 2026
dec1016
Delete package.json
Eamon2009 Jul 21, 2026
e02c512
Delete SettingsPanel.tsx
Eamon2009 Jul 21, 2026
a27c708
Delete NewChatButton.tsx
Eamon2009 Jul 21, 2026
2dc76b5
Delete SessionList.tsx
Eamon2009 Jul 21, 2026
dd5fc98
Delete Badge.tsx
Eamon2009 Jul 21, 2026
53b88f7
Delete Button.tsx
Eamon2009 Jul 21, 2026
d334980
Delete Input.tsx
Eamon2009 Jul 21, 2026
89e7807
Delete Slider.tsx
Eamon2009 Jul 21, 2026
7243cd0
Delete Tooltip.tsx
Eamon2009 Jul 21, 2026
9de44b0
Delete vite.config.ts
Eamon2009 Jul 21, 2026
fd89cee
Delete tsconfig.json
Eamon2009 Jul 21, 2026
f98c649
Delete tailwind.config.ts
Eamon2009 Jul 21, 2026
254894a
Delete sw.js
Eamon2009 Jul 21, 2026
6579012
Delete useAutoScroll.ts
Eamon2009 Jul 21, 2026
e7766b7
Delete useConnectionStatus.ts
Eamon2009 Jul 21, 2026
5f8428b
Delete index.css
Eamon2009 Jul 21, 2026
32a677f
Delete useKeyboardShortcut.ts
Eamon2009 Jul 21, 2026
0622521
Delete main.tsx
Eamon2009 Jul 21, 2026
2df5cf8
Delete registerServiceWorker.ts
Eamon2009 Jul 21, 2026
5ddc52e
Delete sessionStore.ts
Eamon2009 Jul 21, 2026
0646faa
Delete settingsStore.ts
Eamon2009 Jul 21, 2026
68ab463
Delete index.ts
Eamon2009 Jul 21, 2026
a6db306
Delete text.ts
Eamon2009 Jul 21, 2026
bc1a1c7
Delete time.ts
Eamon2009 Jul 21, 2026
9faf1bb
build: Add Makefile for native compilation and script wrapper targets
Eamon2009 Jul 21, 2026
b76cc27
Delete config.h
Eamon2009 Jul 21, 2026
2c5de56
Delete attention.h
Eamon2009 Jul 21, 2026
a4a80de
Delete backward.h
Eamon2009 Jul 21, 2026
0a382f4
Delete dataloader.h
Eamon2009 Jul 21, 2026
b774f04
Delete train.mm
Eamon2009 Jul 21, 2026
8e948b8
Delete tensor.h
Eamon2009 Jul 21, 2026
2c65ffb
build: Makefile for native compilation and script wrapper targets
Eamon2009 Jul 21, 2026
713a620
cuda: Add CUDATensor container for host/device VRAM memory management
Eamon2009 Jul 21, 2026
6aa1e6d
cuda: Add CUDA and cuBLAS accelerated main entry point Introduce `ma…
Eamon2009 Jul 21, 2026
15847fb
cuda: Add custom CUDA kernels for bias addition, ReLU, LayerNorm, and…
Eamon2009 Jul 21, 2026
14f0570
cuda: Add CUDA_CHECK and CUBLAS_CHECK error handling macros
Eamon2009 Jul 21, 2026
b69150b
cuda: Add gpu_matmul, gpu_layernorm, and gpu_softmax layer wrappers
Eamon2009 Jul 21, 2026
cc5864b
main: Add objective-C++/C++ main application entry point
Eamon2009 Jul 21, 2026
9b6fabd
Revise file structure in README.md reflect changes in project organiz…
Eamon2009 Jul 21, 2026
a571672
Delete engine/fineweb_dataset.py not used anymore
Eamon2009 Jul 21, 2026
328574b
Delete engine/iGPU directory no longer in use
Eamon2009 Jul 21, 2026
460ce81
backward: Add analytical backprop ops and gradient accumulators
Eamon2009 Jul 21, 2026
a7e99b1
Delete benches/bech(mm).mm no longer in use
Eamon2009 Jul 21, 2026
40d45f9
Update README with OpenMP flag for build command
Eamon2009 Jul 21, 2026
95b090f
model: Add GPT language model architecture, loss function, and AdamW …
Eamon2009 Jul 22, 2026
ca2ab1d
bpe: Add Byte-Pair Encoding (BPE) tokenizer and DataLoader class
Eamon2009 Jul 22, 2026
b68cd9a
lm: Update GPT language model header with sampler repetition penalty
Eamon2009 Jul 22, 2026
d919299
Update CI workflow to build and test llm.exe
Eamon2009 Jul 22, 2026
4025dc5
attention: Add Head and MultiHeadAttention causal self-attention modules
Eamon2009 Jul 22, 2026
b49d4a5
Merge branch 'master' of https://github.com/LMGNU/llm.cpp
Eamon2009 Jul 22, 2026
3a84665
Add C/C++ file extensions to workflow checks
Eamon2009 Jul 22, 2026
822606d
Update CI workflow for consistency and fixes
Eamon2009 Jul 22, 2026
b1ad301
Refactor PR comment checks workflow simplify trigger conditions and e…
Eamon2009 Jul 22, 2026
2e81752
Change environment name from 'lmgnu' to 'main'
Eamon2009 Jul 22, 2026
d548db6
tokenizer: Optimize DataLoader with OpenMP parallelization and merges
Eamon2009 Jul 22, 2026
4441c9f
Update README.md
Eamon2009 Jul 22, 2026
51fcee6
Enhance project structure documentation in README
Eamon2009 Jul 22, 2026
f6c6f74
tensor: Add OpenMP multi-threading to AVX/SSE vector operations
Eamon2009 Jul 22, 2026
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
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
---
# Clang-Format Configuration File
# ----------------------------------------------------
BasedOnStyle: LLVM
Language: Cpp

# Indentation and Tab Settings
IndentWidth: 6
UseTab: Never
TabWidth: 6
ContinuationIndentWidth: 6

# Brace Wrapping
BreakBeforeBraces: Allman

# Formatting Geometry & Constraints
ColumnLimit: 100
PointerAlignment: Right
ReferenceAlignment: Right

# Include Management
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
# Spacing rules
SpaceBeforeParens: ControlStatements
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
Expand All @@ -23,5 +36,7 @@ AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: Empty
# Braced initializer list formatting (e.g. vector/array initialization)
Cpp11BracedListStyle: true
SpacesInAngles: Never
...
12 changes: 0 additions & 12 deletions .devops/Dockerfile.dev.frontend

This file was deleted.

30 changes: 14 additions & 16 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:
- "**/*.py"
- "**/*.cpp"
- "**/*.c"
- "**/*.h"
- "**/*.hpp"
pull_request:
branches: [ "master" ]
paths:
- "**/*.py"
- "**/*.cpp"
- "**/*.c"
- "**/*.h"
- "**/*.hpp"

jobs:
syntax-check:
Expand All @@ -35,38 +39,32 @@ jobs:

- name: Lint Python Files
run: |
# Only checks syntax and severe errors
flake8 . --count --select=E999,F821,F822,F823 --show-source --statistics

# --- C/C++ Syntax Check ---
- name: Install C/C++ Compiler (GCC)
run: |
sudo apt-get update
sudo apt-get install -y gcc g++

# E9, F63, F7, F82 checks syntax errors & undefined variables
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check C/C++ Syntax
run: |
echo "Checking C and C++ files for syntax errors..."
errors=0

# Using redirect loops to properly catch errors without subshell issues
# Loop through C files (-I. includes local root directory for header lookups)
while read -r file; do
if [ -z "$file" ]; then continue; fi
echo "Checking $file"
if ! gcc -fsyntax-only "$file"; then
echo "Syntax error in $file"
if ! gcc -fsyntax-only -I. "$file"; then
echo "::error file=$file::Syntax error in $file"
errors=$((errors + 1))
fi
done < <(find . -name "*.c")
done < <(find . -type f -name "*.c")

# Loop through C++ files
while read -r file; do
if [ -z "$file" ]; then continue; fi
echo "Checking $file"
if ! g++ -fsyntax-only "$file"; then
echo "syntax error in $file"
if ! g++ -fsyntax-only -I. "$file"; then
echo "::error file=$file::Syntax error in $file"
errors=$((errors + 1))
fi
done < <(find . -name "*.cpp")
done < <(find . -type f -name "*.cpp")

if [ $errors -ne 0 ]; then
echo "$errors file(s) failed syntax verification."
Expand Down
118 changes: 68 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build & Test
on:
push:
branches: [ master, main, develop ]

jobs:
cpp-quality:
runs-on: ubuntu-latest
Expand All @@ -22,7 +23,7 @@ jobs:
- name: Clang-Format Check
id: clang-format
run: |
echo "### 🔍 Clang-Format Code Style Check" >> $GITHUB_STEP_SUMMARY
echo "### Clang-Format Code Style Check" >> $GITHUB_STEP_SUMMARY
find . -name "*.cpp" -o -name "*.h" -o -name "*.hpp" | grep -v build > cpp_files.txt

if [ -s cpp_files.txt ]; then
Expand All @@ -32,10 +33,10 @@ jobs:
cat format_output.txt >> $GITHUB_STEP_SUMMARY
exit 1
else
echo " Code formatting is correct" >> $GITHUB_STEP_SUMMARY
echo "Code formatting is correct" >> $GITHUB_STEP_SUMMARY
fi
else
echo " No C++ files found" >> $GITHUB_STEP_SUMMARY
echo "No C++ files found" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

Expand All @@ -55,7 +56,7 @@ jobs:
echo "Issues detected:" >> $GITHUB_STEP_SUMMARY
cat cppcheck_output.txt >> $GITHUB_STEP_SUMMARY
else
echo " No critical issues found" >> $GITHUB_STEP_SUMMARY
echo "No critical issues found" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

Expand Down Expand Up @@ -88,7 +89,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
Expand All @@ -101,10 +102,10 @@ jobs:
- name: Black Format Check
id: black
run: |
echo "### Black Code Formatting" >> $GITHUB_STEP_SUMMARY
echo "### Black Code Formatting" >> $GITHUB_STEP_SUMMARY
black --check --diff . 2>&1 | tee black_output.txt || true
if [ $? -ne 0 ]; then
echo " Formatting issues detected:" >> $GITHUB_STEP_SUMMARY
echo "Formatting issues detected:" >> $GITHUB_STEP_SUMMARY
head -30 black_output.txt >> $GITHUB_STEP_SUMMARY
else
echo "Black formatting passed" >> $GITHUB_STEP_SUMMARY
Expand All @@ -127,38 +128,38 @@ jobs:
- name: Flake8 Linting
id: flake8
run: |
echo "### Flake8 Linting" >> $GITHUB_STEP_SUMMARY
echo "### Flake8 Linting" >> $GITHUB_STEP_SUMMARY
flake8 . --max-line-length=127 --count --statistics 2>&1 | tee flake8_output.txt || true
if [ $? -ne 0 ]; then
echo "Linting violations:" >> $GITHUB_STEP_SUMMARY
cat flake8_output.txt >> $GITHUB_STEP_SUMMARY
else
echo " Flake8 passed" >> $GITHUB_STEP_SUMMARY
echo "Flake8 passed" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

- name: Pylint Analysis
id: pylint
run: |
echo "### Pylint Code Analysis" >> $GITHUB_STEP_SUMMARY
echo "### Pylint Code Analysis" >> $GITHUB_STEP_SUMMARY
find . -name "*.py" -type f | grep -v __pycache__ | xargs pylint \
--fail-under=7.0 \
--disable=C0111,C0103,R0913,W0212 \
2>&1 | tee pylint_output.txt || true

if grep -q "rated at" pylint_output.txt; then
echo " Pylint analysis complete" >> $GITHUB_STEP_SUMMARY
echo "Pylint analysis complete" >> $GITHUB_STEP_SUMMARY
tail -3 pylint_output.txt >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

- name: Bandit Security Scan
id: bandit
run: |
echo "### Bandit Security Check" >> $GITHUB_STEP_SUMMARY
echo "### Bandit Security Check" >> $GITHUB_STEP_SUMMARY
bandit -r . -ll 2>&1 | tee bandit_output.txt || true
if grep -q "Issue:" bandit_output.txt; then
echo " Security issues found:" >> $GITHUB_STEP_SUMMARY
echo "Security issues found:" >> $GITHUB_STEP_SUMMARY
grep -A1 "Issue:" bandit_output.txt >> $GITHUB_STEP_SUMMARY
else
echo "No security issues detected" >> $GITHUB_STEP_SUMMARY
Expand All @@ -171,6 +172,10 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
Expand All @@ -181,12 +186,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install gcc
sudo apt-get install -y build-essential g++ libomp-dev

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
Expand All @@ -196,39 +196,57 @@ jobs:
- name: Build inference executable
id: build-inference
run: |
echo "### 🔨 Building Inference Executable" >> $GITHUB_STEP_SUMMARY
echo "### Building Inference Executable" >> $GITHUB_STEP_SUMMARY

if [ -f "main.cpp" ]; then
g++ -std=c++17 -O2 -I. -Iinclude -o quadtrix_inference main.cpp 2>&1 | tee inference_build.txt || true

if [ -f "quadtrix_inference" ] || [ -f "quadtrix_inference.exe" ]; then
echo " Inference build successful" >> $GITHUB_STEP_SUMMARY
if [ "$RUNNER_OS" == "macOS" ]; then
echo "Building for macOS with Metal framework support..."
if [ -f "llm.mm" ] && [ -f "main.cpp" ]; then
clang++ -std=c++17 -O3 -I. -Iinclude main.cpp llm.mm -framework Foundation -framework Metal -framework MetalPerformanceShaders -o llm 2>&1 | tee inference_build.txt || true
elif [ -f "main.cpp" ]; then
clang++ -std=c++17 -O3 -I. -Iinclude main.cpp -o llm 2>&1 | tee inference_build.txt || true
fi

if [ -f "llm" ]; then
echo "Inference build successful (macOS)" >> $GITHUB_STEP_SUMMARY
else
echo "Inference build failed" >> $GITHUB_STEP_SUMMARY
echo "Inference build failed (macOS)" >> $GITHUB_STEP_SUMMARY
cat inference_build.txt >> $GITHUB_STEP_SUMMARY
fi

else
echo "main.cpp not found - skipping inference build" >> $GITHUB_STEP_SUMMARY
echo "Building for $RUNNER_OS with GCC..."
if [ -f "main.cpp" ]; then
g++ -std=c++17 -O3 -march=native -fopenmp -I. -Iinclude -o llm.exe main.cpp 2>&1 | tee inference_build.txt || true

if [ -f "llm.exe" ]; then
echo "Inference build successful ($RUNNER_OS)" >> $GITHUB_STEP_SUMMARY
else
echo "Inference build failed ($RUNNER_OS)" >> $GITHUB_STEP_SUMMARY
cat inference_build.txt >> $GITHUB_STEP_SUMMARY
fi
else
echo "main.cpp not found - skipping inference build" >> $GITHUB_STEP_SUMMARY
fi
fi
continue-on-error: true

- name: Test inference executable
id: test-inference
run: |
echo "### Testing Inference Executable" >> $GITHUB_STEP_SUMMARY
echo "### Testing Inference Executable" >> $GITHUB_STEP_SUMMARY

if [ -f "quadtrix_inference" ] || [ -f "quadtrix_inference.exe" ]; then
BINARY="quadtrix_inference"
if [ ! -f "$BINARY" ]; then
BINARY="quadtrix_inference.exe"
fi
BINARY="llm.exe"
if [ "$RUNNER_OS" == "macOS" ]; then
BINARY="llm"
fi

if [ -f "$BINARY" ]; then
if [ -f "data/input.txt" ]; then
./$BINARY data/input.txt 2>&1 | tee inference_test.txt || true
echo "Inference test completed" >> $GITHUB_STEP_SUMMARY
head -20 inference_test.txt >> $GITHUB_STEP_SUMMARY
else
echo " data/input.txt not found - skipping inference test" >> $GITHUB_STEP_SUMMARY
echo "data/input.txt not found - skipping inference test" >> $GITHUB_STEP_SUMMARY
fi
else
echo "Inference executable not found" >> $GITHUB_STEP_SUMMARY
Expand All @@ -244,29 +262,29 @@ jobs:
g++ -std=c++17 -O2 -I. -Iinclude llm.cpp train.cpp -o quadtrix_train 2>&1 | tee training_build.txt || true

if [ -f "quadtrix_train" ] || [ -f "quadtrix_train.exe" ]; then
echo " Training build successful" >> $GITHUB_STEP_SUMMARY
echo "Training build successful" >> $GITHUB_STEP_SUMMARY
else
echo " Training build failed" >> $GITHUB_STEP_SUMMARY
echo "Training build failed" >> $GITHUB_STEP_SUMMARY
cat training_build.txt >> $GITHUB_STEP_SUMMARY
fi
elif [ -f "train.cpp" ]; then
echo " train.cpp found but llm.cpp not found - skipping training build" >> $GITHUB_STEP_SUMMARY
echo "train.cpp found but llm.cpp not found - skipping training build" >> $GITHUB_STEP_SUMMARY
else
echo " train.cpp not found - skipping training build" >> $GITHUB_STEP_SUMMARY
echo "train.cpp not found - skipping training build" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

- name: Test training executable
id: test-training
run: |
echo "### Testing Training Executable" >> $GITHUB_STEP_SUMMARY
echo "### Testing Training Executable" >> $GITHUB_STEP_SUMMARY

if [ -f "quadtrix_train" ] || [ -f "quadtrix_train.exe" ]; then
BINARY="quadtrix_train"
if [ ! -f "$BINARY" ]; then
BINARY="quadtrix_train.exe"
fi
BINARY="quadtrix_train"
if [ -f "quadtrix_train.exe" ]; then
BINARY="quadtrix_train.exe"
fi

if [ -f "$BINARY" ]; then
echo "Running training executable (timeout 30s)..." >> $GITHUB_STEP_SUMMARY
timeout 30 ./$BINARY 2>&1 | tee training_test.txt || true
echo "Training test completed" >> $GITHUB_STEP_SUMMARY
Expand All @@ -289,7 +307,7 @@ jobs:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -300,7 +318,7 @@ jobs:
pip install pytest pytest-cov

if [ -f "requirements.txt" ]; then
pip install -r requirements.txt 2>/dev/null || echo " Some requirements failed to install"
pip install -r requirements.txt 2>/dev/null || echo "Some requirements failed to install"
fi

- name: Run Python tests
Expand All @@ -313,11 +331,11 @@ jobs:
if [ $? -eq 0 ]; then
echo "All tests passed" >> $GITHUB_STEP_SUMMARY
else
echo " Some tests failed" >> $GITHUB_STEP_SUMMARY
echo "Some tests failed" >> $GITHUB_STEP_SUMMARY
fi
tail -30 pytest_output.txt >> $GITHUB_STEP_SUMMARY
else
echo " No test files found" >> $GITHUB_STEP_SUMMARY
echo "No test files found" >> $GITHUB_STEP_SUMMARY
fi
continue-on-error: true

Expand Down
Loading
Loading