GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Feature retrieval latency scales with number of feature views, doesn't appear to cache · Issue #3442 · feast-dev/feast Closed Labels DescriptionSo I'd like to preface this by saying that I'm new to Expected BehaviorSo my understanding of how "projects" and "feature views" work is kind of analogous to the relationship between a schema and table in a database. The project acts as a namespace for feature views, which is a second-tier namespace for features, in the same way that a schema acts as a namespace for tables, which act as a second-tier for columns. In this mental model, I expect that when I use FeatureStore.get_online_features, it will do some kind of fast lookup based on a map from the combination of (project, feature view) (maybe based on a hash table?) to figure out where the features are located, and then retrieve the data. If that map is not available locally, then it can be retrieved from the remote registry and then cached for future repeated use. Once cached, I would expect the overhead of figuring out which feature view or data location to use would drop to near zero, but the process of retrieving the data itself would be unchanged (i.e. scale with the size of the data + normal internet latency). Current BehaviorWhat I observe is that when querying for data using In the process of diagnosing this, I tried querying feature data from a different project to see if it also had the same problems. The main difference is that this second project is significantly "smaller" than the first. The first project has maybe 20 feature views, which have anywhere between 2 and 32 features each. The second project only has two feature views with two features each. What I noticed was that when switching to project two, the time spent retrieving the registry dropped significantly (to like 10% of the time it takes to do the same for project one), although it still did not appear to be caching correctly as the time did not change on successive calls. Time retrieving the actual data was similar in both projects. See the table below for a summary of what we tried/observed:
In addition, we found that within for fv in self._registry.list_feature_views( self.project, allow_cache=allow_cache ): if hide_dummy_entity and fv.entities[0] == DUMMY_ENTITY_NAME: fv.entities = [] fv.entity_columns = [] feature_views.append(fv) In particular, it looks like the body of the loop had negligible runtime, but executing Registry.list_feature_views for project 1 returned an iterator of 18 items (equal to the number of feature views in that project) over 102 ms, which works out to about 5.6 ms/iteration, roughly on par with the total time to retrieve the registry for project 2. I initially suspected that perhaps this function is sequentially calling out to GCS to retrieve the registry data one feature view at a time rather than getting it all in one go? But I was able to further trace this all the way down to some calls to FeatureView.from_proto, which may suggest that deserializing some protobuf might be the bottleneck? My profiler wasn't able to go any deeper for some reason and I feel like I'm already in the weeds here anyway so I'll leave it at that. Steps to reproduce
Specifications
Possible SolutionI think the best possible solution is to figure out why the registry isn't being cached and fix that. All of our TTL parameters are set to very long periods of time, so I'm not sure why caching does not occur though. Given the above observations, a potential workaround might be to limit the number of feature views in each of our projects. This is less than ideal though since we have leaned heavily into using the project and feature view names as a hierarchical namespace (different groups/teams have separate projects, different services and ML models within each team have separate feature views). Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions | |||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |