This repository was archived by the owner on Nov 27, 2025. It is now read-only.
Extending UniformQuantizedType with interface-based support for new storage types in Quant dialect#149
Draft
Roman-Pevnyi wants to merge 1 commit intointel:npu/release/19.xfrom
Conversation
lmielick
reviewed
Jul 31, 2025
lmielick
reviewed
Jul 31, 2025
lmielick
reviewed
Jul 31, 2025
| int64_t getDefaultMinimum(bool isSigned, unsigned integralWidth) const { | ||
| return -getDefaultMaximum(isSigned, integralWidth); | ||
| } | ||
| std::string printStorageType([[maybe_unused]] bool isSigned, [[maybe_unused]] unsigned storageWidth) const { |
Contributor
There was a problem hiding this comment.
Not sure we should have print method here. Isn't there more canonical way to stringify type name?
It's more getStorageTypeName
lmielick
reviewed
Jul 31, 2025
| } | ||
| return llvm::maxUIntN(integralWidth); | ||
| } | ||
| std::string printStorageType(bool isSigned, unsigned storageWidth) const { |
Contributor
There was a problem hiding this comment.
Do we need to pass these argument from outside?
Isn't there some existing interface we can use here to get these directly from this?
…ck) (intel#142) Add a new API to access all blobs that are stored in the blob manager. The main purpose (as of now) is to allow users of dialect resources to iterate over all blobs, especially when the blobs are no longer used in IR (e.g. the operation that uses the blob is deleted) and thus cannot be easily accessed without manual tracking of keys.
d6153a3 to
9ad9c9f
Compare
ZoranZomborat
approved these changes
Aug 6, 2025
Contributor
ZoranZomborat
left a comment
There was a problem hiding this comment.
Proposal looks great! Let's also get some feedback from LLVM discourse and motivate with our cases;
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Currently, UniformQuantizedType only supports built-in MLIR storage types such as Integer. LLM quantization research introducing feature of using NF4 as a low precision datatype (see https://arxiv.org/pdf/2305.14314). There is a growing need to make the system extensible and maintainable as more types are added. Ensuring that MLIR can natively support NF4 through a clean, extensible interface is essential for both current and future quantization workflows.
Current Approach and Its Limitations:
Proposed Interface-Based Approach:
Benefits: