Skip to content

Commit

Permalink
Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend
Browse files Browse the repository at this point in the history
Summary: - Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend

Differential Revision: D60986449
  • Loading branch information
q10 authored and facebook-github-bot committed Aug 8, 2024
1 parent ea6dbd9 commit e774ece
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions fbgemm_gpu/fbgemm_gpu/split_embedding_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class EmbOptimType(enum.Enum):
SHAMPOO_V2 = "shampoo_v2" # not currently supported for sparse embedding tables
MADGRAD = "madgrad"
EXACT_ROWWISE_WEIGHTED_ADAGRAD = "exact_row_wise_weighted_adagrad" # deprecated
ENSEMBLE_ROWWISE_ADAGRAD = "ensemble_row_wise_adagrad"
NONE = "none"

def __str__(self) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import fbgemm_gpu.split_embedding_codegen_lookup_invokers as invokers

# from fbgemm_gpu.config import FeatureGateName
from fbgemm_gpu.config import FeatureGate, FeatureGateName
from fbgemm_gpu.runtime_monitor import (
AsyncSeriesTimer,
TBEStatsReporter,
Expand Down Expand Up @@ -1549,6 +1549,17 @@ def forward( # noqa: C901
offsets=self.row_counter_offsets,
placements=self.row_counter_placements,
)

if self.optimizer == OptimType.ENSEMBLE_ROWWISE_ADAGRAD:
if FeatureGate.is_enabled(FeatureGateName.TBE_ENSEMBLE_ROWWISE_ADAGRAD):
assert (
False
), "ENSEMBLE_ROWWISE_ADAGRAD feature has not landed yet (see D60189486 stack)"
else:
logging.warn(
"ENSEMBLE_ROWWISE_ADAGRAD is an inactive or deprecated feature!"
)

if self._used_rowwise_adagrad_with_counter:
if (
self._max_counter_update_freq > 0
Expand Down

0 comments on commit e774ece

Please sign in to comment.