Skip to content

176 set model constants architecture hyperparameters - #203

Merged
thejhh merged 1 commit into
bitnetfrom
176-set-model-constants-architecture-hyperparameters
May 21, 2025
Merged

176 set model constants architecture hyperparameters#203
thejhh merged 1 commit into
bitnetfrom
176-set-model-constants-architecture-hyperparameters

Conversation

@thejhh

@thejhh thejhh commented May 21, 2025

Copy link
Copy Markdown
Contributor

Changes

  • Updated model architecture constants in pkg/bitnet/internal/config/config.go to match BitNet b1.58-2B specification:
    • Set HiddenSize to 2560
    • Set IntermediateSize to 6912
    • Set NumHiddenLayers to 30
    • Set NumAttentionHeads to 20
    • Set NumKeyValueHeads to 5
    • Set MaxPositionEmbeddings to 4096
    • Added HiddenAct as "relu2" for squared ReLU activation
    • Added NormType as "rms" for RMS normalization
    • Added RMSNormEps as 1e-6 for RMS normalization epsilon

Test Coverage

  • Current coverage: 83.0%
  • Coverage changes: 83.0% → 83.0%

Performance Metrics

Memory Usage

Tensor Operations

  • Allocations per operation:
    • New tensor creation: 120 allocs/op
    • Get/Set operations: 0 allocs/op
    • Parallel operations: 160749 allocs/op

BitNet Model Operations

CPU Performance

Tensor Operations

  • Operation timing:
    • Basic operations: 11.87 ns/op
    • Parallel operations: 97795 ns/op
    • Large tensor operations: 1068 ns/op

BitNet Model Operations

Areas for Improvement

High Priority

Medium Priority

Low Priority

Closes #176

@thejhh thejhh linked an issue May 21, 2025 that may be closed by this pull request
@thejhh
thejhh changed the base branch from main to bitnet May 21, 2025 16:14

@thejhh thejhh left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine

@thejhh
thejhh merged commit d903685 into bitnet May 21, 2025
@thejhh thejhh added the bitnet BitNet implementation label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bitnet BitNet implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set Model Constants (BitNet-b1.58-2B-4T Hyperparameters)

1 participant