Skip to content

Lazy load x86 import#4012

Closed
lucylq wants to merge 1 commit intopytorch:mainfrom
lucylq:lazy-load-x86
Closed

Lazy load x86 import#4012
lucylq wants to merge 1 commit intopytorch:mainfrom
lucylq:lazy-load-x86

Conversation

@lucylq
Copy link

@lucylq lucylq commented Mar 5, 2026

This is breaking executorch ci, see https://hud.pytorch.org/hud/pytorch/executorch/main/1?per_page=50&name_filter=unittest%20%2F%20macos

Error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/lfq/executorch/third-party/ao/torchao/testing/pt2e/utils.py", line 27, in <module>
    import torchao.quantization.pt2e.quantizer.x86_inductor_quantizer as xiq
  File "/Users/lfq/executorch/third-party/ao/torchao/quantization/pt2e/quantizer/x86_inductor_quantizer.py", line 1644, in <module>
    _register_quantization_weight_pack_pass()
  File "/Users/lfq/executorch/third-party/ao/torchao/quantization/pt2e/inductor_passes/x86.py", line 3221, in _register_quantization_weight_pack_pass
    if not torch.ops.mkldnn._is_mkldnn_acl_supported():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lfq/miniconda3/envs/executorch/lib/python3.12/site-packages/torch/_ops.py", line 1353, in __getattr__
    raise AttributeError(
AttributeError: '_OpNamespace' 'mkldnn' object has no attribute '_is_mkldnn_acl_supported'

Lazy load the x86 import, as macos doesnt have mkldnn

Test locally in executorch

(executorch) lfq@lfq-mac executorch % pytest --collect-only backends/xnnpack/test/quantizer/test_pt2e_quantization.py

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 5, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4012

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

⚠️ 1 Awaiting Approval, 12 Pending

As of commit 0c08c66 with merge base 5a5029d (image):

AWAITING APPROVAL - The following workflow needs approval before CI can run:

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 Mar 5, 2026
@lucylq lucylq marked this pull request as ready for review March 6, 2026 00:05
@jainapurva jainapurva added the module: not user facing Use this tag if you don't want this PR to show up in release notes label Mar 6, 2026
@lucylq lucylq closed this Mar 6, 2026
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. module: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants