Skip to content

Migrate fbgemm internals off the ops_common shim to leaf imports#5892

Closed
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D107684316
Closed

Migrate fbgemm internals off the ops_common shim to leaf imports#5892
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D107684316

Conversation

@q10

@q10 q10 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary:
Fourth foundational diff: point fbgemm-internal modules at the canonical tbe.*
leaf modules instead of the split_table_batched_embeddings_ops_common shim.

This breaks the latent import cycle the shim would otherwise create
(ops_training -> ops_common shim -> tbe.ssd.ssd_config -> tbe.ssd.init ->
.training -> ops_training): with internals importing from the leaves directly,
importing ops_training no longer pulls the shim, so the ssd package init is
not re-entered mid-import.

Migrated to leaf imports (tbe.config.embedding_config / tbe.cache.cache_config):

  • split_table_batched_embeddings_ops_training.py (+ construct_cache_state ->
    CacheState.construct)
  • split_table_batched_embeddings_ops_inference.py (+ construct_cache_state ->
    CacheState.construct, 2 call sites)
  • split_embedding_configs.py (EmbeddingLocation, SplitState)
  • split_table_batched_embeddings_ops_training_common.py (PoolingMode)
  • split_embedding_inference_converter.py (EmbeddingLocation)
  • sparse_ops.py (PoolingMode)
  • tbe/bench/embedding_ops_common_config.py, tbe/bench/benchmark_click_interface.py

The ops_common shim remains for external BC. autodeps updated BUCK deps.

Reviewed By: cthi

Differential Revision: D107684316

Summary:
Fourth foundational diff: point fbgemm-internal modules at the canonical tbe.*
leaf modules instead of the split_table_batched_embeddings_ops_common shim.

This breaks the latent import cycle the shim would otherwise create
(ops_training -> ops_common shim -> tbe.ssd.ssd_config -> tbe.ssd.__init__ ->
.training -> ops_training): with internals importing from the leaves directly,
importing ops_training no longer pulls the shim, so the ssd package __init__ is
not re-entered mid-import.

Migrated to leaf imports (tbe.config.embedding_config / tbe.cache.cache_config):
- split_table_batched_embeddings_ops_training.py (+ construct_cache_state ->
  CacheState.construct)
- split_table_batched_embeddings_ops_inference.py (+ construct_cache_state ->
  CacheState.construct, 2 call sites)
- split_embedding_configs.py (EmbeddingLocation, SplitState)
- split_table_batched_embeddings_ops_training_common.py (PoolingMode)
- split_embedding_inference_converter.py (EmbeddingLocation)
- sparse_ops.py (PoolingMode)
- tbe/bench/embedding_ops_common_config.py, tbe/bench/benchmark_click_interface.py

The ops_common shim remains for external BC. autodeps updated BUCK deps.

Reviewed By: cthi

Differential Revision: D107684316
@meta-cla meta-cla Bot added the cla signed label Jun 12, 2026
@meta-codesync

meta-codesync Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107684316.

@meta-codesync

meta-codesync Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 8e24452.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant