Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6c0134a
feat: add memory redesign doc
peterlau123 Nov 26, 2025
27f150e
Merge pull request #26 from peterlau123/develop
peterlau123 Nov 27, 2025
334e8b8
feat: add initial refactored memory system
peterlau123 Nov 27, 2025
e2573d5
feat: migrate fom existing BufferManager to use amp
peterlau123 Nov 27, 2025
8fe5b2c
Merge remote-tracking branch 'origin/feat-redesign_buffer_hub' into f…
peterlau123 Nov 27, 2025
66feff1
feat: implement allocator_wrapper.cpp with AllocatorFactory and plugg…
peterlau123 Dec 6, 2025
f6befda
fix: resolve compilation issues in AMP Buffer Manager
peterlau123 Dec 6, 2025
854f8ec
feat: add TCMalloc support to conanfile.py
peterlau123 Dec 6, 2025
118334a
feat: implement arena.cpp with ArenaRouter, CPUArena, and GPUArena stub
peterlau123 Dec 6, 2025
bef5d2c
feat: complete AMP system implementation
peterlau123 Dec 6, 2025
f8f7204
feat: complete AMP system documentation and allocator support
peterlau123 Dec 6, 2025
e4928c4
refactor: remove legacy buffer_hub and buffer_manager, add AMP compat…
peterlau123 Dec 6, 2025
55d9640
feat: add compatibility for buffer_hub.h ad buffer_manager
peterlau123 Dec 6, 2025
711e1af
fix: correct logic error in BufferManager allocator initialization
peterlau123 Dec 6, 2025
63d9cca
fix: use CUDAAllocator for CUDA devices instead of StandardAllocator
peterlau123 Dec 6, 2025
279266f
feat: implement real CUDA allocator with proper GPU memory management
peterlau123 Dec 6, 2025
ed8b4bb
feat: add buffer_manager test after refactoring
peterlau123 Dec 6, 2025
69fe473
refactor: reorganize allocator code structure
peterlau123 Dec 6, 2025
0cd36fd
feat: add real integration for TCMalloc, Jemalloc, and Mimalloc
peterlau123 Dec 6, 2025
2eb102a
fix: remove unused legacy allocator fields from BufferManager::Config
peterlau123 Dec 6, 2025
ea896a6
feat: initial add integration of tcmalloc,jellymalloc and minimalloc
peterlau123 Dec 6, 2025
a89022a
refactor: separate CUDA allocator tests into dedicated test file
peterlau123 Dec 6, 2025
81725fa
docs: add comprehensive NovaLLM architecture diagram
peterlau123 Dec 6, 2025
f0365e9
docs: redesign architecture diagram as building blocks (积木式)
peterlau123 Dec 6, 2025
8111c25
docs: create comprehensive system architecture diagram
peterlau123 Dec 6, 2025
247d0a8
feat: add architecture
peterlau123 Dec 6, 2025
d311d21
fix: fix export class error in thread_cache.h and buffer_manager.h
peterlau123 Dec 7, 2025
0ba44e0
feat: add thread cache tests
peterlau123 Dec 7, 2025
b2f57c4
test: add unit tests for amp_buffer_manager and arena
peterlau123 Dec 7, 2025
c3ae661
Update CMakeLists.txt and config files for edgehermes library name
peterlau123 Jan 13, 2026
6bc5810
Update macros to use EDGEHERMES_API and EDGEHERMES_EXPORTS for standa…
peterlau123 Jan 13, 2026
d4803d0
refactor: rename include directory from EdgeHermes to Peregrine
peterlau123 Jan 24, 2026
acac8d2
refactor: update all includes and namespaces from EdgeHermes/edgeherm…
peterlau123 Jan 24, 2026
413449f
refactor: rename CMake configurations from EdgeHermes to Peregrine
peterlau123 Jan 24, 2026
cee7417
refactor: update C++ source files and namespaces from EdgeHermes to P…
peterlau123 Jan 24, 2026
71b5075
refactor: update Conan package configuration from edgehermes to pereg…
peterlau123 Jan 24, 2026
2c94fa1
docs: update documentation from EdgeHermes to Peregrine
peterlau123 Jan 24, 2026
a9a5519
ci: update GitHub Actions workflows from EdgeHermes to Peregrine
peterlau123 Jan 24, 2026
4c249f6
refactor: update source files and pre-commit configs from EdgeHermes …
peterlau123 Jan 24, 2026
3bff8d4
refactor: fix remaining EdgeHermes references in CMakeLists and headers
peterlau123 Jan 24, 2026
bce6d64
feat: update project logo image
peterlau123 Jan 24, 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
9 changes: 6 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Language: Cpp
BasedOnStyle: Google

