Skip to content

[devtools] Add preprocessing support to NumericalComparatorBase#17433

Open
Gasoonjia wants to merge 5 commits intogh/gasoonjia/119/basefrom
gh/gasoonjia/119/head
Open

[devtools] Add preprocessing support to NumericalComparatorBase#17433
Gasoonjia wants to merge 5 commits intogh/gasoonjia/119/basefrom
gh/gasoonjia/119/head

Conversation

@Gasoonjia
Copy link
Contributor

@Gasoonjia Gasoonjia commented Feb 13, 2026

Stack from ghstack (oldest at bottom):

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:

  • Extended NumericalComparatorBase with:
    • __init__(inspector) to store optional Inspector reference for accessing graph metadata
    • preprocessing(mapping) method that can be overridden for custom tensor transformations (default: identity)
    • element_compare(a, b) abstract method for element-level tensor comparison
    • compare(mapping, ...) method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: D93169813

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Feb 13, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17433

Note: Links to docs will display an error until the docs builds have been completed.

❌ 3 New Failures

As of commit 73d8ae3 with merge base 6e31609 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 13, 2026
Gasoonjia added a commit that referenced this pull request Feb 13, 2026
This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

ghstack-source-id: 340935651
Pull Request resolved: #17433
@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

…rBase"

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

[ghstack-poisoned]
Gasoonjia added a commit that referenced this pull request Feb 13, 2026
Pull Request resolved: #17433

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)
ghstack-source-id: 340943620
…rBase"

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

[ghstack-poisoned]
Gasoonjia added a commit that referenced this pull request Feb 13, 2026
Pull Request resolved: #17433

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud
ghstack-source-id: 340952320

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)
…rBase"

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

[ghstack-poisoned]
…rBase"

This change extends NumericalComparatorBase to support custom preprocessing before numeric gap calculation, enabling backends like Qualcomm to apply necessary tensor transformations (e.g., dequantization, layout conversion) before comparison.

Key changes:
- Extended NumericalComparatorBase with:
  - `__init__(inspector)` to store optional Inspector reference for accessing graph metadata
  - `preprocessing(mapping)` method that can be overridden for custom tensor transformations (default: identity)
  - `element_compare(a, b)` abstract method for element-level tensor comparison
  - `compare(mapping, ...)` method that orchestrates the full pipeline: preprocessing → element-wise compare → aggregate to DataFrame

This is part of the operator-level numeric discrepancy detector project for ExecuTorch Qualcomm backend (#16381).

Design doc: https://docs.google.com/document/d/1GaCHiy9InytOsUrl2BKEgOiP1iKTfpCVdWg6QDh0N2E/edit?tab=t.0#heading=h.fcrpnrtb6cud

Differential Revision: [D93169813](https://our.internmc.facebook.com/intern/diff/D93169813/)

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant