Skip to content

feat: implement drop-in QuantLinear layer and recursive model converter - #3

Merged
Prajwal7-2002 merged 1 commit into
mainfrom
feature/drop-in-quant-linear
Oct 26, 2026
Merged

Prajwal7-2002 merged 1 commit into
mainfrom
feature/drop-in-quant-linear

Conversation

@Prajwal7-2002

Copy link
Copy Markdown
Owner

Summary

  • Introduces drop-in \QuantLinear\ module replacing \ orch.nn.Linear\ with zero-copy memory footprint calculation.
  • Backed by PyTorch persistent buffers (
    egister_buffer) rather than parameters to eliminate optimizer state allocation and autograd overhead during inference.
  • Overrides _load_from_state_dict\ to dynamically register incoming packed buffers and metadata, supporting seamless serialization roundtrips.
  • Implements \convert_model_to_quant\ recursive in-place layer converter with module class and name-based exclusion filters.
  • Supports INT4 blockwise, INT4 per-channel, INT8 affine/absmax, BitNet ternary (2-bit & base-3), and 2:4 structured sparsity.
  • Adds 8 comprehensive test suites achieving 93% line coverage across the codebase.

Add PyTorch QuantLinear module using persistent buffers, dynamic state_dict loading, in-place model conversion with exclusion filters, and comprehensive test suite.
@Prajwal7-2002
Prajwal7-2002 merged commit 1c1410b into main Oct 26, 2026
7 checks passed
@Prajwal7-2002
Prajwal7-2002 deleted the feature/drop-in-quant-linear branch October 26, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant