Bring traditional-local to feature parity for built-in model comparisons#22
Merged
sharpninja merged 2 commits intomainfrom Mar 21, 2026
Merged
Conversation
Co-authored-by: sharpninja <16146732+sharpninja@users.noreply.github.com> Agent-Logs-Url: https://github.com/sharpninja/BitNet-b1.58-Sharp/sessions/0123abc0-11dc-4c81-a8ba-d7c1cc9de437
Copilot
AI
changed the title
[WIP] Ensure traditional model has same features as bitnet model
Bring Mar 21, 2026
traditional-local to feature parity for built-in model comparisons
sharpninja
approved these changes
Mar 21, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR brings the traditional-local model up to parity with the built-in BitNet model for repo workflows (benchmark comparisons, checkpoint round-tripping, and CLI inspection), so both models can be compared through the same training/visualization surfaces.
Changes:
- Add JSON checkpoint save/load + round-trip validation for
TraditionalLocalModel. - Expose
traditional-localweight sign distribution viaIInspectableHostedAgentModeland propagate real counts intoTrainingReport. - Update CLI/UI strings + docs to use model-neutral “Weight sign distribution”, and add tests covering round-trips and inspection parity.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/BitNetSharp.Tests/TraditionalLocalCheckpointTests.cs | Adds a checkpoint save/load round-trip test for TraditionalLocalModel. |
| tests/BitNetSharp.Tests/HostedAgentBenchmarksExecutionTests.cs | Adds cross-model checkpoint round-trip execution coverage for both built-ins. |
| tests/BitNetSharp.Tests/BitNetModelTests.cs | Verifies non-placeholder weight sign distribution and inspectable stats for traditional-local. |
| src/BitNetSharp.Core/TraditionalLocalModel.cs | Implements weight sign stats + exports/imports of learned state; populates TrainingReport with real counts. |
| src/BitNetSharp.Core/TraditionalLocalCheckpoint.cs | Introduces JSON checkpoint serialization + load and validation helpers for traditional-local. |
| src/BitNetSharp.Core/BitNetVisualizer.cs | Generalizes histogram title to “Weight sign distribution”. |
| src/BitNetSharp.App/TraditionalLocalHostedAgentModel.cs | Implements IInspectableHostedAgentModel for traditional-local. |
| src/BitNetSharp.App/Program.cs | Generalizes CLI inspection messaging and histogram title for inspectable models. |
| docs/usage.md | Updates usage text to reflect inspection parity across built-in models. |
| docs/training-and-visualization.md | Updates visualization docs to reflect model-neutral signed weight histogram output. |
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.
The built-in comparison path was asymmetric:
bitnet-b1.58-sharpsupported checkpoint round-tripping and runtime inspection surfaces thattraditional-localdid not. This change closes those gaps so both built-in models can be compared through the same repository workflows.Checkpoint parity
TraditionalLocalCheckpointwith JSON save/load support and round-trip validation.Inspection parity
TraditionalLocalHostedAgentModelimplementIInspectableHostedAgentModel.GetTernaryWeightStats()fromTraditionalLocalModelso the CLI can inspect both built-in models instead of treatingtraditional-localas unsupported.Weight sign distribution.Training report parity
0/0/0weight counts from traditional-model training.TrainingReportwith real negative/zero/positive counts derived from the trained traditional model state.Comparison coverage
Docs
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.