(pt2e_quantize: str)
| 307 | |
| 308 | |
| 309 | def get_vulkan_quantizer(pt2e_quantize: str): |
| 310 | from executorch.backends.vulkan.quantizer.vulkan_quantizer import ( |
| 311 | get_symmetric_quantization_config as get_symmetric_quantization_config_vulkan, |
| 312 | VulkanQuantizer, |
| 313 | ) |
| 314 | |
| 315 | if pt2e_quantize == "vulkan_8w": |
| 316 | config = get_symmetric_quantization_config_vulkan( |
| 317 | is_dynamic=False, weight_bits=8 |
| 318 | ) |
| 319 | else: |
| 320 | raise ValueError(f"Unsupported Vulkan quantizer specification {pt2e_quantize}") |
| 321 | |
| 322 | quantizer = VulkanQuantizer().set_global(config) |
| 323 | return quantizer |
| 324 | |
| 325 | |
| 326 | def get_tosa_quantizer(version: str, pt2e_quantize: str): |
no test coverage detected