Skip to content

Commit 0e32fd8

Browse files
authored
Fix node output issues (microsoft#2497)
This pull request updates the `_quantize_matmul` function to improve compatibility with downstream consumers by preserving the names of graph outputs during quantization. Now, only intermediate output names are modified, ensuring that external tools relying on specific output names continue to work as expected. Output name handling: * Updated `_quantize_matmul` in `olive/passes/onnx/kquant_quantization.py` to only rename intermediate outputs, preserving the names of graph outputs so downstream consumers (such as `genai_config.json`) remain compatible.
1 parent 50e535f commit 0e32fd8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

olive/passes/onnx/kquant_quantization.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ def _quantize_matmul(
380380
if accuracy_level > 0:
381381
kwargs["accuracy_level"] = accuracy_level
382382

383-
node.outputs[0].name = node.outputs[0].name + f"_Q{bits}"
383+
# Only rename intermediate outputs; preserve graph output names so
384+
# downstream consumers (e.g. genai_config.json) keep working.
385+
if node.outputs[0] not in node.graph.outputs:
386+
node.outputs[0].name = node.outputs[0].name + f"_Q{bits}"
384387

385388
return ir.node(
386389
domain=MSFT_DOMAIN,

0 commit comments

Comments
 (0)