Skip to content

Enable support for FP4 weight quantization for non-conv layers - #34

Merged
pareshs44 merged 1 commit into
apple:mainfrom
pareshs44:enable_fp4_quantization_for_non_conv_layers
Jul 13, 2026
Merged

Enable support for FP4 weight quantization for non-conv layers#34
pareshs44 merged 1 commit into
apple:mainfrom
pareshs44:enable_fp4_quantization_for_non_conv_layers

Conversation

@pareshs44

Copy link
Copy Markdown
Contributor

This PR enables FP4 quantization using coreai-opt, by fixing the following issues:

  1. Handling subbyte tensors with safetensors, which doesn't have that support by default.
  2. Update the validate_fp4_export method to enable 4D tensors as well with 32 block size.

I tested these changes by using fp4 compression for exporting models, then running the benchmark on GPU. I have also added some unit tests to verify these paths.

Comment thread tests/export/test_eager_mlir_export_embedding.py Outdated
Comment thread tests/export/test_eager_mlir_export_embedding.py Outdated
@pareshs44
pareshs44 force-pushed the enable_fp4_quantization_for_non_conv_layers branch from 2cbd426 to ae88ade Compare July 13, 2026 11:57
pkmandke
pkmandke previously approved these changes Jul 13, 2026
Comment thread tests/test_utils/test_torch_utils.py
vineet-g
vineet-g previously approved these changes Jul 13, 2026
@pareshs44
pareshs44 dismissed stale reviews from vineet-g and pkmandke via 24ff1fb July 13, 2026 16:36
@pareshs44
pareshs44 force-pushed the enable_fp4_quantization_for_non_conv_layers branch from ae88ade to 24ff1fb Compare July 13, 2026 16:36
@pareshs44
pareshs44 requested review from pkmandke and vineet-g July 13, 2026 16:57
@pareshs44
pareshs44 merged commit 256d4c4 into apple:main Jul 13, 2026
8 checks passed
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.

3 participants