Skip to content

Return different matrix types for online serving #4714

Closed
1 of 1 issue completed
Closed

Description

@franciscojavierarceo

Is your feature request related to a problem? Please describe.
We should allow Feature Views to return matrices/tensors natively. For example, torch.tensors.

At the moment, for some features we require the client to serialize the output into a matrix before running inference. Feast should support executing these transformations and serializing the data into matrices for both online and offline retrieval.

Describe the solution you'd like

features: torch.Tensor =  store.get_online_features()

Describe alternatives you've considered
Not supporting this is the alternative, which is the current state, which leaves users to write their own brittle logic to handle various complexities.

Additional context
@HaoXuAI @tokoko I know we discussed sklearn pipelines in the past and I thought I'd share my thoughts.

Activity

  1. haoxu0 commented on Oct 29, 2024

    @haoxu0
    Collaborator

    torch feature is nice. I guess we need to release the "timestamp" constraints in our APIs, since it probably doesn't make too much sense to attach embedding feature with a timestamp?

  2. breno-costa commented on Oct 29, 2024

    @breno-costa
    Contributor

    The method store.get_online_features(...) returns an OnlineResponse object that has some conversion methods like to_dict() and to_df(). Should this suggestion be implemented as an another conversion method like to_torch() or something like this?

  3. franciscojavierarceo commented on Oct 29, 2024

    @franciscojavierarceo
    MemberAuthor

    torch feature is nice. I guess we need to release the "timestamp" constraints in our APIs, since it probably doesn't make too much sense to attach embedding feature with a timestamp?
    Agreed.

  4. franciscojavierarceo commented on Oct 29, 2024

    @franciscojavierarceo
    MemberAuthor

    @breno-costa that code is a serialization step though. We would want to treat Torch Tensors (or xgb.DMatrix) as a first class data type.

    The concrete examples I'm thinking of are one hot encoding or impact encoding. It'd be useful for us to handle this for MLEs natively, especially when handling unseen categories.

  5. dandawg commented on Oct 29, 2024

    @dandawg
    Contributor

    This plus sparse tensors/sparse matrices could be a really cool optimization -- less data, faster io, more powerful API.

  6. franciscojavierarceo commented on Oct 29, 2024

    @franciscojavierarceo
    MemberAuthor

    This plus sparse tensors/sparse matrices could be a really cool optimization -- less data, faster io, more powerful API.

    Exactly.

  7. haoxu0 commented on Oct 29, 2024

    @haoxu0
    Collaborator

    if we can leverage "arrow" as our primary format, then it can be directly converted to pandas/torch with arrow apis i believe

  8. franciscojavierarceo commented on Oct 30, 2024

    @franciscojavierarceo
    MemberAuthor

    Cool, I'll check that out. This is basically the next step after vector support to making NLP a first class citizen.

  9. stale commented on Apr 26, 2025

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

Metadata

Metadata

Labels

kind/featureNew feature or requestwontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions