Skip to content

Add a new compute model to Feathr #820

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

Merged
merged 0 commits into from
Nov 30, 2022
Merged

Add a new compute model to Feathr #820

merged 0 commits into from
Nov 30, 2022

Conversation

rakeshkashyap123
Copy link
Collaborator

@rakeshkashyap123 rakeshkashyap123 commented Nov 3, 2022

Description

In this PR:-

  1. We add a new compute model and engine to Feathr for faster performance:-
    Compute Model
    a. Convert the hocon config model into a data model which is simple to understand, this is stored in feathr-config module.
    The hocon config gets converted to
    i) AnchorConfig
    ii) DerivationConfig
    iii) SequentialJoin Config
    All the above code is in feathr-config module.
    b. The above data models are then converted into a compute graph. A compute graph consists of the following nodes:-
    a. DataSource node - An entity to encapsulate the datasource information of a feature.
    i) Context - Represents the training dataset information
    ii) Table - A table data source contains both a snapshot view and an update log.
    iii) Event - An event node contains append-only event logs whose records need to be grouped and aggregated (e.g. counted, averaged, top-K’d) over a limited window of time.
    b. Transformation node - An entity to encapsulate all the transformations which are to be done on top of a datasource/other nodes.
    c. Lookup node - Maps to the present day sequential join object.
    d. Aggregation node - Maps to the currentt SWA join object.
    e. External node - A node used as a placeholder while computing other nodes, not to be used by the compute engine.
    c. We generate a raw graph using only the feature def config.
    d. Once the join config is passed in, we optimize this graph by performing generic graph operations like merge, delete, prune, etc.

    All of the above information is in the feathr-compute module.

Compute Engine
a. We pass the above the compute graph into the compute engine which sorts the graph topologically.
b. We group a few related nodes like all SWA nodes, similar transformation function nodes together for faster execution by the engine.
c. Then, we execute the nodes and add the computed features onto the original observation data.

All of the above engine is in the feathr-impl module.
  1. We moved to gradle based build from SBT.
    We have made use of PDL data object to store all the data models. This requires us to migrate from SBT to Gradle version.

How was this PR tested?

Currently testing it with multiple flows. The flows either perform faster or have a similar performance. All integration and unit tests pass.

New integration and unit tests have been added.

Does this PR introduce any user-facing changes?

It is completely backward compatible. Also, this would not be the default engine for now, we would continue testing till we achieve complete confidence.

@xiaoyongzhu xiaoyongzhu added the safe to test Tag to execute build pipeline for a PR from forked repo label Nov 3, 2022
@xiaoyongzhu
Copy link
Member

@rakeshkashyap123 can you also help resolve the conflicts?

@windoze
Copy link
Member

windoze commented Nov 11, 2022

Could anyone provide some details and docs about this PR? Without doc, no one can even understand what you're trying to do.
And I don't think it's a good idea to suddenly submit such a huge PR, it's better to do it gradually.

@@ -0,0 +1,162 @@
{
"$id": "http://frame.dev.linkedin.com/JoinConfigSchema.json",
"$schema": "http://json-schema.org/draft-07/schema#",

Check failure

Code scanning / devskim

Insecure URL

Insecure URL
@@ -0,0 +1,1120 @@
{
"$id": "http://frame.dev.linkedin.com/FeatureDefConfigSchema.json",
"$schema": "http://json-schema.org/draft-07/schema#",

Check failure

Code scanning / devskim

Insecure URL

Insecure URL
@@ -0,0 +1,49 @@
{
"$id": "http://frame.dev.linkedin.com/PresentationsConfigSchema.json",
"$schema": "http://json-schema.org/draft-07/schema#",

Check failure

Code scanning / devskim

Insecure URL

Insecure URL
Copy link
Collaborator

@bozhonghu bozhonghu left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Only major concern is we need to ensure the sbt build continues to work and not break any open source development.

bozhonghu
bozhonghu previously approved these changes Nov 29, 2022
Copy link
Collaborator

@bozhonghu bozhonghu left a comment

Choose a reason for hiding this comment

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

LGTM

@windoze windoze added the DO-NOT-MERGE The PR shall not be merged label Nov 29, 2022
@jaymo001
Copy link
Collaborator

jaymo001 commented Nov 30, 2022

Synced offline. LGTM.

jaymo001
jaymo001 previously approved these changes Nov 30, 2022
@jaymo001 jaymo001 removed the DO-NOT-MERGE The PR shall not be merged label Nov 30, 2022
Copy link
Member

@windoze windoze left a comment

Choose a reason for hiding this comment

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

As we cannot test CI before merging, so let's merge and test.
Please keep eye on the CI test/build process.

@rakeshkashyap123 rakeshkashyap123 merged commit 87dea4b into main Nov 30, 2022
jaymo001 pushed a commit that referenced this pull request Dec 7, 2022
* Add working gradle build

* Set up pdl support

* Working PDL java code gen

* With pdl files from metadata models

* With pdl files from compute model

* Fix compile for all pdl files

* Add working gradle build

* Migrate frame-config module into feathr

* Migrate fcm graph module to feathr

* Add FCM offline execution code, includes FDS metadata code

* Add needed jars for feathr-config tests

* Switch client to FeathrClient2 for local tests and fix config errors

* Fix SWA test

* Add gradle wrapper jar

* Change name of git PR test from sbt to gradle

* Switch python client to use FCM client

* Exclude json from dependency

* Add hacky solution to handle json dependency conflict in cloud

* Add json to local dependency

* Add log to debug cloud jar

* Add json as dependency

* Another attempt at resolving json dependency

* Resolve json via shading

* Fix json shading

* Remove log

* Shade typesafe config for cloud jar

* Add maven publish code to build.gradle

* Add working local maven build and rename frame-config to feathr-config to avoid namespace conflict

* Modify sonatype creds

* Change so no need to sign if releasing snapshot version

* Update build.gradle to allow publishing of all modules

* Removed FDS handling from Feathr

* All tests working

* Deleted FR stuff

* Remove dimension and other tensor related stuff

* Remove mlfeatureversionurn from defaultvalueresolver

* Remove mlfeatureversionurn and featureref

* Remove featuredefinition files

* Remove featureRef and typedRef

* final cleanup

* Fix merge conflict bugs

* Fix guava error

* udf plugin for swa features

* row-transformations optimization

* fix bug

* fix another bug

* always execute agg nodes first

* Add SWA log

* reverse order of execution

* group by datasource

* Fix bug

* Merge main into fcm branch

* Remove insecure URLs

* Add back removed files

* Add back removed files

* Add back removed files

* Change PR build system to gradle

* Change sbt job to gradle jobb

* Change sbt workflow:wq

* Update maven github workflow to use gradle

* fix failing test

* remove sbt project module

* Remove sbt related files

* Change docs to reflect gradle

* Remove keywords

* Create a single jar

* 1. Fix jar not getting populated\n 2. Fix documentation bugs

* pubishToMavenLocal Working

* With FFE integrated

* maven upload working

* Update docs and code clean up

* add gradle-wrapper file

* Push all dependency jars

* Update docs

* Docs cleanup

* Update github workflow commands

* Update github workflow

* Update workflow syntax

* Update version

* Add gradle version to github workflow

* Update gradle version w/o quotes

* Remove github gradle version

* Github workflow fix

* Github workflow fix-2

* Github workflow fix-4

Co-authored-by: Bozhong Hu <bobhu@linkedin.com>
Co-authored-by: rkashyap <rkashyap@linkedin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Tag to execute build pipeline for a PR from forked repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants