Skip to content

feat(logging): name the offending weight when compression is skipped - #85

Merged
pkmandke merged 13 commits into
apple:mainfrom
pkmandke:dev/log_layer_info
Sep 3, 2026
Merged

feat(logging): name the offending weight when compression is skipped#85
pkmandke merged 13 commits into
apple:mainfrom
pkmandke:dev/log_layer_info

Conversation

@pkmandke

@pkmandke pkmandke commented Sep 2, 2026

Copy link
Copy Markdown
Member

When a weight can't be compressed because its shape is incompatible with the block/group size, the skip warning now names the tensor and its shape. Previously quantization logged only the compression-target enum, and palettization logged no identifier.

Quantization:

# before:
Tensor (target: CompressionTargetTensor.WEIGHT) incompatible with block size configuration: Tensor size 12 along axis 0 is not divisible by block size 8. Skipping quantization.

# after:
Tensor '0.weight' (target: CompressionTargetTensor.WEIGHT, shape: (12, 8)) incompatible with block size configuration: Tensor size 12 along axis 0 is not divisible by block size 8. Skipping quantization.

Palettization:

# before:
Tensor incompatible with granularity: Tensor size 12 along axis 0 is not divisible by group_size 8. ... Skipping palettization.

# after:
Tensor '0.weight' (shape: (12, 8)) incompatible with granularity: Tensor size 12 along axis 0 is not divisible by group_size 8. ... Skipping palettization.

Implementation Detail:

A module can't discover its own FQN from inside forward(), which is where we actually log the warning. So added a tensor_fqn attribute to CompressionSimulatorBase, and populated it during prepare() (before the first forward):

  • eager: walk parametrizations and for every simulator in a ParametrizationList capture the parameter name it compresses.
  • graph: read the FQN off the get_attr node feeding each simulator.

Note: This is for weights only.

…ckwise

Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
@pkmandke pkmandke self-assigned this Sep 2, 2026
@pkmandke pkmandke changed the title enhanced logging for disabled compression scenarios feat(logging): name the offending weight when compression is skipped Sep 2, 2026
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Comment thread src/coreai_opt/config/spec/compression_simulator.py Outdated
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
@pkmandke
pkmandke marked this pull request as ready for review September 2, 2026 23:14
@pkmandke pkmandke assigned crowbat and unassigned pkmandke Sep 2, 2026
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Signed-off-by: Prathamesh Mandke <46148373+pkmandke@users.noreply.github.com>
Comment thread changelog.d/85.changed
@pkmandke
pkmandke merged commit d1accc4 into apple:main Sep 3, 2026
13 checks passed
@pkmandke
pkmandke deleted the dev/log_layer_info branch September 3, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants