Skip to content

Commit febdec3

Browse files
committed
fix code and instructions
1 parent 2275a66 commit febdec3

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,17 @@ This is a fork of llama.cpp with **NUMA-aware improvements** for better CPU thre
2525

2626
```bash
2727
# Manual build steps
28-
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
28+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DGGML_NUMA_MIRROR=ON
2929
cmake --build build --parallel $(nproc)
3030

3131
# Debug build
32-
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
32+
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DGGML_NUMA_MIRROR=ON
3333
cmake --build build --parallel $(nproc)
3434

3535
# Run tests
3636
ctest --list --output-on-failure
3737
```
3838

39-
### Available VS Code Tasks
40-
41-
- **Ctrl+Shift+P** → "Tasks: Run Task":
42-
- `cmake-configure` - Configure CMake
43-
- `cmake-build` - Build project (default)
44-
- `cmake-release` - Release build
45-
- `cmake-clean` - Clean build directory
46-
- `test-cpu-topology` - Test CPU topology detection
47-
- `check-numa` - Display NUMA hardware info
48-
4939
## 🧠 Key Areas of Focus
5040

5141
### 1. NUMA Memory Management

src/llama-model-loader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ void llama_model_loader::get_mapping_range(size_t * first, size_t * last, void *
927927
// Calculate the offset for this file within the unified mapping
928928
size_t file_offset = 0;
929929
for (int i = 0; i < idx; ++i) {
930-
file_offset += files[i]->size;
930+
file_offset += files[i]->size();
931931
}
932932

933933
*first = mapping->size(); // Start with full mapping size
@@ -946,10 +946,10 @@ void llama_model_loader::get_mapping_range(size_t * first, size_t * last, void *
946946

947947
// Adjust first and last to be relative to this file's start
948948
if (*first != mapping->size()) {
949-
*first = std::min(*first, files[idx]->size);
949+
*first = std::min(*first, files[idx]->size());
950950
}
951951
if (*last != 0) {
952-
*last = std::min(*last, files[idx]->size);
952+
*last = std::min(*last, files[idx]->size());
953953
}
954954
} else {
955955
#endif
@@ -984,7 +984,7 @@ void llama_model_loader::load_data_for(struct ggml_tensor * cur) const {
984984
// For unified mapping, calculate offset within the unified mapping
985985
size_t unified_offset = w.offs;
986986
for (int i = 0; i < w.idx; ++i) {
987-
unified_offset += files[i]->size;
987+
unified_offset += files[i]->size();
988988
}
989989

990990
const auto & mapping = mappings[0];

0 commit comments

Comments
 (0)