Commit 4fb1a55
Add context manager to use next batch context for postprocs (meta-pytorch#2939)
Summary:
Pull Request resolved: meta-pytorch#2939
Small refactor to reduce code repetition of setting and reverting pipelined postprocs context to the next batch's context
Differential Revision: D738246001 parent 54723ee commit 4fb1a55
File tree
2 files changed
+37
-28
lines changed- torchrec/distributed/train_pipeline
2 files changed
+37
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
795 | | - | |
796 | | - | |
797 | 796 | | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 797 | + | |
| 798 | + | |
808 | 799 | | |
809 | 800 | | |
810 | 801 | | |
| |||
1325 | 1316 | | |
1326 | 1317 | | |
1327 | 1318 | | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
1343 | | - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
1344 | 1328 | | |
1345 | 1329 | | |
1346 | 1330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
1797 | 1799 | | |
1798 | 1800 | | |
1799 | 1801 | | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
1800 | 1824 | | |
1801 | 1825 | | |
1802 | 1826 | | |
| |||
1808 | 1832 | | |
1809 | 1833 | | |
1810 | 1834 | | |
| 1835 | + | |
1811 | 1836 | | |
1812 | 1837 | | |
1813 | 1838 | | |
| |||
0 commit comments