From 87262842e07f600b289019db921527f1ef8997b5 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Sat, 21 Nov 2026 05:37:28 +0800 Subject: [PATCH] docs(function): document GPU row deadline guidance (#5144) Enterprise GPU Functions on 1.13.0 through 1.14.1 and on 1.15.0 builds before the shared 300-second default was restored reject a refresh without an explicit positive `row_timeout_seconds`. The GPU authoring example and the `@function`/`@udf` docstrings now carry the requirement, the definition/request precedence, and sizing guidance. The 600-second value is a working example from the reported workload, not a recommendation. --- docs/web/curation/create-function.mdx | 10 ++++++++++ python/python/lancedb/functions.py | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/web/curation/create-function.mdx b/docs/web/curation/create-function.mdx index 109846bea..1e26f778f 100644 --- a/docs/web/curation/create-function.mdx +++ b/docs/web/curation/create-function.mdx @@ -209,6 +209,7 @@ gpu_class = next( @function( gpu=True, gpu_class=gpu_class, + row_timeout_seconds=600, pip=["torch==2.12.0", "sentence-transformers==5.7.0"], input_schema=pa.schema([pa.field("text", pa.string(), nullable=True)]), output_schema=pa.list_(pa.float32(), 384), @@ -231,6 +232,15 @@ table.add_columns({"embedding": version(text=col("caption"))}) ``` +`row_timeout_seconds` sets the per-call deadline, not the `__init__` budget. +Current Enterprise builds default to 300 seconds for both CPU and GPU +Functions. Enterprise 1.13.0 through 1.14.1, and 1.15.0 builds before the +shared default was restored, reject a GPU refresh unless the Function +definition or the refresh request sets a positive value; registration still +succeeds. A refresh value overrides the definition. Size the deadline from the +longest observed call. The 600 seconds above is one working GPU example, not a +universal recommendation. + Older servers that do not implement `GET /v1/gpu/classes` raise `NotImplementedError`. Without `gpu_class`, the deployment's default GPU class is used. The class is immutable with the Function version; set a diff --git a/python/python/lancedb/functions.py b/python/python/lancedb/functions.py index 43226fdf3..18403c75d 100644 --- a/python/python/lancedb/functions.py +++ b/python/python/lancedb/functions.py @@ -3724,7 +3724,11 @@ def function( Positive, finite deadline in seconds for each Python call: one row for scalar Functions and one batch for vectorized Functions. This does not govern class initialization. When omitted, the service applies its - default per-call budget. + default per-call budget, currently 300 seconds on Enterprise builds. + Set it for a GPU Function whose longest call can exceed that budget. + Enterprise builds that require an explicit GPU deadline reject a + refresh when neither the definition nor the refresh request sets one; + a refresh value overrides the definition. retry_policy : FunctionRetryPolicy, optional Retry selected failed calls inside the Function, with bounded attempts and backoff. A refresh may override this default. Retrying a partial @@ -3918,7 +3922,11 @@ __all__ = [ def udf(*args: Any, **kwargs: Any) -> Any: - """Deprecated alias of :func:`function`.""" + """Deprecated alias of :func:`function`. + + Accepts the same options, including ``row_timeout_seconds``. See + :func:`function` for GPU deadline guidance. + """ warnings.warn( "lancedb.udf is deprecated; use lancedb.function", DeprecationWarning,