Skip to content

question about disable_per_channel_for_dense_layers in convert.py #3596

@TeahyungKim

Description

@TeahyungKim

Hello, I have a question about disable_per_channel_for_dense_layers.

I’m currently using QuantizationDebugger for quantization, and in this part of the code, the convert.mlir_quantize() function is called with the disable_per_channel_for_dense_layers argument set to its default value.
As a result, it is always disable_per_channel_for_dense_layers=False, which is causing an issue.

The real problem is that it’s set to this default value. Although the option is deprecated, it still causes problems for users like me who are using NNAPI. This eventually leads to the following error in android.

08-28 12:03:58.063 E 23797 23797 OperationValidationUtils: NN_RET_CHECK failed (packages/modules/NeuralNetworks/common/types/src/OperationsValidationUtils.cpp:38type == expectedTypes[i] Invalid input tensor type TENSOR_QUANT8_SYMM_PER_CHANNEL for input 1, expected TENSOR_QUANT8_ASYMM_SIGNED 08-28 12:03:58.063 E 23797 23797 ModelBuilder: Invalid Operation: NN_RET_CHECK failed (packages/modules/NeuralNetworks/common/types/operations/src/FullyConnected.cpp:120 validateInputTypes(context, inExpectedTypes)

I’d like to ask if it would be possible to set this option’s default back to True, as it was before tf 2.17.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions