Commit aabb710
Han Wang
feat(pt_expt): use inductor+dynamic for training compile
Replace aot_eager+padding+manual recompile with symbolic make_fx +
torch.compile(backend="inductor", dynamic=True). The compiled graph
natively handles varying nframes/nloc/nall so the per-batch padding
and runtime _recompile pass can be removed.
Use a trace-time nframes of 7 (prime) and reshape with -1 in dpmodel
(general_fitting, env_mat) to prevent PyTorch's symbolic tracer from
unifying the batch dim with numb_fparam / numb_aparam / ntypes /
dim_case_embd. Add TestCompiledVaryingNframesWithParams covering
collisions with fparam/aparam, and TestCompileCaseEmbdVaryingNframes
covering dim_case_embd > 0 with runtime nframes matching the embed dim.1 parent 665b85a commit aabb710
5 files changed
Lines changed: 541 additions & 235 deletions
File tree
- deepmd
- dpmodel
- fitting
- utils
- pt_expt/train
- source/tests/pt_expt
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
678 | 683 | | |
679 | 684 | | |
680 | 685 | | |
681 | 686 | | |
682 | 687 | | |
683 | 688 | | |
684 | 689 | | |
685 | | - | |
| 690 | + | |
686 | 691 | | |
687 | 692 | | |
688 | 693 | | |
| |||
697 | 702 | | |
698 | 703 | | |
699 | 704 | | |
700 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
701 | 708 | | |
702 | 709 | | |
703 | 710 | | |
| |||
744 | 751 | | |
745 | 752 | | |
746 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
747 | 757 | | |
748 | | - | |
| 758 | + | |
| 759 | + | |
749 | 760 | | |
750 | 761 | | |
751 | 762 | | |
| |||
761 | 772 | | |
762 | 773 | | |
763 | 774 | | |
764 | | - | |
| 775 | + | |
765 | 776 | | |
766 | 777 | | |
767 | 778 | | |
| |||
778 | 789 | | |
779 | 790 | | |
780 | 791 | | |
781 | | - | |
| 792 | + | |
782 | 793 | | |
783 | 794 | | |
784 | 795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
| 81 | + | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
| 84 | + | |
79 | 85 | | |
80 | | - | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
0 commit comments