Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java feature server] Converge ServingService API to make Python and Java feature servers consistent #2166

Merged
merged 16 commits into from
Jan 5, 2022

Conversation

pyalex
Copy link
Collaborator

@pyalex pyalex commented Dec 21, 2021

What this PR does / why we need it:

Currently, Java Feature Server and Python Feature Server provide two different client APIs. This PR aimed to fix that.

  1. Changes to proto API: use GetOnlineFeatureRequest (that was created for and currently used by Python FS) as input in GetOnlineFeatures method. That also means that Java FS will support requests by feature service.
  2. GetOnlineFeatureResponseV2 is proposed as optimized version of GetOnlineFeatureResponse and was designed symmetrically to GetOnlineFeatureRequest. According to my evaluation serialization/deserialization of the new message is 3x times faster (on 100 rows). That difference increases with a growing number of rows and features. New message also optimized for compaction (message size), which will lead to faster network transmission.

What was updated:

  1. Java Feature Server
  2. Java SDK
  3. Go SDK

What's not covered in this PR:

  1. Python FS to return new response

Some clean up:

  • "Feature Table" is replaced to "Feature View"
  • Suffix "V" is dropped when there are no other versions

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Java feature server supports retrieving features by feature service name.

ServingService proto API is refactored:
GetOnlineFeaturesResponse now has new argument `request_context` for passing input to ODFVs (previously this inputs were mixed into `entities`
GetOnlineFeaturesResponseV2 is refactored version of response optimized for fast serialization / deserialization and high compaction

@pyalex pyalex requested a review from a team as a code owner December 21, 2021 15:08
@pyalex pyalex requested review from adchia and removed request for a team December 21, 2021 15:08
@pyalex pyalex changed the title [WIP][Java feature server] Support for feature services [WIP][Java feature server] Converge ServingService API to make Python and Java feature servers consistent Dec 21, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #2166 (50fc6cb) into master (e435d92) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2166      +/-   ##
==========================================
+ Coverage   84.57%   84.58%   +0.01%     
==========================================
  Files         102      102              
  Lines        8195     8201       +6     
==========================================
+ Hits         6931     6937       +6     
  Misses       1264     1264              
Flag Coverage Δ
integrationtests 74.27% <100.00%> (-0.27%) ⬇️
unittests 58.99% <40.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/feature_store.py 91.39% <100.00%> (ø)
sdk/python/feast/infra/online_stores/datastore.py 80.79% <0.00%> (+0.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e435d92...50fc6cb. Read the comment docs.

@pyalex pyalex force-pushed the online-serving-feature-service branch from de882a7 to f3ea70c Compare December 27, 2021 15:44
@pyalex pyalex changed the title [WIP][Java feature server] Converge ServingService API to make Python and Java feature servers consistent [Java feature server] Converge ServingService API to make Python and Java feature servers consistent Dec 27, 2021
@pyalex
Copy link
Collaborator Author

pyalex commented Dec 27, 2021

Benchmarks were also added in Java integration tests
Results:

Test 100 rows; Full FS took (min): 32 ms
Test 100 rows; Full FS took (avg): 40.117172 ms
Test 100 rows; Full FS took (median): 36.000000 ms
Test 100 rows; Full FS took (95p): 64.000000 ms
Test 100 rows; Full FS took (99p): 82.000000 ms

Test 100 rows; 50 features took (min): 17 ms
Test 100 rows; 50 features took (avg): 20.864646 ms
Test 100 rows; 50 features took (median): 19.000000 ms
Test 100 rows; 50 features took (95p): 28.000000 ms
Test 100 rows; 50 features took (99p): 55.000000 ms

Test 100 rows; 10 features took (min): 3 ms
Test 100 rows; 10 features took (avg): 5.576768 ms
Test 100 rows; 10 features took (median): 5.000000 ms
Test 100 rows; 10 features took (95p): 15.000000 ms
Test 100 rows; 10 features took (99p): 18.000000 ms

Test 100 rows; 100 features took (min): 17 ms
Test 100 rows; 100 features took (avg): 20.643434 ms
Test 100 rows; 100 features took (median): 19.000000 ms
Test 100 rows; 100 features took (95p): 26.000000 ms
Test 100 rows; 100 features took (99p): 55.000000 ms

Full FS == feature service with 250 features

@pyalex pyalex force-pushed the online-serving-feature-service branch from f3ea70c to e92609c Compare December 30, 2021 13:52
@adchia adchia assigned adchia and unassigned woop Dec 30, 2021
@pyalex pyalex force-pushed the online-serving-feature-service branch from b124a10 to a795c49 Compare January 4, 2022 13:16
Signed-off-by: pyalex <[email protected]>
Signed-off-by: pyalex <[email protected]>
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also change the release notes to say that the java FS supports feature services now?

@@ -94,6 +87,11 @@ message GetOnlineFeaturesRequest {
// A map of entity name -> list of values
map<string, feast.types.RepeatedValue> entities = 3;
bool full_feature_names = 4;

// Context for OnDemand Feature Transformation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to clarify, this is the "request_data" that we had before right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my knowledge, there was no "request_data" in protos or Python API. Not sure what you're referring to

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was used for the on demand feature views. You had touched some of this in the transformation logic (it used to be passed in as part of the entity row). I think this is the same.

Can you also add a new issue to migrate the python logic for this too?

Signed-off-by: pyalex <[email protected]>
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adchia, pyalex

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

5 participants