Commit 1e309b4
morelos
Update base for Update on "[ET-VK][Ops] affine quantization operators registration"
# Context
In order to enable dynamic quantization, especially for the source transform method using `Int8DynActInt4WeightQuantizer` we need to have vulkan versions for `quantize_affine`, `dequantize_affine`, and `choose_qparams_affine`. Currently we do not have a shader that performs block-based quantization as expected from these shaders, so we delegate to the per_tensor variant just to get unblocked. At a later stage, this will likely be developed more on in order to ensure we don't get too much accuracy loss.
# Changes
This creates a schema reference in the TorchAO library for out variants of these respective operators. Then there is a VK_REGISTER_OP done on them to ensure that we can properly register them when lowering the ET model with vulkan. Also the vulkan_quantizer is changed a bit in this to enable a dynamic quantization config so that we aren't purely working with just static quantization anymore.
Furthermore, we have `_annotate_for_static_quantization_config` for parity/legacy reasons, and we simply create an equivalent dynamic quantization config method.
We also changed `Linear.cpp`, particularly to allow a passthrough for weight_data since during dynamic quantization it's possible that it'll be a tensor_data than tensor_ref.
Differential Revision: [D78035354](https://our.internmc.facebook.com/intern/diff/D78035354/)
[ghstack-poisoned]1 parent c8ec32f commit 1e309b4
File tree
3 files changed
+36
-127
lines changed- backends/vulkan/test/op_tests
- extension/aten_util/test
3 files changed
+36
-127
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | 590 | | |
602 | 591 | | |
603 | 592 | | |
| |||
632 | 621 | | |
633 | 622 | | |
634 | 623 | | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | 624 | | |
676 | 625 | | |
677 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | 492 | | |
504 | 493 | | |
505 | 494 | | |
| |||
534 | 523 | | |
535 | 524 | | |
536 | 525 | | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | 526 | | |
578 | 527 | | |
579 | 528 | | |
| |||
Lines changed: 36 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
| 428 | + | |
428 | 429 | | |
429 | | - | |
430 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
431 | 433 | | |
432 | 434 | | |
433 | 435 | | |
| |||
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
445 | | - | |
| 447 | + | |
| 448 | + | |
446 | 449 | | |
447 | | - | |
448 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
449 | 453 | | |
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
453 | 457 | | |
454 | 458 | | |
455 | 459 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
460 | 464 | | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
464 | 468 | | |
465 | 469 | | |
466 | 470 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
471 | 475 | | |
472 | 476 | | |
473 | | - | |
| 477 | + | |
| 478 | + | |
474 | 479 | | |
475 | 480 | | |
476 | 481 | | |
477 | 482 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
483 | 489 | | |
484 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
485 | 493 | | |
486 | 494 | | |
487 | 495 | | |
488 | 496 | | |
489 | | - | |
490 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
491 | 500 | | |
492 | 501 | | |
493 | 502 | | |
494 | | - | |
| 503 | + | |
| 504 | + | |
495 | 505 | | |
496 | 506 | | |
497 | 507 | | |
498 | | - | |
| 508 | + | |
| 509 | + | |
499 | 510 | | |
500 | 511 | | |
501 | 512 | | |
0 commit comments