-
Notifications
You must be signed in to change notification settings - Fork 35
[EISW-191805] Enable quantization for FP4 type #175
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
base: npu/release/20.x
Are you sure you want to change the base?
[EISW-191805] Enable quantization for FP4 type #175
Conversation
|
Can this be first brought to upstream MLIR? Also, does it by any chance conflict with what @Roman-Pevnyi is trying to do in upstream? (see llvm/llvm-project#152966) |
@andrey-golubev Wanted to merge it in the fork first. Right now enabling PSS tests for FP4 and further work on quantization to f4 are blocked without the change in MLIR.
It does not conflict, in fact, it works very well with Roman's change. Once that change is approved, enabling FP4 will be much simpler, and enabling further types will be even easier. However, we don't know when it will be merged upstream, and it is currently a blocker on our side. |
|
Do you have a testing PR in vpux-plugin that verifies CI when updating this submodule, to be linked here? |
I would strongly prefer to do it the other way around since merging to upstream is usually a painful process. Quantization changes are also evidently painful: the dialect evolved quite a bit since LLVM 18 up to LLVM 21 (we're now at LLVM 20).
I think this is now nice to do, but we also have automated tests running in CI! (See https://github.com/intel/npu-plugin-llvm/actions/runs/19365101483/job/55416928201?pr=175) |
andrey-golubev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. And it also looks fairly non-controversial. Please try to bring it up to the upstream community first!
Generally, it seems like most of the checks would benefit from isa<FloatType> kind of check. We just need 1 place somewhere (e.g. in verifier?) where we explicitly check that types are f4 / f8.
P.S.: Not approving yet - perhaps @sartil or @ZoranZomborat may want to take a look
andrey-golubev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, I think we can merge it "as is".
218bcff to
708bba0
Compare
|
Rebased. CI run with the submodule update in the PR-22333. @ZoranZomborat @sartil Could you please review? |
sartil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ZoranZomborat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great extension of the current logic!
|
@andrey-golubev @nikita-kud can you help with merge here |
Summary
After the vpux type is added for float4_e2m1, quantization should be enabled for this type, as it is for FP8. This MLIR change will allow for further adjustments to enable FP4 quantization in the compiler and enable the addition of PSS tests.
JIRA ticket
Related PR in NPU Compiler and/or OpenVINO repository with sub-module update
Other related tickets