Add multilayer neural network#306
Merged
Merged
Conversation
Bench: 4157561
Bench: 3713163
Bench: 3609107
Bench: 3609107
Bench: 4457746
Bench: 4324337
Bench: 4408593
Bench: 4579505
Bench: 4518305
Bench: 3930050
Bench: 4495551
Bench: 4675375
Bench: 4373230
Bench: 4559824
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the engine’s NNUE evaluation to a multi-layer network with a new SIMD abstraction layer, and adjusts related tuning parameters and accumulator sizing to match the new architecture.
Changes:
- Replace the single hidden-layer NNUE with a 3-layer (L1/L2/L3) network and updated scaling/constants.
- Introduce a SIMD abstraction (
simd.hpp+ AVX2/AVX512 backends) and rewritennue_evalto use it. - Update accumulator sizing (HL_SIZE → L1_SIZE) and refresh usage in a few call sites; retune various search parameters.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| engine/params.hpp | Updates various tuned search parameters. |
| engine/nnue/simd.hpp | Declares SIMD abstraction types, constants, and APIs for AVX2/AVX512. |
| engine/nnue/simd.cpp | Selects the AVX backend implementation to compile. |
| engine/nnue/avx2.hpp | Implements SIMD abstraction using AVX2 intrinsics. |
| engine/nnue/avx512.hpp | Implements SIMD abstraction using AVX-512 intrinsics. |
| engine/nnue/network.hpp | Updates NNUE network layout to multi-layer weights/biases and new sizes. |
| engine/nnue/network.cpp | Updates network loading and rewrites nnue_eval for multi-layer forward pass. |
| engine/nnue/accumulator.hpp | Updates accumulator initialization loops to L1_SIZE. |
| engine/nnue/accumulator.cpp | Updates accumulator update/refresh loops to L1_SIZE. |
| engine/main.cpp | Updates a refresh call site to use full_refresh(pos, 0). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passed STC
https://ob.int0x80.ca/test/698/
Passed LTC
https://ob.int0x80.ca/test/700/
Bench: 4559824