Skip to content

Conversation

@TroyGarden
Copy link
Contributor

Summary:
Enable validation of KeyedJaggedTensor feature values against EmbeddingBagConfig ranges to catch out-of-range embedding lookups early. Modified all validation functions to return boolean values, allowing callers to programmatically distinguish between hard failures (structural errors that raise ValueError) and soft failures (out-of-range values that return False with warnings).

This supports two use cases:

  1. Production monitoring - detect invalid embedding IDs without crashing
  2. Data quality checks - identify features with values outside [0, num_embeddings)

All validation functions now return bool for consistency, maintaining full backward compatibility since existing code can continue to ignore return values.

Differential Revision: D88013492

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2025
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Nov 28, 2025

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

Summary:

Enable validation of KeyedJaggedTensor feature values against EmbeddingBagConfig ranges to catch out-of-range embedding lookups early. Modified all validation functions to return boolean values, allowing callers to programmatically distinguish between hard failures (structural errors that raise ValueError) and soft failures (out-of-range values that return False with warnings).

This supports two use cases:
1. Production monitoring - detect invalid embedding IDs without crashing
2. Data quality checks - identify features with values outside [0, num_embeddings)

All validation functions now return bool for consistency, maintaining full backward compatibility since existing code can continue to ignore return values.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant