Skip to content

Commit 85b7ac7

Browse files
q10facebook-github-bot
authored andcommitted
Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend (#2955)
Summary: Pull Request resolved: #2955 X-link: facebookresearch/FBGEMM#55 - Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend Reviewed By: spcyppt Differential Revision: D60986449
1 parent 6a3ff16 commit 85b7ac7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

fbgemm_gpu/fbgemm_gpu/split_embedding_configs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class EmbOptimType(enum.Enum):
3333
SHAMPOO_V2 = "shampoo_v2" # not currently supported for sparse embedding tables
3434
MADGRAD = "madgrad"
3535
EXACT_ROWWISE_WEIGHTED_ADAGRAD = "exact_row_wise_weighted_adagrad" # deprecated
36+
ENSEMBLE_ROWWISE_ADAGRAD = "ensemble_row_wise_adagrad"
3637
NONE = "none"
3738

3839
def __str__(self) -> str:

fbgemm_gpu/fbgemm_gpu/split_table_batched_embeddings_ops_training.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import fbgemm_gpu.split_embedding_codegen_lookup_invokers as invokers
2727

28-
# from fbgemm_gpu.config import FeatureGateName
28+
from fbgemm_gpu.config import FeatureGate, FeatureGateName
2929
from fbgemm_gpu.runtime_monitor import (
3030
AsyncSeriesTimer,
3131
TBEStatsReporter,
@@ -1549,6 +1549,17 @@ def forward( # noqa: C901
15491549
offsets=self.row_counter_offsets,
15501550
placements=self.row_counter_placements,
15511551
)
1552+
1553+
if self.optimizer == OptimType.ENSEMBLE_ROWWISE_ADAGRAD:
1554+
if FeatureGate.is_enabled(FeatureGateName.TBE_ENSEMBLE_ROWWISE_ADAGRAD):
1555+
raise AssertionError(
1556+
"ENSEMBLE_ROWWISE_ADAGRAD feature has not landed yet (see D60189486 stack)"
1557+
)
1558+
else:
1559+
logging.warnning(
1560+
"ENSEMBLE_ROWWISE_ADAGRAD is an inactive or deprecated feature!"
1561+
)
1562+
15521563
if self._used_rowwise_adagrad_with_counter:
15531564
if (
15541565
self._max_counter_update_freq > 0

0 commit comments

Comments
 (0)