SIGN IN SIGN UP

Do not raise error when quant primitives are left after partitioner (#10573)

Currently _sanity_check_graph_for_non_decomp_ops raises an Exception if
a delegate asks an op for preservation, but doesn't lower it.

In general, this is a sensible thing to do, but for quant primitives, it
is less sensible. Since what gets lowered are patterns involving the
quant primitives and FP32 ops.

XNNPACK asks that quant primitives be preserved, and so if a quant
primitive is not lowered (e.g., it is part of embedding quant), an error
is thrown.

In this PR, we:

* Define a central location for _QUANT_PRIMITIVES (with TODO task of
moving this to torchao)
* Use these _QUANT_PRIMITIVES to avoid raising an error in
_sanity_check_graph_for_non_decomp_ops
* Use _QUANT_PRIMITIVES in tracer.py to no decompose during to_edge and
const_prop_pass to not constant propagate (this logic existed
previously, but is being rewritten using the central _QUANT_PRIMITIVES
list).
S
Scott Roy committed
a2b9952270818a713882ff2c6f755663d651cd46
Parent: 48ad9f6
Committed by GitHub <noreply@github.com> on 5/1/2025, 1:58:18 AM