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.
This commit is contained in:
Xuanwo
2026-11-21 05:37:28 +08:00
committed by GitHub
parent c55b7c0390
commit 87262842e0
2 changed files with 20 additions and 2 deletions
+10
View File
@@ -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"))})
```
</CodeGroup>
`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
+10 -2
View File
@@ -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,