Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYSTEMDS-3780] Compression-fused quantization #2226

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

anuunchin
Copy link

@anuunchin anuunchin commented Feb 13, 2025

This PR is part of the LDE project, addressing #3780.

What for?

To introduce a new instruction to fuse quantization and compression.

Given:

M2 = floor(M * S)
C = compress(M2)

This PR adds a rewrite and instruction that replaces the sequence with a new built-in function:
quantize_compress(M, S)

Currently covered

  • Rewrite detection - Identifies multiplication, floor, and compress sequences.quantize_compress()
  • Supports scalar and row-wise vector scale factors
  • New reader that directly quantizes input data
  • Some fast path compression scenarios that don't use readers
  • Bitmap encoding that takes into account quantization (not full)
  • Estimator that takes into account quantization (not full)

Further

  • Component tests
  • Extensive catches if not implemented on all levels
  • Missing fast path compression implementation
  • Enable full matrix scale factors
  • Docs

@anuunchin anuunchin marked this pull request as ready for review February 13, 2025 11:14
Copy link
Contributor

@Baunsgaard Baunsgaard left a comment

Choose a reason for hiding this comment

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

Lots of very good things,

I have left a few comments, And i would like to see some performance numbers.

Specifically, with the fused operator vs without.

You can run it across various sizes, or distinct values after quantization.

@anuunchin anuunchin force-pushed the main branch 2 times, most recently from 89b0774 to a6ba80a Compare February 15, 2025 11:16
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 53.72425% with 292 lines in your changes missing coverage. Please review.

Project coverage is 72.41%. Comparing base (78b23cf) to head (92a99c1).

Files with missing lines Patch % Lines
...sds/runtime/compress/colgroup/ColGroupFactory.java 38.06% 85 Missing and 11 partials ⚠️
...ntime/compress/estim/encoding/EncodingFactory.java 58.23% 54 Missing and 17 partials ⚠️
...e/sysds/runtime/compress/bitmap/BitmapEncoder.java 46.91% 38 Missing and 5 partials ⚠️
...untime/compress/colgroup/ColGroupUncompressed.java 25.00% 26 Missing and 7 partials ⚠️
...apache/sysds/parser/BuiltinFunctionExpression.java 0.00% 15 Missing ⚠️
...time/instructions/cp/CompressionCPInstruction.java 76.00% 5 Missing and 7 partials ⚠️
...untime/compress/readers/ReaderColumnSelection.java 33.33% 5 Missing and 5 partials ⚠️
...s/rewrite/RewriteQuantizationFusedCompression.java 79.54% 5 Missing and 4 partials ⚠️
...in/java/org/apache/sysds/parser/DMLTranslator.java 0.00% 2 Missing ⚠️
.../sysds/runtime/instructions/InstructionParser.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2226      +/-   ##
============================================
- Coverage     72.46%   72.41%   -0.06%     
- Complexity    45453    45563     +110     
============================================
  Files          1469     1471       +2     
  Lines        170893   171447     +554     
  Branches      33325    33488     +163     
============================================
+ Hits         123846   124158     +312     
- Misses        37630    37819     +189     
- Partials       9417     9470      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants