Commit 70edc8a
Changing Backend Tensor initialization (#5055)
Summary:
X-link: facebookresearch/FBGEMM#2065
**Context:**
Currently, RocksDB stores data on row-wise format, to enable optimizer offloading for the Kernel. We will append the optimizer state to its corresponding row.
During initialization, we need to randomly initialize weights while the optimizer values need to initialized to zero.
When optimizer offloading is enabled,
**In this diff:**
We add two new arguments:
1. enable_optimizer_offloading: This flag toggles between initializing the last optimizer_D rows to zero
2. optimizer_D: The number of columns in the table that needs to be initialized to zero. This set of columns represent the optimizer values (w/wo padding).
**Scenarios:**
1. Optimizer_offloading is False:
max_D = Dimensions of weights only,
optimizer_D = 0
2. Optimizer_offloading is True:
max_D = Dimension of weights (w_D) + optimizers (o_D)
optimizer_D = dimensions of optimizers (o_D)
initialize o_D columns with zero
Differential Revision: D851577321 parent f849dcd commit 70edc8a
File tree
1 file changed
+24
-10
lines changed- fbgemm_gpu/src/ssd_split_embeddings_cache
1 file changed
+24
-10
lines changedLines changed: 24 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
270 | 274 | | |
271 | 275 | | |
272 | 276 | | |
| |||
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
424 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
428 | 434 | | |
429 | 435 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
437 | 451 | | |
438 | 452 | | |
439 | 453 | | |
| |||
0 commit comments