# 增加行间距
# 增加行间�
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
SeparateDefinitionBlocks: Always
Expand All @@ -20,10 +20,13 @@ AllowAllArgumentsOnNextLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BreakConstructorInitializers: BeforeComma

# 空格和对齐
# 空格和对�
SpaceBeforeParens: ControlStatements
SpaceAfterTemplateKeyword: true
SpaceBeforeInheritanceColon: true
SpaceBeforeCpp11BracedList: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveDeclarations: false



4 changes: 4 additions & 0 deletions .cmake-format
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ parse:
COMPATIBILITY: 1
VERSION_HEADER: 1
DEPENDENCIES: +




36 changes: 20 additions & 16 deletions .githooks/check_branch_name.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Branch name validator for NovaLLM
Branch name validator for EdgeHermes
Works on all platforms (Windows, macOS, Linux)
"""
import re
Expand Down Expand Up @@ -61,7 +61,7 @@ def print_error_message(branch_name):
"""Print helpful error message for invalid branch names."""
error_msg = f"""
{'='*70}
❌ INVALID BRANCH NAME
�INVALID BRANCH NAME
{'='*70}

Branch: {branch_name}
Expand All @@ -70,25 +70,25 @@ def print_error_message(branch_name):
<type>-<description> or <type>/<description>

Valid types:
• feat - New feature
• fix - Bug fix
• docs - Documentation changes
• style - Code style changes
• refactor - Code refactoring
• perf - Performance improvements
• test - Test changes
• build - Build system changes
• ci - CI/CD changes
• chore - Other changes

âœValid examples:
�feat - New feature
�fix - Bug fix
�docs - Documentation changes
�style - Code style changes
�refactor - Code refactoring
�perf - Performance improvements
�test - Test changes
�build - Build system changes
�ci - CI/CD changes
�chore - Other changes

�Valid examples:
feat-buffer-pooling
fix-windows-dll-exports
docs-update-readme
refactor/simplify-tensor-allocation
ci-add-coverage-reporting

❌ Current branch: {branch_name}
�Current branch: {branch_name}

To fix this, rename your branch:
git branch -m {branch_name} <type>-<proper-description>
Expand Down Expand Up @@ -121,9 +121,13 @@ def main():
sys.exit(1)

# Branch name is valid
print(f"âœBranch name '{branch_name}' is valid")
print(f"�Branch name '{branch_name}' is valid")
sys.exit(0)


if __name__ == "__main__":
main()




22 changes: 13 additions & 9 deletions .githooks/install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
# Install git hooks for NovaLLM
# Install git hooks for EdgeHermes
# This script sets up both pre-commit hooks and custom git hooks

set -euo pipefail

echo "🔧 Installing NovaLLM Git Hooks..."
echo "🔧 Installing EdgeHermes Git Hooks..."
echo ""

# Get the repository root
Expand All @@ -14,14 +14,14 @@ HOOKS_DIR="$REPO_ROOT/.githooks"
# 1. Configure git to use custom hooks directory
echo "📁 Configuring git to use custom hooks directory..."
git config core.hooksPath "$HOOKS_DIR"
echo " âœGit hooks path set to: $HOOKS_DIR"
echo " �Git hooks path set to: $HOOKS_DIR"
echo ""

