-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Naive Run Compressed Pt. 2 #62
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Satrat
changed the title
[Don't Merge Yet] Naive Run Compressed Pt. 2
Naive Run Compressed Pt. 2
Aug 7, 2024
Satrat
requested review from
bfineran,
kylesayrs,
dsikka,
horheynm,
robertgshaw2-neuralmagic and
rahul-tuli
August 12, 2024 15:54
bfineran
previously approved these changes
Aug 19, 2024
markmc
pushed a commit
to markmc/llm-compressor
that referenced
this pull request
Nov 13, 2024
* small fixes * initial commit * bug fixes * cleanup * clarity comments * clean up compression classes * fixing zero point issues * comment for hack * update quant check * cleanup fp8 dtypes * cleanup * clean up observer * dtype fix * docstrings * fixes after rebase * test fixes * style * get rid of broken segment * fix broken code
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY:
Follow up PR to neuralmagic/compressed-tensors#109, enables loading compressed models into
SparseAutoModel
, each quantized layer is decompressed on the forward pass.run_compressed
argument to SparseAutoModelTEST PLAN:
Manual example, will follow up with integration tests once the compressed-tensor branch merges
Output:
["<|begin_of_text|>I love 8 bit quantization because it's a great way to reduce the precision of floating point numbers and make them more compact. It's also a great way to make them more robust against noise and quantization errors.\n\nHere's a simple example of how you can implement 8 bit quantization in Python:\n```\nimport numpy as np\n\ndef quantize(x, bits=8):\n x_min = np.min(x)\n x_max = np.max(x)\n scale = "]
Runtime: ~26sec on two A4000s, ~65sec for the non-compressed version