From 2c7d5d702f98a17b274a6db9fd09fd91b3a7ead5 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 4 Nov 2024 11:07:19 +0100 Subject: [PATCH] Fix feature-store-api and machine-learning-api links --- docs/js/inject-api-links.js | 17 ++-- docs/reference_guides/index.md | 37 -------- .../common/arrow_flight_duckdb.md | 30 +++---- docs/user_guides/fs/compute_engines.md | 20 ++--- docs/user_guides/fs/feature_group/create.md | 30 +++---- .../fs/feature_group/create_external.md | 20 ++--- .../fs/feature_group/create_spine.md | 2 +- .../fs/feature_group/data_types.md | 84 +++++++++---------- .../fs/feature_view/feature-vectors.md | 22 ++--- .../user_guides/fs/storage_connector/usage.md | 68 +++++++-------- .../fs/vector_similarity_search.md | 6 +- .../integrations/databricks/configuration.md | 4 +- .../integrations/emr/emr_configuration.md | 2 +- docs/user_guides/integrations/python.md | 2 +- docs/user_guides/integrations/spark.md | 2 +- .../user_guides/mlops/serving/api-protocol.md | 2 +- .../mlops/serving/deployment-state.md | 8 +- docs/user_guides/mlops/serving/deployment.md | 6 +- .../mlops/serving/inference-batcher.md | 2 +- .../mlops/serving/inference-logger.md | 6 +- docs/user_guides/mlops/serving/predictor.md | 12 +-- docs/user_guides/mlops/serving/resources.md | 6 +- docs/user_guides/mlops/serving/transformer.md | 4 +- .../mlops/serving/troubleshooting.md | 12 +-- 24 files changed, 181 insertions(+), 223 deletions(-) delete mode 100644 docs/reference_guides/index.md diff --git a/docs/js/inject-api-links.js b/docs/js/inject-api-links.js index 156650f66..89082c67d 100644 --- a/docs/js/inject-api-links.js +++ b/docs/js/inject-api-links.js @@ -1,15 +1,12 @@ window.addEventListener("DOMContentLoaded", function () { var windowPathNameSplits = window.location.pathname.split("/"); - var majorVersionRegex = new RegExp("(\\d+[.]\\d+)") - var latestRegex = new RegExp("latest") - if (majorVersionRegex.test(windowPathNameSplits[1])) { // On landing page docs.hopsworks.api/3.0 - URL contains major version + var majorVersionRegex = new RegExp("(\\d+[.]\\d+)"); + var latestRegex = new RegExp("latest"); + if (majorVersionRegex.test(windowPathNameSplits[1])) { // On landing page docs.hopsworks.api/4.0 - URL contains major version // Version API dropdown document.getElementById("hopsworks_api_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + windowPathNameSplits[1] + "/generated/api/login/"; - document.getElementById("hsfs_api_link").href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits[1] + "/generated/api/connection_api/"; - document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/feature-store-api/" + windowPathNameSplits[1] + "/javadoc"; - document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + windowPathNameSplits[1] + "/generated/connection_api/"; - } else { // on docs.hopsworks.api/feature-store-api/3.0 / docs.hopsworks.api/hopsworks-api/3.0 / docs.hopsworks.api/machine-learning-api/3.0 - + document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + windowPathNameSplits[1] + "/javadoc"; + } else { // on / docs.hopsworks.api/hopsworks-api/4.0 if (latestRegex.test(windowPathNameSplits[2]) || latestRegex.test(windowPathNameSplits[1])) { var majorVersion = "latest"; } else { @@ -26,8 +23,6 @@ window.addEventListener("DOMContentLoaded", function () { document.getElementsByClassName("md-tabs__link")[6].href = "https://docs.hopsworks.ai/" + majorVersion + "/admin/"; // Version API dropdown document.getElementById("hopsworks_api_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + majorVersion + "/generated/api/login/"; - document.getElementById("hsfs_api_link").href = "https://docs.hopsworks.ai/feature-store-api/" + majorVersion + "/generated/api/connection_api/"; - document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/feature-store-api/" + majorVersion + "/javadoc"; - document.getElementById("hsml_api_link").href = "https://docs.hopsworks.ai/machine-learning-api/" + majorVersion + "/generated/connection_api/"; + document.getElementById("hsfs_javadoc_link").href = "https://docs.hopsworks.ai/hopsworks-api/" + majorVersion + "/javadoc"; } }); diff --git a/docs/reference_guides/index.md b/docs/reference_guides/index.md deleted file mode 100644 index 580969c5c..000000000 --- a/docs/reference_guides/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -hide: -- navigation -- toc -- title ---- - - - - -
- -
- - - - - - \ No newline at end of file diff --git a/docs/setup_installation/common/arrow_flight_duckdb.md b/docs/setup_installation/common/arrow_flight_duckdb.md index fd0e745b0..fd8464067 100644 --- a/docs/setup_installation/common/arrow_flight_duckdb.md +++ b/docs/setup_installation/common/arrow_flight_duckdb.md @@ -3,16 +3,16 @@ By default, Hopsworks uses big data technologies (Spark or Hive) to create train This is great for large datasets, but for small or moderately sized datasets (think of the size of data that would fit in a Pandas DataFrame in your local Python environment), the overhead of starting a Spark or Hive job and doing distributed data processing can be significant. -ArrowFlight Server with DuckDB significantly reduces the time that Python clients need to read feature groups +ArrowFlight Server with DuckDB significantly reduces the time that Python clients need to read feature groups and batch inference data from the Feature Store, as well as creating moderately-sized in-memory training datasets. When the service is enabled, clients will automatically use it for the following operations: -- [reading Feature Groups](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#read) -- [reading Queries](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/query_api/#read) -- [reading Training Datasets](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_training_data) -- [creating In-Memory Training Datasets](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#training_data) -- [reading Batch Inference Data](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_batch_data) +- [reading Feature Groups](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#read) +- [reading Queries](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/query_api/#read) +- [reading Training Datasets](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_training_data) +- [creating In-Memory Training Datasets](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#training_data) +- [reading Batch Inference Data](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_batch_data) For larger datasets, clients can still make use of the Spark/Hive backend by explicitly setting `read_options={"use_hive": True}`. @@ -21,9 +21,9 @@ For larger datasets, clients can still make use of the Spark/Hive backend by exp !!! note Supported only on AWS at the moment. - + The ArrowFlight Server is co-located with RonDB in the Hopsworks cluster. -If the ArrowFlight Server is activated, RonDB and ArrowFlight Server can each use up to 50% +If the ArrowFlight Server is activated, RonDB and ArrowFlight Server can each use up to 50% of the available resources on the node, so they can co-exist without impacting each other. Just like RonDB, the ArrowFlight Server can be replicated across multiple nodes to serve more clients at lower latency. To guarantee high performance, each individual ArrowFlight Server instance processes client requests sequentially. @@ -42,12 +42,12 @@ To deploy ArrowFlight Server on a cluster: 2. Select an instance type with at least 16GB of memory and 4 cores. (*) 3. Tick the checkbox `Enable ArrowFlight Server`. -(*) The service should have at least the 2x the amount of memory available that a typical Python client would have. - Because RonDB and ArrowFlight Server share the same node we recommend selecting an instance type with at least 4x the - client memory. For example, if the service serves Python clients with typically 4GB of memory, - an instance with at least 16GB of memory should be selected. - An instance with 16GB of memory will be able to read feature groups and training datasets of up to 10-100M rows, - depending on the number of columns and size of the features (~2GB in parquet). The same instance will be able to create - point-in-time correct training datasets with 1-10M rows, also depending on the number and the size of the features. +(*) The service should have at least the 2x the amount of memory available that a typical Python client would have. + Because RonDB and ArrowFlight Server share the same node we recommend selecting an instance type with at least 4x the + client memory. For example, if the service serves Python clients with typically 4GB of memory, + an instance with at least 16GB of memory should be selected. + An instance with 16GB of memory will be able to read feature groups and training datasets of up to 10-100M rows, + depending on the number of columns and size of the features (~2GB in parquet). The same instance will be able to create + point-in-time correct training datasets with 1-10M rows, also depending on the number and the size of the features. Larger instances are able to handle larger datasets. The numbers scale roughly linearly with the instance size. diff --git a/docs/user_guides/fs/compute_engines.md b/docs/user_guides/fs/compute_engines.md index 427d63306..f1d15be6e 100644 --- a/docs/user_guides/fs/compute_engines.md +++ b/docs/user_guides/fs/compute_engines.md @@ -20,15 +20,15 @@ Hopsworks is aiming to provide functional parity between the computational engin | Functionality | Method | Spark | Python | Flink | Beam | Comment | | ----------------------------------------------------------------- | ------ | ----- | ------ | ------ | ------ | ------- | -| Feature Group Creation from dataframes | [`FeatureGroup.create_feature_group()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#create_feature_group) | :white_check_mark: | :white_check_mark: | - | - | Currently Flink/Beam doesn't support registering feature group metadata. Thus it needs to be pre-registered before you can write real time features computed by Flink/Beam.| -| Training Dataset Creation from dataframes | [`TrainingDataset.save()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/training_dataset_api/#save) | :white_check_mark: | - | - | - | Functionality was deprecated in version 3.0 | -| Data validation using Great Expectations for streaming dataframes | [`FeatureGroup.validate()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#validate) [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | - | - | - | - | `insert_stream` does not perform any data validation even when a expectation suite is attached. | -| Stream ingestion | [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | :white_check_mark: | - | :white_check_mark: | :white_check_mark: | Python/Pandas/Polars has currently no notion of streaming. | -| Stream ingestion | [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | :white_check_mark: | - | :white_check_mark: | :white_check_mark: | Python/Pandas/Polars has currently no notion of streaming. | -| Reading from Streaming Storage Connectors | [`KafkaConnector.read_stream()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/storage_connector_api/#read_stream) | :white_check_mark: | - | - | - | Python/Pandas/Polars has currently no notion of streaming. For Flink/Beam only write operations are supported | -| Reading training data from external storage other than S3 | [`FeatureView.get_training_data()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_training_data) | :white_check_mark: | - | - | - | Reading training data that was written to external storage using a Storage Connector other than S3 can currently not be read using HSFS APIs, instead you will have to use the storage's native client. | -| Reading External Feature Groups into Dataframe | [`ExternalFeatureGroup.read()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#read) | :white_check_mark: | - | - | - | Reading an External Feature Group directly into a Pandas/Polars Dataframe is not supported, however, you can use the [Query API](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/query_api/) to create Feature Views/Training Data containing External Feature Groups. | -| Read Queries containing External Feature Groups into Dataframe | [`Query.read()`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/query_api/#read) | :white_check_mark: | - | - | - | Reading a Query containing an External Feature Group directly into a Pandas/Polars Dataframe is not supported, however, you can use the Query to create Feature Views/Training Data and write the data to a Storage Connector, from where you can read up the data into a Pandas/Polars Dataframe. | +| Feature Group Creation from dataframes | [`FeatureGroup.create_feature_group()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#create_feature_group) | :white_check_mark: | :white_check_mark: | - | - | Currently Flink/Beam doesn't support registering feature group metadata. Thus it needs to be pre-registered before you can write real time features computed by Flink/Beam.| +| Training Dataset Creation from dataframes | [`TrainingDataset.save()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/training_dataset_api/#save) | :white_check_mark: | - | - | - | Functionality was deprecated in version 3.0 | +| Data validation using Great Expectations for streaming dataframes | [`FeatureGroup.validate()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#validate) [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | - | - | - | - | `insert_stream` does not perform any data validation even when a expectation suite is attached. | +| Stream ingestion | [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | :white_check_mark: | - | :white_check_mark: | :white_check_mark: | Python/Pandas/Polars has currently no notion of streaming. | +| Stream ingestion | [`FeatureGroup.insert_stream()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) | :white_check_mark: | - | :white_check_mark: | :white_check_mark: | Python/Pandas/Polars has currently no notion of streaming. | +| Reading from Streaming Storage Connectors | [`KafkaConnector.read_stream()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/storage_connector_api/#read_stream) | :white_check_mark: | - | - | - | Python/Pandas/Polars has currently no notion of streaming. For Flink/Beam only write operations are supported | +| Reading training data from external storage other than S3 | [`FeatureView.get_training_data()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#get_training_data) | :white_check_mark: | - | - | - | Reading training data that was written to external storage using a Storage Connector other than S3 can currently not be read using HSFS APIs, instead you will have to use the storage's native client. | +| Reading External Feature Groups into Dataframe | [`ExternalFeatureGroup.read()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#read) | :white_check_mark: | - | - | - | Reading an External Feature Group directly into a Pandas/Polars Dataframe is not supported, however, you can use the [Query API](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/query_api/) to create Feature Views/Training Data containing External Feature Groups. | +| Read Queries containing External Feature Groups into Dataframe | [`Query.read()`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/query_api/#read) | :white_check_mark: | - | - | - | Reading a Query containing an External Feature Group directly into a Pandas/Polars Dataframe is not supported, however, you can use the Query to create Feature Views/Training Data and write the data to a Storage Connector, from where you can read up the data into a Pandas/Polars Dataframe. | ## Python @@ -64,7 +64,7 @@ Connecting to the Feature Store from an external Flink cluster, such as GCP Data ### Inside Hopsworks -Beam is only supported as an external client. +Beam is only supported as an external client. ### Outside Hopsworks diff --git a/docs/user_guides/fs/feature_group/create.md b/docs/user_guides/fs/feature_group/create.md index e1404051b..1abce1c54 100644 --- a/docs/user_guides/fs/feature_group/create.md +++ b/docs/user_guides/fs/feature_group/create.md @@ -2,7 +2,7 @@ description: Documentation on how to create a Feature Group and the different APIs available to insert data to a Feature Group in Hopsworks. --- -# How to create a Feature Group +# How to create a Feature Group ### Introduction @@ -16,7 +16,7 @@ Before you begin this guide we suggest you read the [Feature Group](../../../con To create a feature group using the HSFS APIs, you need to provide a Pandas, Polars or Spark DataFrame. The DataFrame will contain all the features you want to register within the feature group, as well as the primary key, event time and partition key. -### Create a Feature Group +### Create a Feature Group The first step to create a feature group is to create the API metadata object representing a feature group. Using the HSFS API you can execute: @@ -36,15 +36,15 @@ The first step to create a feature group is to create the API metadata object re ) ``` -The full method documentation is available [here](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup). If you need to create a feature group with vector similarity search supported, refer to [this guide](../vector_similarity_search.md#extending-feature-groups-with-similarity-search). `name` is the only mandatory parameter of the `create_feature_group` and represents the name of the feature group. +The full method documentation is available [here](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup). If you need to create a feature group with vector similarity search supported, refer to [this guide](../vector_similarity_search.md#extending-feature-groups-with-similarity-search). `name` is the only mandatory parameter of the `create_feature_group` and represents the name of the feature group. -In the example above we created the first version of a feature group named *weather*, we provide a description to make it searchable to the other project members, as well as making the feature group available online. +In the example above we created the first version of a feature group named *weather*, we provide a description to make it searchable to the other project members, as well as making the feature group available online. -Additionally we specify which columns of the DataFrame will be used as primary key, partition key and event time. Composite primary key and multi level partitioning is also supported. +Additionally we specify which columns of the DataFrame will be used as primary key, partition key and event time. Composite primary key and multi level partitioning is also supported. -The version number is optional, if you don't specify the version number the APIs will create a new version by default with a version number equals to the highest existing version number plus one. +The version number is optional, if you don't specify the version number the APIs will create a new version by default with a version number equals to the highest existing version number plus one. -The last parameter used in the examples above is `stream`. The `stream` parameter controls whether to enable the streaming write APIs to the online and offline feature store. When using the APIs in a Python environment this behavior is the default and it requires the time travel format to be set to 'HUDI'. +The last parameter used in the examples above is `stream`. The `stream` parameter controls whether to enable the streaming write APIs to the online and offline feature store. When using the APIs in a Python environment this behavior is the default and it requires the time travel format to be set to 'HUDI'. ##### Primary key @@ -53,7 +53,7 @@ When writing data on the online feature store, existing rows with the same prima ##### Event time -The event time column represents the time at which the event was generated. For example, with transaction data, the event time is the time at which a given transaction happened. +The event time column represents the time at which the event was generated. For example, with transaction data, the event time is the time at which a given transaction happened. In the context of feature pipelines, the event time is often also the end timestamp of the interval of events included in the feature computation. For example, computing the feature "number of purchases by customer last week", the event time should be the last day of this "last week" window. The event time is added to the primary key when writing to the offline feature store. This will make sure that the offline feature store has the entire history of feature values over time. As an example, if a user has made multiple purchases on a website, each of the purchases for a given user (identified by a user_id) will be saved in the feature group, with each purchase having a different event time (the combination of user_id and event_time makes up the primary key for the offline feature store). @@ -66,9 +66,9 @@ The event time **is not** part of the primary key when writing to the online fea ##### Partition key It is best practice to add a partition key. When you specify a partition key, the data in the feature group will be stored under multiple directories based on the value of the partition column(s). -All the rows with a given value as partition key will be stored in the same directory. +All the rows with a given value as partition key will be stored in the same directory. -Choosing the correct partition key has significant impact on the query performance as the execution engine (Spark) will be able to skip listing and reading files belonging to partitions which are not included in the query. +Choosing the correct partition key has significant impact on the query performance as the execution engine (Spark) will be able to skip listing and reading files belonging to partitions which are not included in the query. As an example, if you have partitioned your feature group by day and you are creating a training dataset that includes only the last year of data, Spark will read only 365 partitions and not the entire history of data. On the other hand, if the partition key is too fine grained (e.g. timestamp at millisecond resolution) - a large number of small partitions will be generated. This will slow down query execution as Spark will need to list and read a large amount of small directories/files. @@ -83,7 +83,7 @@ By using partitioning the system will write the feature data in different subdir ##### Table format -When you create a feature group, you can specify the table format you want to use to store the data in your feature group by setting the `time_travel_format` parameter. The currently support values are "HUDI", "DELTA", "NONE" (which defaults to Parquet). +When you create a feature group, you can specify the table format you want to use to store the data in your feature group by setting the `time_travel_format` parameter. The currently support values are "HUDI", "DELTA", "NONE" (which defaults to Parquet). ##### Storage connector @@ -308,19 +308,19 @@ advised to utilize separate topics when ingestions overlap or there is a large f The snippet above only created the metadata object on the Python interpreter running the code. To register the feature group metadata and to save the feature data with Hopsworks, you should invoke the `insert` method: -```python +```python fg.insert(df) ``` -The save method takes in input a Pandas, Polars or Spark DataFrame. HSFS will use the DataFrame columns and types to determine the name and types of features, primary key, partition key and event time. +The save method takes in input a Pandas, Polars or Spark DataFrame. HSFS will use the DataFrame columns and types to determine the name and types of features, primary key, partition key and event time. The DataFrame *must* contain the columns specified as primary keys, partition key and event time in the `create_feature_group` call. If a feature group is online enabled, the `insert` method will store the feature data to both the online and offline storage. -### API Reference +### API Reference -[FeatureGroup](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup) +[FeatureGroup](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#featuregroup) ## Create using the UI diff --git a/docs/user_guides/fs/feature_group/create_external.md b/docs/user_guides/fs/feature_group/create_external.md index ce35397d1..9c0bbceb1 100644 --- a/docs/user_guides/fs/feature_group/create_external.md +++ b/docs/user_guides/fs/feature_group/create_external.md @@ -26,7 +26,7 @@ To create an external feature group using the HSFS APIs you need to provide an e ### Create an External Feature Group -The first step is to instantiate the metadata through the `create_external_feature_group` method. Once you have defined the metadata, you can +The first step is to instantiate the metadata through the `create_external_feature_group` method. Once you have defined the metadata, you can [persist the metadata and create the feature group](#register-the-metadata) in Hopsworks by calling `fg.save()`. #### SQL based external feature group @@ -37,7 +37,7 @@ The first step is to instantiate the metadata through the `create_external_featu query = """ SELECT TO_NUMERIC(ss_store_sk) AS ss_store_sk , AVG(ss_net_profit) AS avg_ss_net_profit - , SUM(ss_net_profit) AS total_ss_net_profit + , SUM(ss_net_profit) AS total_ss_net_profit , AVG(ss_list_price) AS avg_ss_list_price , AVG(ss_coupon_amt) AS avg_ss_coupon_amt , sale_date @@ -58,7 +58,7 @@ The first step is to instantiate the metadata through the `create_external_featu fg.save() ``` -#### Data Lake based external feature group +#### Data Lake based external feature group === "Python" @@ -75,13 +75,13 @@ The first step is to instantiate the metadata through the `create_external_featu fg.save() ``` -The full method documentation is available [here](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#externalfeaturegroup). `name` is a mandatory parameter of the `create_external_feature_group` and represents the name of the feature group. +The full method documentation is available [here](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#externalfeaturegroup). `name` is a mandatory parameter of the `create_external_feature_group` and represents the name of the feature group. The version number is optional, if you don't specify the version number the APIs will create a new version by default with a version number equals to the highest existing version number plus one. If the storage connector is defined for a data warehouse (e.g. JDBC, Snowflake, Redshift) you need to provide a SQL statement that will be executed to compute the features. If the storage connector is defined for a data lake, the location of the data as well as the format need to be provided. -Additionally we specify which columns of the DataFrame will be used as primary key, and event time. Composite primary keys are also supported. +Additionally we specify which columns of the DataFrame will be used as primary key, and event time. Composite primary keys are also supported. ### Register the metadata @@ -89,7 +89,7 @@ In the snippet above it's important that the created metadata object gets regist === "Python" - ```python + ```python fg.save() ``` @@ -118,19 +118,19 @@ You can enable online storage for external feature groups, however, the sync fro external_fg.insert(df) ``` -The `insert()` method takes a DataFrame as parameter and writes it _only_ to the online feature store. Users can select which subset of the feature group data they want to make available on the online feature store by using the [query APIs](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/query_api/). +The `insert()` method takes a DataFrame as parameter and writes it _only_ to the online feature store. Users can select which subset of the feature group data they want to make available on the online feature store by using the [query APIs](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/query_api/). ### Limitations Hopsworks Feature Store does not support time-travel queries on external feature groups. Additionally, support for `.read()` and `.show()` methods when using by the Python engine is limited to external feature groups defined on BigQuery and Snowflake and only when using the [Feature Query Service](../../../setup_installation/common/arrow_flight_duckdb.md). -Nevertheless, external feature groups defined top of any storage connector can be used to create a training dataset from a Python environment invoking one of the following methods: [create_training_data](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_training_data), [create_train_test_split](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_train_test_split) or the [create_train_validation_test_split](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_train_validation_test_split) +Nevertheless, external feature groups defined top of any storage connector can be used to create a training dataset from a Python environment invoking one of the following methods: [create_training_data](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_training_data), [create_train_test_split](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_train_test_split) or the [create_train_validation_test_split](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#create_train_validation_test_split) -### API Reference +### API Reference -[External FeatureGroup](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#externalfeaturegroup) +[External FeatureGroup](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/external_feature_group_api/#externalfeaturegroup) ## Create using the UI diff --git a/docs/user_guides/fs/feature_group/create_spine.md b/docs/user_guides/fs/feature_group/create_spine.md index 296eb37eb..be8382bcb 100644 --- a/docs/user_guides/fs/feature_group/create_spine.md +++ b/docs/user_guides/fs/feature_group/create_spine.md @@ -57,4 +57,4 @@ And you can always also replace the dataframe contained within the Spine Group. ### API Reference -[SpineGroup](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/spine_group_api/#spinegroup) +[SpineGroup](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/spine_group_api/#spinegroup) diff --git a/docs/user_guides/fs/feature_group/data_types.md b/docs/user_guides/fs/feature_group/data_types.md index a8a1881f8..86271ac44 100644 --- a/docs/user_guides/fs/feature_group/data_types.md +++ b/docs/user_guides/fs/feature_group/data_types.md @@ -1,4 +1,4 @@ -# How to manage schema and feature data types +# How to manage schema and feature data types ### Introduction @@ -6,24 +6,24 @@ In this guide, you will learn how to manage the feature group schema and control ## Prerequisites -Before you begin this guide we suggest you read the [Feature Group](../../../concepts/fs/feature_group/fg_overview.md) concept page to understand what a feature group is and how it fits in the ML pipeline. +Before you begin this guide we suggest you read the [Feature Group](../../../concepts/fs/feature_group/fg_overview.md) concept page to understand what a feature group is and how it fits in the ML pipeline. We also suggest you familiarize yourself with the APIs to [create a feature group](./create.md). -## Feature group schema +## Feature group schema When a feature is stored in both the online and offline feature stores, it will be stored in a data type native to each store. * **[Offline data type](#offline-data-types)**: The data type of the feature when stored on the offline feature store. The offline feature store is based on Apache Hudi and Hive Metastore, as such, [Hive Data Types](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types) can be leveraged. * **[Online data type](#online-data-types)**: The data type of the feature when stored on the online feature store. The online storage is based on RonDB and hence, - [MySQL Data Types](https://dev.mysql.com/doc/refman/8.0/en/data-types.html) can be leveraged. + [MySQL Data Types](https://dev.mysql.com/doc/refman/8.0/en/data-types.html) can be leveraged. The offline data type is always required, even if the feature group is stored only online. On the other hand, if the feature group is not *online_enabled*, its features will not have an online data type. The offline and online types for each feature are automatically inferred from the Spark or Pandas types of the input DataFrame as outlined in the following two sections. The default mapping, however, can be overwritten by using an [explicit schema definition](#explicit-schema-definition). -### Offline data types +### Offline data types When registering a [Spark](https://spark.apache.org/docs/latest/sql-ref-datatypes.html) DataFrame in a PySpark environment (S), or a [Pandas](https://pandas.pydata.org/) DataFrame, or a [Polars](https://pola.rs/) DataFrame in a Python-only environment (P) the following default mapping to offline feature types applies: @@ -62,28 +62,28 @@ It results in a less fine-grained mapping between Python and Spark types: | object (dict) | StructType | | | object (binary) | BinaryType | | -### Online data types +### Online data types -The online data type is determined based on the offline type according to the following mapping, regardless of which environment the data originated from. +The online data type is determined based on the offline type according to the following mapping, regardless of which environment the data originated from. Only a subset of the data types can be used as primary key, as indicated in the table as well: -| Offline Feature Type | Online Feature Type | Primary Key | Remarks | +| Offline Feature Type | Online Feature Type | Primary Key | Remarks | |-------------------------------|----------------------|-------------|----------------------------------------------------------| -| BOOLEAN | TINYINT | x | | -| TINYINT | TINYINT | x | | -| SMALLINT | SMALLINT | x | | -| INT | INT | x | Also supports: TINYINT, SMALLINT | -| BIGINT | BIGINT | x | | -| FLOAT | FLOAT | | | -| DOUBLE | DOUBLE | | | -| DECIMAL(PREC, SCALE) | DECIMAL(PREC, SCALE) | | e.g. DECIMAL(38, 18) | -| TIMESTAMP | TIMESTAMP | | s. [Timestamps and Timezones](#timestamps-and-timezones) | -| DATE | DATE | x | | -| STRING | VARCHAR(100) | x | Also supports: TEXT | -| ARRAY<TYPE> | VARBINARY(100) | x | Also supports: BLOB | -| STRUCT<NAME: TYPE, ...> | VARBINARY(100) | x | Also supports: BLOB | -| BINARY | VARBINARY(100) | x | Also supports: BLOB | -| MAP<String,TYPE> | VARBINARY(100) | x | Also supports: BLOB | +| BOOLEAN | TINYINT | x | | +| TINYINT | TINYINT | x | | +| SMALLINT | SMALLINT | x | | +| INT | INT | x | Also supports: TINYINT, SMALLINT | +| BIGINT | BIGINT | x | | +| FLOAT | FLOAT | | | +| DOUBLE | DOUBLE | | | +| DECIMAL(PREC, SCALE) | DECIMAL(PREC, SCALE) | | e.g. DECIMAL(38, 18) | +| TIMESTAMP | TIMESTAMP | | s. [Timestamps and Timezones](#timestamps-and-timezones) | +| DATE | DATE | x | | +| STRING | VARCHAR(100) | x | Also supports: TEXT | +| ARRAY<TYPE> | VARBINARY(100) | x | Also supports: BLOB | +| STRUCT<NAME: TYPE, ...> | VARBINARY(100) | x | Also supports: BLOB | +| BINARY | VARBINARY(100) | x | Also supports: BLOB | +| MAP<String,TYPE> | VARBINARY(100) | x | Also supports: BLOB | More on how Hopsworks handles [string types](#string-online-data-types), [complex data types](#complex-online-data-types) and the online restrictions for [primary keys](#online-restrictions-for-primary-key-data-types) and [row size](#online-restrictions-for-row-size) in the following sections. @@ -92,7 +92,7 @@ More on how Hopsworks handles [string types](#string-online-data-types), [compl String types are stored as *VARCHAR(100)* by default. This type is fixed-size, meaning it can only hold as many characters as specified in the argument (e.g. VARCHAR(100) can hold up to 100 unicode characters). The size should thus be within the maximum string length of the input data. Furthermore, the VARCHAR size has to be in line with the [online restrictions for row size](#online-restrictions-for-row-size). -If the string size exceeds 100 characters, a larger type (e.g. VARCHAR(500)) can be specified via an [explicit schema definition](#explicit-schema-definition). +If the string size exceeds 100 characters, a larger type (e.g. VARCHAR(500)) can be specified via an [explicit schema definition](#explicit-schema-definition). If the string size is unknown or if it exceeds the maximum row size, then the [TEXT type](https://docs.rondb.com/blobs/) can be used instead. String data that exceeds the specified VARCHAR size will lead to an error when data gets written to the online feature store. @@ -101,10 +101,10 @@ When in doubt, use the TEXT type instead, but note that it comes with a potentia #### Complex online data types Hopsworks allows users to store complex types (e.g. *ARRAY*) in the online feature store. Hopsworks serializes the complex features transparently and stores them as VARBINARY in the online feature store. -The serialization happens when calling the [save()](https://docs.hopsworks.ai/feature-store-api/3.0/generated/api/feature_group_api/#save), -[insert()](https://docs.hopsworks.ai/feature-store-api/3.0/generated/api/feature_group_api/#insert) or [insert_stream()](https://docs.hopsworks.ai/feature-store-api/3.0/generated/api/feature_group_api/#insert_stream) methods. -The deserialization will be executed when calling the [get_serving_vector()](https://docs.hopsworks.ai/feature-store-api/3.0/generated/api/training_dataset_api/#get_serving_vector) method to retrieve data from the online feature store. -If users query directly the online feature store, for instance using the `fs.sql("SELECT ...", online=True)` statement, it will return a binary blob. +The serialization happens when calling the [save()](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#save), +[insert()](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert) or [insert_stream()](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert_stream) methods. +The deserialization will be executed when calling the [get_serving_vector()](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/training_dataset_api/#get_serving_vector) method to retrieve data from the online feature store. +If users query directly the online feature store, for instance using the `fs.sql("SELECT ...", online=True)` statement, it will return a binary blob. On the feature store UI, the online feature type for complex features will be reported as *VARBINARY*. @@ -116,14 +116,14 @@ When in doubt, use the BLOB type instead, but note that it comes with a potentia #### Online restrictions for primary key data types -When a feature is being used as a primary key, certain types are not allowed. -Examples of such types are *FLOAT*, *DOUBLE*, *TEXT* and *BLOB*. +When a feature is being used as a primary key, certain types are not allowed. +Examples of such types are *FLOAT*, *DOUBLE*, *TEXT* and *BLOB*. Additionally, the size of the sum of the primary key online data types storage requirements **should not exceed 4KB**. #### Online restrictions for row size -The online feature store supports **up to 500 columns** and all column types combined **should not exceed 30000 Bytes**. -The byte size of each column is determined by its data type and calculated as follows: +The online feature store supports **up to 500 columns** and all column types combined **should not exceed 30000 Bytes**. +The byte size of each column is determined by its data type and calculated as follows: | Online Data Type | Byte Size | |---------------------------------|--------------| @@ -145,9 +145,9 @@ The byte size of each column is determined by its data type and calculated as fo ### Timestamps and Timezones -All timestamp features are stored in Hopsworks in UTC time. Also, all timestamp-based functions (such as [point-in-time joins](../../../concepts/fs/feature_view/offline_api.md#point-in-time-correct-training-data)) use UTC time. -This ensures consistency of timestamp features across different client timezones and simplifies working with timestamp-based functions in general. -When ingesting timestamp features, the [Feature Store Write API](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert) will automatically handle the conversion to UTC, if necessary. +All timestamp features are stored in Hopsworks in UTC time. Also, all timestamp-based functions (such as [point-in-time joins](../../../concepts/fs/feature_view/offline_api.md#point-in-time-correct-training-data)) use UTC time. +This ensures consistency of timestamp features across different client timezones and simplifies working with timestamp-based functions in general. +When ingesting timestamp features, the [Feature Store Write API](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#insert) will automatically handle the conversion to UTC, if necessary. The following table summarizes how different timestamp types are handled: | Data Frame (Data Type) | Environment | Handling | @@ -156,7 +156,7 @@ The following table summarizes how different timestamp types are handled: | Pandas DataFrame (datetime64[ns, tz]) | Python-only and PySpark | timezone-sensitive conversion from 'tz' to UTC | | Spark (TimestampType) | PySpark and Spark | interpreted as UTC, independent of the client's timezone | -Timestamp features retrieved from the Feature Store, e.g. using the [Feature Store Read API](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#read), use a timezone-unaware format: +Timestamp features retrieved from the Feature Store, e.g. using the [Feature Store Read API](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#read), use a timezone-unaware format: | Data Frame (Data Type) | Environment | Timezone | |---------------------------------------|-------------------------|------------------------| @@ -173,33 +173,33 @@ You can explicitly define the feature group schema as follows: === "Python" ```python from hsfs.feature import Feature - + features = [ Feature(name="id",type="int",online_type="int"), Feature(name="name",type="string",online_type="varchar(20)") ] - + fg = fs.create_feature_group(name="fg_manual_schema", features=features, online_enabled=True) fg.save(features) ``` -## Append features to existing feature groups +## Append features to existing feature groups Hopsworks supports appending additional features to an existing feature group. Adding additional features to an existing feature group is not considered a breaking change. === "Python" ```python from hsfs.feature import Feature - + features = [ Feature(name="id",type="int",online_type="int"), Feature(name="name",type="string",online_type="varchar(20)") ] - + fg = fs.get_feature_group(name="example", version=1) fg.append_features(features) ``` -When adding additional features to a feature group, you can provide a default values for existing entries in the feature group. You can also backfill the new features for existing entries by running an `insert()` operation and update all existing combinations of *primary key* - *event time*. +When adding additional features to a feature group, you can provide a default values for existing entries in the feature group. You can also backfill the new features for existing entries by running an `insert()` operation and update all existing combinations of *primary key* - *event time*. diff --git a/docs/user_guides/fs/feature_view/feature-vectors.md b/docs/user_guides/fs/feature_view/feature-vectors.md index d2829cb91..f7f96679a 100644 --- a/docs/user_guides/fs/feature_view/feature-vectors.md +++ b/docs/user_guides/fs/feature_view/feature-vectors.md @@ -1,10 +1,10 @@ # Feature Vectors -The Hopsworks Platform integrates real-time capabilities with its Online Store. Based on [RonDB](https://www.rondb.com/), your feature vectors are served at scale at in-memory latency (~1-10ms). Checkout the benchmarks results [here](https://www.hopsworks.ai/post/feature-store-benchmark-comparison-hopsworks-and-feast#images-2) and the code [here](https://github.com/featurestoreorg/featurestore-benchmarks). The same Feature View which was used to create training datasets can be used to retrieve feature vectors for real-time predictions. This allows you to serve the same features to your model in training and serving, ensuring consistency and reducing boilerplate. Whether you are either inside the Hopsworks platform, a model serving platform, or in an external environment, such as your application server. +The Hopsworks Platform integrates real-time capabilities with its Online Store. Based on [RonDB](https://www.rondb.com/), your feature vectors are served at scale at in-memory latency (~1-10ms). Checkout the benchmarks results [here](https://www.hopsworks.ai/post/feature-store-benchmark-comparison-hopsworks-and-feast#images-2) and the code [here](https://github.com/featurestoreorg/featurestore-benchmarks). The same Feature View which was used to create training datasets can be used to retrieve feature vectors for real-time predictions. This allows you to serve the same features to your model in training and serving, ensuring consistency and reducing boilerplate. Whether you are either inside the Hopsworks platform, a model serving platform, or in an external environment, such as your application server. Below is a practical guide on how to use the Online Store Python and Java Client. The aim is to get you started quickly by providing code snippets which illustrate various use cases and functionalities of the clients. If you need to get more familiar with the concept of feature vectors, you can read this [short introduction](../../../concepts/fs/feature_view/online_api.md) first. ## Retrieval -You can get back feature vectors from either python or java client by providing the primary key value(s) for the feature view. Note that filters defined in feature view and training data will not be applied when feature vectors are returned. If you need to retrieve a complete value of feature vectors without missing values, the required `entry` are [feature_view.primary_keys](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#primary_keys). Alternative, you can provide the primary key of the feature groups as the key of the entry. It is also possible to provide a subset of the entry, which will be discussed [below](#partial-feature-retrieval). +You can get back feature vectors from either python or java client by providing the primary key value(s) for the feature view. Note that filters defined in feature view and training data will not be applied when feature vectors are returned. If you need to retrieve a complete value of feature vectors without missing values, the required `entry` are [feature_view.primary_keys](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#primary_keys). Alternative, you can provide the primary key of the feature groups as the key of the entry. It is also possible to provide a subset of the entry, which will be discussed [below](#partial-feature-retrieval). === "Python" ```python @@ -38,7 +38,7 @@ You can get back feature vectors from either python or java client by providing ``` ### Required entry -Starting from python client v3.4, you can specify different values for the primary key of the same name which exists in multiple feature groups but are not joint by the same name. The table below summarises the value of `primary_keys` in different settings. Considering that you are joining 2 feature groups, namely, `left_fg` and `right_fg`, the feature groups have different primary keys, and features (`feature_*`) in each setting. Also, the 2 feature groups are [joint](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/query_api/#join) on different *join conditions* and *prefix* as `left_fg.join(right_fg, , prefix=)`. +Starting from python client v3.4, you can specify different values for the primary key of the same name which exists in multiple feature groups but are not joint by the same name. The table below summarises the value of `primary_keys` in different settings. Considering that you are joining 2 feature groups, namely, `left_fg` and `right_fg`, the feature groups have different primary keys, and features (`feature_*`) in each setting. Also, the 2 feature groups are [joint](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/query_api/#join) on different *join conditions* and *prefix* as `left_fg.join(right_fg, , prefix=)`. For java client, and python client before v3.4, the `primary_keys` are the set of primary key of all the feature groups in the query. Python client is backward compatible. It means that the `primary_keys` used before v3.4 can be applied to python client of later versions as well. @@ -118,12 +118,12 @@ If your model can handle missing value or if you want to impute the missing valu === "Python" ```python - # get a single vector with + # get a single vector with feature_view.get_feature_vector( entry = {"pk1": 1}, allow_missing=True ) - + # get multiple vectors feature_view.get_feature_vectors( entry = [ @@ -177,15 +177,15 @@ You can also use the parameter to provide values for all the features which are === "Python" ```python # get a single vector, replace values from an entire feature group - # note how in this example you don't have to provide the value of + # note how in this example you don't have to provide the value of # pk2, but you need to provide the features coming from that feature group - # in this case feature_b and feature_c + # in this case feature_b and feature_c feature_view.get_feature_vector( entry = { "pk1": 1 }, passed_features = { - "feature_a": "value_a", - "feature_b": "value_b", + "feature_a": "value_a", + "feature_b": "value_b", "feature_c": "value_c" } ) @@ -195,7 +195,7 @@ You can also use the parameter to provide values for all the features which are The Online Store can be accessed via the **Python** or **Java** client allowing you to use your language of choice to connect to the Online Store. Additionally, the Python client provides two different implementations to fetch data: **SQL** or **REST**. The SQL client is the default implementation. It requires a direct SQL connection to your RonDB cluster and uses python asyncio to offer high performance even when your Feature View rows involve querying multiple different tables. The REST client is an alternative implementation connecting to [RonDB Feature Vector Server](./feature-server.md). Perfect if you want to avoid exposing ports of your database cluster directly to clients. This implementation is available as of Hopsworks 3.7. -Initialise the client by calling the `init_serving` method on the Feature View object before starting to fetch feature vectors. This will initialise the chosen client, test the connection, and initialise the transformation functions registered with the Feature View. Note to use the REST client in the Hopsworks Cluster python environment you will need to provide an API key explicitly as JWT authentication is not yet supported. More configuration options can be found in the [API documentation](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#init_serving). +Initialise the client by calling the `init_serving` method on the Feature View object before starting to fetch feature vectors. This will initialise the chosen client, test the connection, and initialise the transformation functions registered with the Feature View. Note to use the REST client in the Hopsworks Cluster python environment you will need to provide an API key explicitly as JWT authentication is not yet supported. More configuration options can be found in the [API documentation](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_view_api/#init_serving). === "Python" ```python @@ -214,7 +214,7 @@ Once the client is initialised, you can start fetching feature vector(s) via the === "Python" ```python -# initialize both clients and set the default to REST +# initialize both clients and set the default to REST my_feature_view.init_serving( init_rest_client=True, init_sql_client=True, diff --git a/docs/user_guides/fs/storage_connector/usage.md b/docs/user_guides/fs/storage_connector/usage.md index 618906393..191b58f36 100644 --- a/docs/user_guides/fs/storage_connector/usage.md +++ b/docs/user_guides/fs/storage_connector/usage.md @@ -1,5 +1,5 @@ # Storage Connector Usage -Here, we look at how to use a Storage Connector after it has been created. +Here, we look at how to use a Storage Connector after it has been created. Storage Connectors provide an important first step for integrating with external data sources. The 3 fundamental functionalities where storage connectors are used are: @@ -35,8 +35,8 @@ We retrieve a storage connector simply by its unique name. ## Reading a Spark Dataframe from a Storage Connector One of the most common usages of a Storage Connector is to read data directly into a Spark Dataframe. -It's achieved via the `read` API of the connector object, which hides all the complexity of authentication and integration -with a data storage source. +It's achieved via the `read` API of the connector object, which hides all the complexity of authentication and integration +with a data storage source. The `read` API primarily has two parameters for specifying the data source, `path` and `query`, depending on the storage connector type. The exact behaviour could change depending on the storage connector type, but broadly they could be classified as below @@ -47,30 +47,30 @@ and users should pass a Spark data format (parquet, csv, orc, hudi, delta) to th === "PySpark" ```python - # read data into dataframe using path - df = connector.read(data_format='data_format', path='fileScheme://bucket/path/') + # read data into dataframe using path + df = connector.read(data_format='data_format', path='fileScheme://bucket/path/') ``` === "Scala" - ```scala - // read data into dataframe using path - val df = connector.read("", "data_format", new HashMap(), "fileScheme://bucket/path/") + ```scala + // read data into dataframe using path + val df = connector.read("", "data_format", new HashMap(), "fileScheme://bucket/path/") ``` - + #### Prepare Spark API Additionally, for reading file based data sources, another way to read the data is using the `prepare_spark` method. This method -can be used if you are reading the data directly through Spark. +can be used if you are reading the data directly through Spark. -Firstly, it handles the setup of all Spark configurations or properties necessary for a particular type of connector and +Firstly, it handles the setup of all Spark configurations or properties necessary for a particular type of connector and prepares the absolute path to read from, along with bucket name and the appropriate file scheme of the data source. A Spark session can handle only one configuration setup at a time, so HSFS cannot set the Spark configurations when retrieving the connector since it would lead to only always initialising the last connector being retrieved. Instead, user can do this setup explicitly with the `prepare_spark` method and therefore potentially use multiple connectors in one Spark session. `prepare_spark` handles only one bucket associated with that particular connector, however, it is possible to set up multiple connectors with different types as long as their Spark properties do not interfere with each other. So, for example a S3 connector and a Snowflake connector can be used in the same session, without calling `prepare_spark` multiple times, as the properties don’t interfere with each other. -If the storage connector is used in another API call, `prepare_spark` gets implicitly invoked, for example, -when a user materialises a training dataset using a storage connector or uses the storage connector to set up an External Feature Group. -So users do not need to call `prepare_spark` every time they do an operation with a connector, it is only necessary when reading directly using Spark . Using `prepare_spark` is also +If the storage connector is used in another API call, `prepare_spark` gets implicitly invoked, for example, +when a user materialises a training dataset using a storage connector or uses the storage connector to set up an External Feature Group. +So users do not need to call `prepare_spark` every time they do an operation with a connector, it is only necessary when reading directly using Spark . Using `prepare_spark` is also not necessary when using the `read` API. For example, to read directly from a S3 connector, we use the `prepare_spark` as follows @@ -85,27 +85,27 @@ For example, to read directly from a S3 connector, we use the `prepare_spark` as ### Data warehouse/SQL based connectors -For data sources accessed via SQL such as data warehouses and JDBC compliant databases, e.g. Redshift, Snowflake, BigQuery, JDBC, users pass the SQL query to read the data to the `query` -argument. In most cases, this will be some form of a `SELECT` query. Depending on the connector type, users can also just set the table path and read the whole table without explicitly +For data sources accessed via SQL such as data warehouses and JDBC compliant databases, e.g. Redshift, Snowflake, BigQuery, JDBC, users pass the SQL query to read the data to the `query` +argument. In most cases, this will be some form of a `SELECT` query. Depending on the connector type, users can also just set the table path and read the whole table without explicitly passing any SQL query to the `query` argument. This is mostly relevant for Google BigQuery. === "PySpark" ```python - # read results from a SQL - df = connector.read(query="SELECT * FROM TABLE") + # read results from a SQL + df = connector.read(query="SELECT * FROM TABLE") # or directly read a table if set on connector df = connector.read() ``` === "Scala" - ```scala - // read results from a SQL - val df = connector.read("SELECT * FROM TABLE", "" , new HashMap(),"") + ```scala + // read results from a SQL + val df = connector.read("SELECT * FROM TABLE", "" , new HashMap(),"") ``` ### Streaming based connector -For reading data streams, the Kafka Storage Connector supports reading a Kafka topic into Spark Structured Streaming Dataframes +For reading data streams, the Kafka Storage Connector supports reading a Kafka topic into Spark Structured Streaming Dataframes instead of a static Dataframe as in other connector types. === "PySpark" @@ -116,15 +116,15 @@ instead of a static Dataframe as in other connector types. ## Creating an External Feature Group -Another important aspect of a storage connector is its ability to facilitate creation of external feature groups with +Another important aspect of a storage connector is its ability to facilitate creation of external feature groups with the [Connector API](../../../concepts/fs/feature_group/external_fg.md). [External feature groups](../feature_group/create_external.md) are basically offline feature groups -and essentially stored as tables on external data sources. +and essentially stored as tables on external data sources. The `Connector API` relies on storage connectors behind the scenes to integrate with external datasource. This enables seamless integration with any data source as long as there is a storage connector defined. -To create an external feature group, we use the `create_external_feature_group` API, also known as `Connector API`, -and simply pass the storage connector created before to the `storage_connector` argument. -Depending on the external data source, we should set either the `query` argument for data warehouse based data sources, or +To create an external feature group, we use the `create_external_feature_group` API, also known as `Connector API`, +and simply pass the storage connector created before to the `storage_connector` argument. +Depending on the external data source, we should set either the `query` argument for data warehouse based data sources, or the `path` and `data_format` arguments for data lake based sources, similar to reading into dataframes as explained in above section. Example for any data warehouse/SQL based external sources, we set the desired SQL to `query` argument, and set the `storage_connector` @@ -141,14 +141,14 @@ argument to the storage connector object of desired data source. ) ``` -`Connector API` (external feature groups) only stores the metadata about the features within Hopsworks, +`Connector API` (external feature groups) only stores the metadata about the features within Hopsworks, while the actual data is still stored externally. This enables users to create feature groups within Hopsworks without the hassle of data migration. For more information on `Connector API`, read detailed guide about [external feature groups](../feature_group/create_external.md). ## Writing Training Data -Storage connectors are also used while writing training data to external sources. While calling the -[Feature View](../../../concepts/fs/feature_view/fv_overview.md) API `create_training_data` , we can pass the `storage_connector` argument which is necessary to materialise +Storage connectors are also used while writing training data to external sources. While calling the +[Feature View](../../../concepts/fs/feature_view/fv_overview.md) API `create_training_data` , we can pass the `storage_connector` argument which is necessary to materialise the data to external sources, as shown below. === "PySpark" @@ -159,13 +159,13 @@ the data to external sources, as shown below. data_format = 'spark_data_format', # e.g. data_format = "parquet" or data_format = "csv" write_options = {"wait_for_job": False}, storage_connector = connector - ) + ) ``` Read more about training data creation [here](../feature_view/training-data.md). ## Next Steps -We have gone through the basic use cases of a storage connector. -For more details about the API functionality for any specific connector type, -checkout the [API section](https://docs.hopsworks.ai/feature-store-api/3.1.0-SNAPSHOT/generated/api/storage_connector_api/#storage-connector). +We have gone through the basic use cases of a storage connector. +For more details about the API functionality for any specific connector type, +checkout the [API section](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/storage_connector_api/#storage-connector). diff --git a/docs/user_guides/fs/vector_similarity_search.md b/docs/user_guides/fs/vector_similarity_search.md index 406f74212..780d76b1a 100644 --- a/docs/user_guides/fs/vector_similarity_search.md +++ b/docs/user_guides/fs/vector_similarity_search.md @@ -17,7 +17,7 @@ from hsfs import embedding emb = embedding.EmbeddingIndex(index_name="news_fg") ``` -Then, add one or more embedding features to the index. Name and dimension of the embedding features are required for identifying which features should be indexed for k-nearest neighbor (KNN) search. In this example, we get the dimension of the embedding by taking the length of the value of the `embedding_heading` column in the first row of the dataframe `df`. Optionally, you can specify the similarity function among `l2_norm`, `cosine`, and `dot_product`. Refer to [add_embedding](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/embedding_index_api/#add_embedding) for the full list of arguments. +Then, add one or more embedding features to the index. Name and dimension of the embedding features are required for identifying which features should be indexed for k-nearest neighbor (KNN) search. In this example, we get the dimension of the embedding by taking the length of the value of the `embedding_heading` column in the first row of the dataframe `df`. Optionally, you can specify the similarity function among `l2_norm`, `cosine`, and `dot_product`. Refer to [add_embedding](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/embedding_index_api/#add_embedding) for the full list of arguments. ```aidl # Add embedding feature to the index emb.add_embedding("embedding_heading", len(df["embedding_heading"][0])) @@ -40,7 +40,7 @@ news_fg.insert(df) ``` # Similarity Search for Feature Groups using Vector Embeddings -You provide a vector embedding as a parameter to the search query using [`find_neighbors`](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#find_neighbors), and it returns the rows in the online feature group that have vector embedding values most similar to the provided vector embedding. +You provide a vector embedding as a parameter to the search query using [`find_neighbors`](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/feature_group_api/#find_neighbors), and it returns the rows in the online feature group that have vector embedding values most similar to the provided vector embedding. It is also possible to filter rows by specifying a filter on any of the features in the feature group. The filter is pushed down to the vector database to improve query performance. @@ -108,4 +108,4 @@ There are 2 types of online feature stores in Hopsworks: online store (RonDB) an Create a new index per feature group to optimize retrieval performance. # Next step -Explore the [news search example](https://github.com/logicalclocks/hopsworks-tutorials/blob/master/api_examples/hsfs/knn_search/news-search-knn.ipynb), demonstrating how to use Hopsworks for implementing a news search application using natural language in the application. Additionally, you can see the application of querying similar embeddings with additional features in this [news rank example](https://github.com/logicalclocks/hopsworks-tutorials/blob/master/api_examples/hsfs/knn_search/news-search-rank-view.ipynb). \ No newline at end of file +Explore the [news search example](https://github.com/logicalclocks/hopsworks-tutorials/blob/master/api_examples/hsfs/knn_search/news-search-knn.ipynb), demonstrating how to use Hopsworks for implementing a news search application using natural language in the application. Additionally, you can see the application of querying similar embeddings with additional features in this [news rank example](https://github.com/logicalclocks/hopsworks-tutorials/blob/master/api_examples/hsfs/knn_search/news-search-rank-view.ipynb). diff --git a/docs/user_guides/integrations/databricks/configuration.md b/docs/user_guides/integrations/databricks/configuration.md index 2c5b0ef40..09cd2852d 100644 --- a/docs/user_guides/integrations/databricks/configuration.md +++ b/docs/user_guides/integrations/databricks/configuration.md @@ -31,7 +31,7 @@ Users can get a valid Databricks API key by following the [Databricks Documentat ## Register a new Databricks Instance -To register a new Databricks instance, first navigate to `Project settings`, which can be found on the left-hand side of a Project's landing page, then select the `Integrations` tab. +To register a new Databricks instance, first navigate to `Project settings`, which can be found on the left-hand side of a Project's landing page, then select the `Integrations` tab.

@@ -125,4 +125,4 @@ Once the cluster is running users can establish a connection to the Hopsworks Fe ## Next Steps -For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. +For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. diff --git a/docs/user_guides/integrations/emr/emr_configuration.md b/docs/user_guides/integrations/emr/emr_configuration.md index dc39a554c..e9a178162 100644 --- a/docs/user_guides/integrations/emr/emr_configuration.md +++ b/docs/user_guides/integrations/emr/emr_configuration.md @@ -192,4 +192,4 @@ Your EMR cluster will now be able to access your Hopsworks Feature Store. ## Next Steps -Use the [Connection API](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/connection_api/) to connect to the Hopsworks Feature Store. For more information about how to use the Feature Store, see the [Quickstart Guide](https://colab.research.google.com/github/logicalclocks/hopsworks-tutorials/blob/master/quickstart.ipynb){:target="_blank"}. +Use the [Connection API](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/connection_api/) to connect to the Hopsworks Feature Store. For more information about how to use the Feature Store, see the [Quickstart Guide](https://colab.research.google.com/github/logicalclocks/hopsworks-tutorials/blob/master/quickstart.ipynb){:target="_blank"}. diff --git a/docs/user_guides/integrations/python.md b/docs/user_guides/integrations/python.md index c12348359..63cdac730 100644 --- a/docs/user_guides/integrations/python.md +++ b/docs/user_guides/integrations/python.md @@ -62,4 +62,4 @@ fs = conn.get_feature_store() # Get the project's default feature stor ## Next Steps -For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. +For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. diff --git a/docs/user_guides/integrations/spark.md b/docs/user_guides/integrations/spark.md index ec881a03a..4005ce66d 100644 --- a/docs/user_guides/integrations/spark.md +++ b/docs/user_guides/integrations/spark.md @@ -89,4 +89,4 @@ fs = conn.get_feature_store() # Get the project's default feature stor ## Next Steps -For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/feature-store-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. +For more information about how to connect, see the [Connection](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/api/connection_api/) API reference. Or continue with the Data Source guide to import your own data to the Feature Store. diff --git a/docs/user_guides/mlops/serving/api-protocol.md b/docs/user_guides/mlops/serving/api-protocol.md index 886bdf3b1..4eae81f3c 100644 --- a/docs/user_guides/mlops/serving/api-protocol.md +++ b/docs/user_guides/mlops/serving/api-protocol.md @@ -93,4 +93,4 @@ my_deployment.save() ### API Reference -[API Protocol](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/api/api-protocol/) +[API Protocol](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/#api_protocol) diff --git a/docs/user_guides/mlops/serving/deployment-state.md b/docs/user_guides/mlops/serving/deployment-state.md index 814d25939..571cff6d2 100644 --- a/docs/user_guides/mlops/serving/deployment-state.md +++ b/docs/user_guides/mlops/serving/deployment-state.md @@ -45,7 +45,7 @@ Once in the deployment overview page, you can find the aforementioned status ind ### Step 3: Check nº of running instances -Additionally, you can find the nº of instances currently running by scrolling down to the `resource allocation` section. +Additionally, you can find the nº of instances currently running by scrolling down to the `resource allocation` section.

@@ -99,9 +99,9 @@ deployment.transformer.resources.describe() ### API Reference -[Deployment](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/) +[Deployment](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/) -[PredictorState](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_api/) +[PredictorState](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_api/) ## Deployment status @@ -160,4 +160,4 @@ The following are two diagrams with the state transitions of conditions in start Conditions in stopping deployments
Condition transitions in stopping deployments
-

\ No newline at end of file +

diff --git a/docs/user_guides/mlops/serving/deployment.md b/docs/user_guides/mlops/serving/deployment.md index f8c5dad72..84cd16243 100644 --- a/docs/user_guides/mlops/serving/deployment.md +++ b/docs/user_guides/mlops/serving/deployment.md @@ -40,7 +40,7 @@ After selecting the model, the rest of fields are filled automatically. We pick !!! notice "Deployment name validation rules" A valid deployment name can only contain characters a-z, A-Z and 0-9. -!!! info "Predictor script for Python models" +!!! info "Predictor script for Python models" For Python models, you can select a custom [predictor script](#predictor) to load and run the trained model by clicking on `From project` or `Upload new file`, to choose an existing script in the project file system or upload a new script, respectively. If you prefer, change the name of the deployment, model version or [artifact version](#model-artifact). Then, click on `Create new deployment` to create the deployment for your model. @@ -135,7 +135,7 @@ Retrieve the trained model you want to deploy. my_model = mr.get_model("my_model", version=1) ``` -#### Option A: Using the model object +#### Option A: Using the model object ```python @@ -159,7 +159,7 @@ my_deployment.save() ### API Reference -[Model Serving](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/) +[Model Serving](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/model_serving_api/) ## Model Artifact diff --git a/docs/user_guides/mlops/serving/inference-batcher.md b/docs/user_guides/mlops/serving/inference-batcher.md index 90d7aba8e..d2994682c 100644 --- a/docs/user_guides/mlops/serving/inference-batcher.md +++ b/docs/user_guides/mlops/serving/inference-batcher.md @@ -94,7 +94,7 @@ my_deployment.save() ### API Reference -[Inference Batcher](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/inference_batcher_api/) +[Inference Batcher](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/inference_batcher_api/) ## Compatibility matrix diff --git a/docs/user_guides/mlops/serving/inference-logger.md b/docs/user_guides/mlops/serving/inference-logger.md index f9c644c29..94116a688 100644 --- a/docs/user_guides/mlops/serving/inference-logger.md +++ b/docs/user_guides/mlops/serving/inference-logger.md @@ -85,7 +85,7 @@ my_logger = InferenceLogger(kafka_topic=new_topic, mode="ALL") !!! notice "Use dict for simpler code" Similarly, you can create the same logger with: - + ```python my_logger = InferenceLogger(kafka_topic={"name": "CREATE"}, mode="ALL") @@ -110,11 +110,11 @@ my_deployment.save() ### API Reference -[Inference Logger](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/inference_logger_api/) +[Inference Logger](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/inference_logger_api/) ## Topic schema -The schema of Kafka events varies depending on the serving tool. In KServe deployments, model inputs and predictions are logged in separate events, but sharing the same `requestId` field. In non-KServe deployments, the same event contains both the model input and prediction related to the same inference request. +The schema of Kafka events varies depending on the serving tool. In KServe deployments, model inputs and predictions are logged in separate events, but sharing the same `requestId` field. In non-KServe deployments, the same event contains both the model input and prediction related to the same inference request. ??? example "Show kafka topic schemas" diff --git a/docs/user_guides/mlops/serving/predictor.md b/docs/user_guides/mlops/serving/predictor.md index 9da0792b6..668a8abbf 100644 --- a/docs/user_guides/mlops/serving/predictor.md +++ b/docs/user_guides/mlops/serving/predictor.md @@ -36,7 +36,7 @@ Once in the deployments page, you can create a new deployment by either clicking ### Step 2: Choose a framework -A simplified creation form will appear, including the most common deployment fields from all available configurations. The first step is to select your model to serve, which is done by first selecting the framework the model was registered as in the model registry. +A simplified creation form will appear, including the most common deployment fields from all available configurations. The first step is to select your model to serve, which is done by first selecting the framework the model was registered as in the model registry. For example if you registered the model as a TensorFlow model using `ModelRegistry.tensorflow.create_model(...)` you select `Tensorflow` in the dropdown. @@ -71,9 +71,9 @@ For python models, if you want to use your own [predictor script](#step-2-option ### Step 4 (Optional): Change predictor environment -If you are using a predictor script it is also required to configure the inference environment for the predictor. This environment needs to have all the necessary dependencies installed to run your predictor script. +If you are using a predictor script it is also required to configure the inference environment for the predictor. This environment needs to have all the necessary dependencies installed to run your predictor script. -By default, we provide a set of environments like `tensorflow-inference-pipeline`, `torch-inference-pipeline` and `pandas-inference-pipeline` that serves this purpose for common machine learning frameworks. +By default, we provide a set of environments like `tensorflow-inference-pipeline`, `torch-inference-pipeline` and `pandas-inference-pipeline` that serves this purpose for common machine learning frameworks. To create your own it is recommended to [clone](../../projects/python/python_env_clone.md) the `minimal-inference-pipeline` and install additional dependencies for your use-case. @@ -104,7 +104,7 @@ Here, you change the [serving tool](#serving-tool) for your deployment by enabli

-### Step 6 (Optional): Other advanced options +### Step 6 (Optional): Other advanced options Additionally, you can adjust the default values of the rest of components: @@ -158,7 +158,7 @@ ms = project.get_model_serving() ### Step 3 (Optional): Upload the script to your project !!! info "You can also use the UI to upload your predictor script. See [above](#step-3-advanced-deployment-form)" - + ```python uploaded_file_path = dataset_api.upload("my_predictor.py", "Resources", overwrite=True) @@ -192,7 +192,7 @@ my_deployment.save() ### API Reference -[Predictor](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_api/) +[Predictor](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_api/) ## Model Server diff --git a/docs/user_guides/mlops/serving/resources.md b/docs/user_guides/mlops/serving/resources.md index 117010577..34039fae5 100644 --- a/docs/user_guides/mlops/serving/resources.md +++ b/docs/user_guides/mlops/serving/resources.md @@ -32,7 +32,7 @@ A simplified creation form will appear including the most common deployment fiel ### Step 3: Configure resource allocation -In the `Resource allocation` section of the form, you can optionally set the resources to be allocated to the predictor and/or the transformer (if available). Moreover, you can choose the minimum number of replicas for each of these components. +In the `Resource allocation` section of the form, you can optionally set the resources to be allocated to the predictor and/or the transformer (if available). Moreover, you can choose the minimum number of replicas for each of these components. ??? note "Scale-to-zero capabilities" Deployments with KServe enabled can scale to zero by choosing `0` as the number of instances. @@ -105,7 +105,7 @@ my_deployment.save() ### API Reference -[Resource Allocation](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/resources_api/) +[Resource Allocation](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/resources_api/) ## Compatibility matrix @@ -118,4 +118,4 @@ my_deployment.save() | Kubernetes | Predictor | Minimum resources | | | Transformer | ❌ | | KServe | Predictor | Minimum / maximum resources | - | | Transformer | Minimum / maximum resources | \ No newline at end of file + | | Transformer | Minimum / maximum resources | diff --git a/docs/user_guides/mlops/serving/transformer.md b/docs/user_guides/mlops/serving/transformer.md index 97298602f..31332bed7 100644 --- a/docs/user_guides/mlops/serving/transformer.md +++ b/docs/user_guides/mlops/serving/transformer.md @@ -123,7 +123,7 @@ ms = project.get_model_serving() ### Step 3: Upload the script to your project !!! info "You can also use the UI to upload your transformer script. See [above](#step-3-advanced-deployment-form)" - + ```python uploaded_file_path = dataset_api.upload("my_transformer.py", "Resources", overwrite=True) @@ -157,7 +157,7 @@ my_deployment.save() ### API Reference -[Transformer](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/transformer_api/) +[Transformer](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/transformer_api/) ## Resources diff --git a/docs/user_guides/mlops/serving/troubleshooting.md b/docs/user_guides/mlops/serving/troubleshooting.md index 5de0b6933..18833204d 100644 --- a/docs/user_guides/mlops/serving/troubleshooting.md +++ b/docs/user_guides/mlops/serving/troubleshooting.md @@ -47,12 +47,12 @@ However, when the deployment fails to start futher details might be needed depen ### Step 3: Explore transient logs -Each deployment is composed of several components depending on its configuration and the model being served. Transient logs refer to component-specific logs that are directly retrieved from the component itself. Therefore, these logs can only be retrieved as long as the deployment components are reachable. +Each deployment is composed of several components depending on its configuration and the model being served. Transient logs refer to component-specific logs that are directly retrieved from the component itself. Therefore, these logs can only be retrieved as long as the deployment components are reachable. !!! info "" Transient logs are informative and fast to retrieve, facilitating the troubleshooting of deployment components at a glance -Transient logs are convenient when access to the most recent logs of a deployment is needed. +Transient logs are convenient when access to the most recent logs of a deployment is needed. !!! info When a deployment is in idle state, there are no components running (i.e., scaled to zero) and, thus, no transient logs are available. @@ -69,7 +69,7 @@ Transient logs are continuously collected and stored in OpenSearch, where they b Historical logs are convenient when a deployment fails occasionally, either at inference time or without a clear reason. In this case, narrowing the inspection of component-specific logs at a concrete point in time and searching for keywords can be helpful. -To access the OpenSearch Dashboards, click on the `See logs` button at the top of the deployment overview page. +To access the OpenSearch Dashboards, click on the `See logs` button at the top of the deployment overview page.

@@ -115,7 +115,7 @@ ms = project.get_model_serving() deployment = ms.get_deployment("mydeployment") ``` -### Step 3: Get current deployment state +### Step 3: Get current deployment's predictor state ```python @@ -134,6 +134,6 @@ deployment.get_logs(component="predictor|transformer", tail=10) ### API Reference -[Deployment](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/) +[Deployment](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/deployment_api/) -[PredictorState](https://docs.hopsworks.ai/machine-learning-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_state_api/) +[PredictorState](https://docs.hopsworks.ai/hopsworks-api/{{{ hopsworks_version }}}/generated/model-serving/predictor_state_api/)