Skip to content

Commit

Permalink
Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend (#2955)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2955

X-link: facebookresearch/FBGEMM#55

- Add configuration knob for ENSEMBLE_ROWWISE_ADAGRAD, frontend

Reviewed By: spcyppt

Differential Revision: D60986449
  • Loading branch information
q10 authored and facebook-github-bot committed Aug 12, 2024
1 parent 6a3ff16 commit 08524ec
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):
raise AssertionError(
"ENSEMBLE_ROWWISE_ADAGRAD feature has not landed yet (see D60189486 stack)"
)
else:
raise AssertionError(
"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 08524ec

Please sign in to comment.