# 2. Install pre-commit hooks
if command -v pre-commit &> /dev/null; then
echo "📦 Installing pre-commit hooks..."
pre-commit install --hook-type commit-msg --hook-type pre-commit
echo " âœPre-commit hooks installed"
echo " �Pre-commit hooks installed"
else
echo "⚠️ pre-commit not found. Install it with:"
echo " pip install pre-commit"
Expand All @@ -32,7 +32,7 @@ echo ""
# 3. Make all hook scripts executable
echo "🔐 Making hook scripts executable..."
chmod +x "$HOOKS_DIR"/* 2>/dev/null || true
echo " âœHook scripts are executable"
echo " �Hook scripts are executable"
echo ""

# 4. Test branch name validation (if on a feature branch)
Expand All @@ -43,13 +43,13 @@ echo "📋 Current branch: $CURRENT_BRANCH"
cat <<EOF

╔════════════════════════════════════════════════════════════════╗
╠✅ HOOKS INSTALLED SUCCESSFULLY â•
� �HOOKS INSTALLED SUCCESSFULLY �
╚════════════════════════════════════════════════════════════════╝

Installed hooks:
âœpost-checkout - Validates branch names
âœcommit-msg - Validates commit messages
âœpre-commit - Code quality checks
�post-checkout - Validates branch names
�commit-msg - Validates commit messages
�pre-commit - Code quality checks

Branch name format:
<type>-<description> or <type>/<description>
Expand All @@ -69,3 +69,7 @@ Try it out:
For more info, see: .pre-commit-setup.md

EOF




40 changes: 22 additions & 18 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ VALID_PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)([-/])[a-
if [[ ! "$BRANCH_NAME" =~ $VALID_PATTERN ]]; then
cat <<EOF
╔════════════════════════════════════════════════════════════════╗
╠❌ INVALID BRANCH NAME â•
� �INVALID BRANCH NAME �
╚════════════════════════════════════════════════════════════════╝

Branch: $BRANCH_NAME
Expand All @@ -45,25 +45,25 @@ Branch names must follow this format:
<type>-<description> or <type>/<description>

Valid types:
• feat - New feature
• fix - Bug fix
• docs - Documentation changes
• style - Code style changes
• refactor - Code refactoring
• perf - Performance improvements
• test - Test changes
• build - Build system changes
• ci - CI/CD changes
• chore - Other changes
�feat - New feature
�fix - Bug fix
�docs - Documentation changes
�style - Code style changes
�refactor - Code refactoring
�perf - Performance improvements
�test - Test changes
�build - Build system changes
�ci - CI/CD changes
�chore - Other changes

Examples:
âœfeat-buffer-pooling
âœfix-windows-dll-exports
âœdocs-update-readme
âœrefactor/simplify-tensor-allocation
âœci-add-coverage-reporting
�feat-buffer-pooling
�fix-windows-dll-exports
�docs-update-readme
�refactor/simplify-tensor-allocation
�ci-add-coverage-reporting

Current branch: ❌ $BRANCH_NAME
Current branch: �$BRANCH_NAME

To fix this, rename your branch:
git branch -m $BRANCH_NAME <type>-<proper-description>
Expand All @@ -78,5 +78,9 @@ EOF
fi

# Branch name is valid
echo "âœBranch name '$BRANCH_NAME' is valid"
echo "�Branch name '$BRANCH_NAME' is valid"
exit 0




7 changes: 5 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DNOVA_LLM_ENABLE_LOGGING=ON \
-Dperegrine_ENABLE_LOGGING=ON \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
ninja -v || cmake --build . --config Release

Expand Down Expand Up @@ -92,4 +92,7 @@ jobs:
name: code-quality-reports
path: |
cppcheck-report.txt
clang-tidy-report.txt
clang-tidy-report.txt



9 changes: 6 additions & 3 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1 || true)
if [ -n "$TOOLCHAIN_FILE" ]; then
echo "Using toolchain file: $TOOLCHAIN_FILE"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DNOVA_LLM_BUILD_TESTS=OFF -DNOVA_LLM_ENABLE_LOGGING=OFF
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -Dperegrine_BUILD_TESTS=OFF -Dperegrine_ENABLE_LOGGING=OFF
else
echo "No conan_toolchain.cmake found, configuring without toolchain"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -DNOVA_LLM_BUILD_TESTS=OFF -DNOVA_LLM_ENABLE_LOGGING=OFF
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -Dperegrine_BUILD_TESTS=OFF -Dperegrine_ENABLE_LOGGING=OFF
fi

- name: Install Doxygen
Expand Down Expand Up @@ -87,4 +87,7 @@ jobs:

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4



14 changes: 9 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ jobs:
echo "Using toolchain file: $TOOLCHAIN_FILE"
cmake -S .. -B . \
-DCMAKE_BUILD_TYPE=Release \
-DNOVA_LLM_ENABLE_LOGGING=ON \
-Dperegrine_ENABLE_LOGGING=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
cmake --install . --config Release

- name: Create NovaLLM package (conan, Release)
- name: Create Peregrine package (conan, Release)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Release || (
Expand Down Expand Up @@ -103,11 +103,11 @@ jobs:
conan install .. --output-folder=. --build=missing -s build_type=Debug -o build_tests=True
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
echo "Using toolchain file: $TOOLCHAIN_FILE"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug -DNOVA_LLM_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug -Dperegrine_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Debug
cmake --install . --config Debug

- name: Create NovaLLM package (conan, Debug)
- name: Create Peregrine package (conan, Debug)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Debug || (
Expand Down Expand Up @@ -181,4 +181,8 @@ jobs:
echo "Using toolchain file: $TOOLCHAIN_FILE"
cmake -S ../standalone -B . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
#./NovaLLMStandalone || ./main || echo "No standalone binary found"
#./PeregrineStandalone || ./main || echo "No standalone binary found"




16 changes: 10 additions & 6 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
cd build
conan install .. --output-folder=. --build=missing -s build_type=Release -o build_tests=True
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -DNOVA_LLM_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release -Dperegrine_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
cmake --install . --config Release
- name: Create NovaLLM package (conan, Release)
- name: Create Peregrine package (conan, Release)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Release || (
Expand Down Expand Up @@ -91,10 +91,10 @@ jobs:
cd build-debug
conan install .. --output-folder=. --build=missing -s build_type=Debug -o build_tests=True
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug -DNOVA_LLM_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Debug -Dperegrine_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Debug
cmake --install . --config Debug
- name: Create NovaLLM package (conan, Debug)
- name: Create Peregrine package (conan, Debug)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Debug || (
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:

# Run tests one by one to ensure proper execution and output
echo "Running tests individually..."
for test_file in $(find . -name "NovaLLMTests*" -type f -executable); do
for test_file in $(find . -name "PeregrineTests*" -type f -executable); do
echo "Running $test_file..."
$test_file --gtest_output=xml:test_results.xml --gtest_filter="*Concurrent*" || (
echo "Test $test_file completed with issues, checking for coverage data..."
Expand Down Expand Up @@ -245,4 +245,8 @@ jobs:
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S ../standalone -B . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
# 可选:运行可执行文件
# 可选:运行可执行文�




14 changes: 9 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
cd build
conan install .. --output-folder=. --build=missing -s build_type=Release -o build_tests=True
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S .. -B . -G "${{ matrix.generator }}" -A x64 -DCMAKE_BUILD_TYPE=Release -DNOVA_LLM_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake -S .. -B . -G "${{ matrix.generator }}" -A x64 -DCMAKE_BUILD_TYPE=Release -Dperegrine_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
cmake --install . --config Release
- name: Create NovaLLM package (conan, Release)
- name: Create Peregrine package (conan, Release)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Release || (
Expand Down Expand Up @@ -97,10 +97,10 @@ jobs:
cd build-debug
conan install .. --output-folder=. --build=missing -s build_type=Debug -o build_tests=True
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S .. -B . -G "${{ matrix.generator }}" -A x64 -DCMAKE_BUILD_TYPE=Debug -DNOVA_LLM_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake -S .. -B . -G "${{ matrix.generator }}" -A x64 -DCMAKE_BUILD_TYPE=Debug -Dperegrine_ENABLE_LOGGING=ON -DCMAKE_INSTALL_PREFIX=../install-debug -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Debug
cmake --install . --config Debug
- name: Create NovaLLM package (conan, Debug)
- name: Create Peregrine package (conan, Debug)
run: |
cd "$GITHUB_WORKSPACE"
conan create . --user=local --channel=testing --build=missing -s build_type=Debug || (
Expand Down Expand Up @@ -168,4 +168,8 @@ jobs:
TOOLCHAIN_FILE=$(find $(pwd) -name "conan_toolchain.cmake" -type f | head -1)
cmake -S ../standalone -B . -G "${{ matrix.generator }}" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE"
cmake --build . --config Release
# 可选:运行可执行文件
# 可选:运行可执行文�




Loading
Loading