Skip to content

Latest commit

 

History

History
153 lines (146 loc) · 9.79 KB

File metadata and controls

153 lines (146 loc) · 9.79 KB

BitNet-rs Project Checklist

Legend: ✅ Complete 🟡 Partial 🟠 Stub ❌ Missing

bitnet-rs/
├── Cargo.toml               ✅ Main workspace definition for all crates
├── .cargo/
│   └── config.toml          ✅ Cargo alias for `combine` (runs the file combiner GUI/CLI)
├── README.md                ✅ Project overview, build instructions, and usage examples
│   - [✅ ] README with usage examples
│   - [ ✅] Developer/contributor guide
├── src/
│   └── main.rs              🟠 Stub, placeholder for workspace-level utilities or integration tests.
├── logs/                    ✅ Directory for storing logs from tests and applications.
├── models/                  ✅ Directory for storing downloaded and converted model weights.
├── References/              ✅ Directory for storing reference materials, like the official BitNet implementation.
├── target/                  ✅ Build artifacts and dependencies (typically not tracked in Git).
├── custom-kernel-test/      ✅ Standalone project for kernel prototyping and validation.
│   ├── Cargo.toml             ✅
│   ├── README.md              ✅
│   ├── src/
│   │   ├── lib.rs             ✅
│   │   └── test_utils.rs      ✅ Test reporter utility.
│   └── tests/
│       ├── custom_kernel.rs   ✅ Test suite for custom WGSL kernels. [See Report](custom-kernel-test/logs/custom_kernel_test.md)
│       ├── consts.rs          ✅ Path constants for kernels.
│       ├── add_scalar_corrected.wgsl ✅ WGSL kernel for scalar addition test.
│       └── bitnet_kernel.wgsl ✅ WGSL kernel for BitNet matmul test.
|
├── crates/
│  
│   ├── bitnet-core/
│   │   ├── Cargo.toml         ✅ Core crate manifest
│   │   │   - [✅] Features: gpu flag; Deps: wgpu, half, thiserror, tokenizers, safetensors, hf-hub; GPU-only: wgpu
│   │   ├── README.md          ✅ Core library documentation
│   │   ├── src/
│   │   │   ├── lib.rs         ✅ Main library module declarations
│   │   │   ├── error.rs       ✅ Fully implemented using `thiserror` for robust error handling.
│   │   │   ├── model.rs       ✅ Complete, struct, forward logic, and loader implemented and tested.
│   │   │   ├── attention.rs   ✅ Complete for inference: robust, tested, batching, quantized, transformer-compatible. ❌ Missing : No training/LoRA yet.
│   │   │   ├── feed_forward.rs🟡 Partial, uses Squared ReLU (sufficient for b1.58), not SwiGLU as in all BitNet papers.
│   │   │   ├── rms_norm.rs    ✅ `RMSNorm` logic is fully implemented and tested.
│   │   │   ├── bitnet_linear.rs ✅ Quantized linear layer with `forward` pass and `from_record` loader.
│   │   │   ├── tokenizer.rs   ✅ Wrapper for Hugging Face tokenizer with encode/decode and basic chat formatting.
│   │   │   ├── settings.rs    ✅ `InferenceSettings` struct with defaults and builder methods implemented.
│   │   │   ├── embedding.rs   ✅ `Embedding` layer with `forward` pass implemented.
│   │   │   ├── wgpu_context.rs✅ GPU context management with device and queue initialization.
│   │   │   ├── training.rs    🟠 Stub, only a TODO is present.
│   │   │   ├── visualization.rs 🟠 Stub, only a TODO is present.
│   │   │   ├── kernels.rs     ✅ `pack_ternary_weights` and `calculate_weight_scales` are implemented and tested.
│   │   │   ├── kernels/
│   │   │   │   ├── bitnet_kernel.wgsl ✅ Optimized WGSL kernel for ternary matrix multiplication.
│   │   │   │   ├── bitnet_kernel_optimal.wgsl ✅ Optimized WGSL kernel variant.
│   │   │   │   ├── bitnet_kernel_wasm.wgsl ✅ WASM/browser-optimized kernel.
│   │   │   │   └── README.md          ✅ Documentation for BitNet kernels.
│   │   │   ├── gui/               # Core-level visualization and debugging UI for developers and advanced users
│   │   │   │   ├── mod.rs             ✅ GUI module declarations.
│   │   │   │   ├── dashboard.rs       🟠 Stub, minimal eframe app, no actual dashboard UI.
│   │   │   │   ├── weights_viewer.rs  🟠 Stub, placeholder UI, no visualization logic.
│   │   │   │   ├── kernel_profiler.rs 🟠 Stub, placeholder UI, no profiling logic.
│   │   │   │   ├── attention_map.rs   🟠 Stub, placeholder UI, no visualization logic.
│   │   │   │   └── README.md          ✅ Core GUI documentation.
│   │   │   ├── bitnetcore_test_utils.rs ✅ Test utilities for core module.
│   │   └── tests/
│   │       ├── kernel_tests.rs         ✅ Comprehensive correctness, dimension, and edge-case tests against a scalar reference.
│   │       ├── kernel_tests_fastest.rs ✅ Fastest kernel tests, similar to above.
│   │       ├── DX12_test.rs            ✅ DX12 backend tests.
│   │       ├── pipeline_integration.rs ✅ End-to-end pipeline test suite implemented with robust test reporting.
│   │       └── pipeline_validation.rs  🟡 Partial, test present for model loading/generation, not full golden tests.
│   │
│   ├── bitnet-converter/
│   │   ├── Cargo.toml             ✅ Converter crate manifest
│   │   ├── README.md              ✅ Converter documentation
│   │   ├── src/
│   │   │   ├── lib.rs             ✅ Programmatic API for conversion pipeline.
│   │   │   ├── main.rs            ✅ CLI fully implemented: parses args, runs conversion pipeline, saves streaming-friendly output.
│   │   │   ├── packer.rs          ✅ Quantize, permute, pack, and record logic fully implemented and tested.
│   │   │   └── source.rs          ✅ .safetensors (BF16) loading fully implemented and tested.
│   │   └── tests/
│   │       ├── official_parity.rs     ✅ Parity tests for official implementation.
│   │       └── serialization_test.rs  ✅ Unit tests for serialization, streaming, and record types.
│   │
│   ├── bitnet-app/
│   │   ├── Cargo.toml             ✅ App crate manifest
│   │   ├── README.md              ✅ App documentation
│   │   └── src/
│   │       ├── main.rs            🟠 Stub, only CLI/GUI stub present.
│   │       ├── cli.rs             🟠 Stub, only TODO present.
│   │       ├── generation.rs      🟠 Stub, only TODO present.
│   │       ├── sampler.rs         ✅ LogitsProcessor for sampling is implemented.
│   │       └── gui/
│   │           ├── mod.rs         ✅ GUI module declarations.
│   │           ├── app.rs         🟠 Stub, minimal UI.
│   │           ├── state.rs       🟠 Stub, minimal state struct.
│   │           ├── backend.rs     🟠 Stub, minimal backend logic.
│   │           └── README.md      ✅ App GUI documentation.
│   │
│   ├── bitnet-tools/
│   │   ├── Cargo.toml        ✅ Tools crate manifest
│   │   ├── README.md         ✅ Tools crate documentation
│   │   ├── src/
│   │   │   ├── lib.rs        ✅ Main library module declarations.
│   │   │   ├── error.rs      ✅ Shared BitNetError type.
│   │   │   ├── hf_loader.rs  ✅ Hugging Face model download utility.
│   │   │   ├── constants.rs  ✅ Workspace constants.
│   │   │   ├── combine.rs    ✅ File combination logic.
│   │   │   ├── test_utils.rs ✅ Test reporting utility (`TestReporter`).
│   │   │   └── bin/
│   │   │       ├── download_model.rs ✅ CLI tool to download models.
│   │   │       └── combine_files.rs  ✅ CLI tool to combine files.
│   │   └── gui_combiner/
│   │       ├── Cargo.toml    ✅ GUI sub-crate manifest
│   │       └── src/
│   │           └── main.rs   ✅ GUI entry point for file combiner.
│   │
│   ├── bitnet-test-utils/
│   │   └── src/
│   │       └── lib.rs        ✅ TestReporter utility for robust test reporting.
│   │
│   └── bitnet-wasm/
│       ├── Cargo.toml        ✅ WASM crate manifest
│       ├── README.md         ✅ WASM crate documentation
│       ├── src/
│       │   ├── lib.rs        ✅ WASM library entry point
│       │   ├── api.rs        ✅ WASM API bridge
│       │   ├── bin/
│       │   │   └── server.rs ✅ Dev server for local testing
│       │   └── tests.rs      ✅ WASM/browser test implementations
│       └── static/
│           ├── index.html    ✅ Demo web page
│           ├── style.css     ✅ Demo styles
│           ├── main.js       ✅ Demo JS
│           └── pkg/          ✅ WASM build output

Future/Optional (Roadmap)

  • Tauri/egui GUI integration
  • ONNX/other backend support

TODO / Roadmap

  • CLI/GUI chat loop in bitnet-app for end-to-end chat demo (🟠 Stub, needs implementation)
  • Training/LoRA support (❌ Missing, future work)
  • GPU attention kernel integration (🟡 Partial, only CPU path robust)
  • Flash attention/advanced features (❌ Missing, future work)
  • Integrate InferenceSettings (settings.rs) into the inference pipeline, attention, and generation modules (❌ Missing, future work)