Add gflag to select feature names for SSD KV embedding table#5585
Open
jnwan wants to merge 1 commit intopytorch:mainfrom
Open
Add gflag to select feature names for SSD KV embedding table#5585jnwan wants to merge 1 commit intopytorch:mainfrom
jnwan wants to merge 1 commit intopytorch:mainfrom
Conversation
Summary: X-link: facebookresearch/FBGEMM#2545 ## Summary Refactor gflag parsing for SSD KV embedding table feature name selection into a dedicated `shouldCreateSsdKvBackendForTbe()` method. ### Changes: - **`pytorch_xl_format_v2_util.cpp`**: Extract flag parsing logic (`FLAGS_embedding_db_enable_kv_embedding_table` and `FLAGS_embedding_db_kv_embedding_table_feature_names`) into a standalone `shouldCreateSsdKvBackendForTbe()` function. The feature names are parsed once using a `static` local with `folly::splitTo` + `std::inserter` pattern. - **`pytorch_xl_format_v2_util.h`**: Add declaration and `DECLARE` macros for the two new flags. - **`XLFormatV2CPUTest.cpp`**: Add 3 unit tests covering flag-disabled, feature-match, and feature-no-match cases. - **`SSDKVInferenceEmbedding.cpp`**: Implement `inference_set_kv_db_async` and `get_kv_db_async` to delegate to sync methods (previously threw). - **`dram_kv_embedding_inference_wrapper.cpp`**: Simplify by always using async path, removing `FLAGS_kv_embedding_async_get_set` conditional. Reviewed By: emlin Differential Revision: D99744279
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/2545
Summary
Refactor gflag parsing for SSD KV embedding table feature name selection into a dedicated
shouldCreateSsdKvBackendForTbe()method.Changes:
pytorch_xl_format_v2_util.cpp: Extract flag parsing logic (FLAGS_embedding_db_enable_kv_embedding_tableandFLAGS_embedding_db_kv_embedding_table_feature_names) into a standaloneshouldCreateSsdKvBackendForTbe()function. The feature names are parsed once using astaticlocal withfolly::splitTo+std::inserterpattern.pytorch_xl_format_v2_util.h: Add declaration andDECLAREmacros for the two new flags.XLFormatV2CPUTest.cpp: Add 3 unit tests covering flag-disabled, feature-match, and feature-no-match cases.SSDKVInferenceEmbedding.cpp: Implementinference_set_kv_db_asyncandget_kv_db_asyncto delegate to sync methods (previously threw).dram_kv_embedding_inference_wrapper.cpp: Simplify by always using async path, removingFLAGS_kv_embedding_async_get_setconditional.Reviewed By: emlin
Differential Revision: D99744279