Only set torch preference for engined that actually work#3979
Only set torch preference for engined that actually work#3979SuperSandro2000 wants to merge 1 commit into
Conversation
qnnpack does not work on x86 and fbgemm uses x86 specific instructions.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR tweaks the selection logic for PyTorch quantized backends in the smart fades provider, aiming to simplify how the quantized engine is chosen.
Changes:
- Simplified engine “preference” from an ordered list to a single preferred engine per architecture (ARM vs non-ARM).
- Adjusted quantized engine selection to only enable the single preferred engine if supported.
| preference = "qnnpack" if is_arm else "fbgemm" | ||
| supported_engines = torch.backends.quantized.supported_engines | ||
| quantized_engine = next((e for e in preference if e in supported_engines), None) | ||
| quantized_engine = preference if preference in supported_engines else None |
|
@SuperSandro2000 there is an outstanding copilot comment and conficts which are blocking progress here. |
|
Thanks @SuperSandro2000, and sorry this sat a while. The audio-analysis engine selection has since been reworked (#4249, #4257): on x86 we now gate setup behind an AVX2 capability check and select |
qnnpack does not work on x86 and fbgemm uses x86 specific instructions.
What does this implement/fix?
When packaging Music Assistant for NixOS I noticed due to our systemd hardening that qnnpack failed to set up and according to the internet qnnpack probably does not even work on my x86 hardware.
Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.