Skip to content

feat(models): add BitNet (1.58-bit ternary) support #252

Closed

Description

@inureyes

Summary

Port BitNet (bitnet plus bitlinear_layers), the 1.58-bit ternary-weight architecture.

Upstream references

Notes

BitNet replaces standard Linear with BitLinear (ternary {-1, 0, 1} weights plus activation quantization). This is the heaviest item in the new-model batch: it needs a ternary-weight linear path that does not exist in mlxcel today, so it touches the quantized-op / core layer level, not just a new model file. Validate output parity carefully against the reference.

Acceptance criteria

  • BitLinear (ternary weight plus activation quantization) implemented in the core layer / quantized-op path.
  • src/models/bitnet.rs implemented and registered in src/models/detection.rs.
  • bf16 / f16 handling consistent with mlxcel's quantized-weight policy (do not promote quantized scales / biases).
  • Unit tests for BitLinear numerics; docs/supported-models.md updated.
  • Validated with a real mlx-community BitNet checkpoint.

Effort

High (new ternary linear path in the core ops layer).

Activity

  1. added
    status:backlog
    type:enhancement
    priority:medium
    area:models
    area:core
    on Jun 13, 2026
  2. added this to the 0.3 milestone on Jun 21, 2026
  3. self-assigned this
    on Jun 21, 2026
  4. added
    status:done
    and removed
    status:backlog
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corearea:modelspriority:mediumstatus:donetype:enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions