Skip to content

winml analyze --run-unknown-op: debug print() statements in QDQGenerator pollute stdout #231

@DingmaomaoBJTU

Description

@DingmaomaoBJTU

Summary

QDQGenerator.__init__ and its helper methods contain leftover print() debug statements that fire whenever winml analyze --run-unknown-op is used. These prints go to stdout and corrupt any JSON output piped from the command.

Steps to Reproduce

winml analyze --model model.onnx --ep qnn --device NPU --run-unknown-op --output result.json

Actual stdout (excerpt mixed into JSON output)

DequantizeLinear schema since_version: 1
QuantizeLinear schema since_version: 1
DequantizeLinear weight types: ['tensor(int8)', 'tensor(uint8)', ...]
DequantizeLinear output types: ['tensor(float)']
DequantizeLinear all weight types: [...]
QuantizeLinear activation types: [...]
...

Root Cause

src/winml/modelkit/pattern/op_input_gen/qdq_gen.py lines 55–57, 66–68, 120–122, and following lines contain bare print() calls in QDQGenerator.__init__, _build_dq_type_vars, and _build_q_type_vars. These are debug-time artifacts that were never converted to logging.debug().

Impact

  • Corrupts --output JSON file when --run-unknown-op is enabled (the print output goes to stdout before the JSON writer redirects)
  • Noisy for any user running winml analyze

Expected Behavior

All print() calls in qdq_gen.py should be converted to logger.debug(...) or removed.

Severity

P2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions