Commit febf3f0
Enabling DMP to init raw_id_tracker if configured (meta-pytorch#3502)
Summary:
This diff introduces init_raw_id_tracker to initialize RawIdTracker if enabled through ModelTrackerConfig
Key Changes
-----------
1. **Added `TrackerType` enum** in [`**types.py**`](command:code-compose.open?%5B%22%2Fdata%2Fusers%2Fmaliafzal%2Ffbsource%2Ffbcode%2Ftorchrec%2Fdistributed%2Fmodel_tracker%2Ftypes.py%22%2Cnull%5D "/data/users/maliafzal/fbsource/fbcode/torchrec/distributed/model_tracker/types.py")
* Defines three tracker types: `NONE`, `TREC` (for EC/EBC), and `RAW_ID` (for MPZCH)
* Extended `ModelTrackerConfig` dataclass with `tracker_type` field (defaults to `TrackerType.NONE`)
2. **Enhanced DMP initialization** in [`**model_parallel.py**`](command:code-compose.open?%5B%22%2Fdata%2Fusers%2Fmaliafzal%2Ffbsource%2Ffbcode%2Ftorchrec%2Fdistributed%2Fmodel_parallel.py%22%2Cnull%5D "/data/users/maliafzal/fbsource/fbcode/torchrec/distributed/model_parallel.py")
* Added `init_raw_id_tracker()` method to create `RawIdTracker` instances
* Modified constructor to conditionally initialize trackers based on `tracker_type` configuration
internal
This is needed to support MPZCH modules for Raw embedding streaming.
Mode details :
https://docs.google.com/document/d/1KEHwiXKLgXwRIdDFBYopjX3OiP3mRLM24Qkbiiu-TgE/edit?tab=t.0#bookmark=id.lhhgee2cs6ld
Differential Revision: D849202331 parent c13c3fd commit febf3f0
File tree
2 files changed
+48
-6
lines changed- torchrec/distributed
- model_tracker
2 files changed
+48
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
| |||
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
294 | 303 | | |
295 | 304 | | |
296 | 305 | | |
297 | | - | |
| 306 | + | |
298 | 307 | | |
299 | 308 | | |
| 309 | + | |
300 | 310 | | |
301 | 311 | | |
302 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
303 | 321 | | |
304 | 322 | | |
305 | 323 | | |
| |||
370 | 388 | | |
371 | 389 | | |
372 | 390 | | |
373 | | - | |
| 391 | + | |
374 | 392 | | |
375 | 393 | | |
376 | 394 | | |
| |||
381 | 399 | | |
382 | 400 | | |
383 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
384 | 411 | | |
385 | 412 | | |
386 | 413 | | |
| |||
459 | 486 | | |
460 | 487 | | |
461 | 488 | | |
462 | | - | |
| 489 | + | |
463 | 490 | | |
464 | 491 | | |
465 | 492 | | |
| |||
470 | 497 | | |
471 | 498 | | |
472 | 499 | | |
473 | | - | |
| 500 | + | |
474 | 501 | | |
475 | 502 | | |
476 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
| |||
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| 109 | + | |
0 commit comments