Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,11 @@
# @manual=//deeplearning/fbgemm/fbgemm_gpu/codegen:split_embedding_codegen_lookup_invokers
import fbgemm_gpu.split_embedding_codegen_lookup_invokers as invokers
from fbgemm_gpu.config import FeatureGate, FeatureGateName
from fbgemm_gpu.split_embedding_configs import EmbOptimType as OptimType, SparseType

try:
from fbgemm_gpu.split_embedding_configs import nfp8_dtype
except ImportError:
# Forward-compat for torch.package re-export version blends (S685573): a
# model's frozen `split_embedding_configs`, bundled alongside this (newer)
# module at GMPP re-export time, may predate `nfp8_dtype` (added in
# D113263502). Import it defensively and fall back to the pre-arch-aware
# selection so this module finishes initializing regardless of the bundled
# `split_embedding_configs` version -- otherwise the failed top-level import
# leaves a poisoned partial module cached by the torch.package importer and
# a later `from ...ops_training import SplitTableBatchedEmbeddingBagsCodegen`
# fails. Mirrors the D110788115 `sparse_type_to_int` fallback pattern.
def nfp8_dtype() -> torch.dtype:
return (
torch.float8_e4m3fnuz
if torch.version.hip is not None
else torch.float8_e4m3fn
)


from fbgemm_gpu.split_embedding_configs import (
EmbOptimType as OptimType,
nfp8_dtype,
SparseType,
)
from fbgemm_gpu.split_table_batched_embeddings_ops_common import (
BoundsCheckMode,
CacheAlgorithm,
Expand Down
Loading