Commit 8f6a0b5
authored
[BugFix]: Sparse2of4 example sparsity-only case (#1282)
The Sparse2of4 example supports two modes of operation:
- Sparsity-only
- Sparsity + Quantization (only supported for symmetric quantization)
In a recent update, we removed the `ConstantPruningModifier` from the
Sparse2of4 example and added a check to raise an error if **asymmetric
quantization** was being used. However, this check was incorrectly
placed outside the quantization-specific code path and unconditionally
accessed the scheme attribute from the quantization modifier.
This caused failures in sparsity-only cases, as reported in
[INFERENG-483](https://issues.redhat.com/browse/INFERENG-483).
### Fix
This PR moves the asymmetric quantization check inside the quantization
code path to ensure it is only evaluated when quantization is actually
enabled.
### Testing
The example was tested by running it both with and without the `--fp8`
flag. In both cases, successful completion was verified.
Signed-off-by: Rahul Tuli <rahul@neuralmagic.com>1 parent 85152fd commit 8f6a0b5
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments