Snowpark-optimized warehouses¶
Snowpark-optimized warehouses let you configure the available memory resources and CPU architecture on a single-node instance for your workloads.
When to use a Snowpark-optimized warehouse¶
While Snowpark workloads can be run on both standard and Snowpark-optimized warehouses, Snowpark-optimized warehouses are recommended for running code, and recommended workloads that have large memory requirements or dependencies on a specific CPU architecture. Example workloads include ML training use cases using a stored procedure on a single virtual warehouse node. Snowpark workloads, utilizing UDF or UDTF, might also benefit from Snowpark-optimized warehouses.
Note
Initial creation and resumption of a Snowpark-optimized virtual warehouse might take longer than standard warehouses.
Configuration options for Snowpark-optimized warehouses¶
The default configuration for a Snowpark-optimized warehouse provides 16x memory per node compared to a standard warehouse. You can
optionally configure additional memory per node and specify CPU architecture using the resource_constraint
property. The following
options are available:
Memory (up to) |
CPU architecture |
Minimum warehouse size required |
---|---|---|
16GB |
Default or x86 |
XSMALL |
256GB |
Default or x86 |
M |
1TB [1] |
Default or x86 |
L |
Creating a Snowpark-optimized warehouse¶
To create a new Snowpark-optimized warehouse, you can set the warehouse type property in the following interfaces.
Set the WAREHOUSE_TYPE property to 'SNOWPARK-OPTIMIZED'
when running the CREATE WAREHOUSE command. For example:
CREATE OR REPLACE WAREHOUSE snowpark_opt_wh WITH
WAREHOUSE_SIZE = 'MEDIUM'
WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED';
Create a large Snowpark-optimized warehouse so_warehouse
with 256 GB of memory by specifying the resource constraint
MEMORY_16X_X86
:
CREATE WAREHOUSE so_warehouse WITH
WAREHOUSE_SIZE = 'LARGE'
WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED'
RESOURCE_CONSTRAINT = 'MEMORY_16X_X86';
Note
The default resource constraint is MEMORY_16X
.
Set the warehouse_type
property to 'SNOWPARK-OPTIMIZED'
when constructing a Warehouse object.
Then, pass this Warehouse
object to the WarehouseCollection.create
method to create the warehouse in Snowflake. For example:
from snowflake.core import CreateMode
from snowflake.core.warehouse import Warehouse
my_wh = Warehouse(
name="snowpark_opt_wh",
warehouse_size="MEDIUM",
warehouse_type="SNOWPARK-OPTIMIZED"
)
root.warehouses.create(my_wh, mode=CreateMode.or_replace)
Note
Resource constraints are currently not supported in the Snowflake Python APIs.
Modifying Snowpark-optimized warehouse properties¶
To modify warehouse properties including the warehouse type, you can use the following interfaces.
Note
Changing the warehouse type is only supported for a warehouse in the SUSPENDED
state. To suspend a warehouse before changing the
warehouse_type
property, execute the following operation:
ALTER WAREHOUSE snowpark_opt_wh SUSPEND;
root.warehouses["snowpark_opt_wh"].suspend()
Use the ALTER WAREHOUSE command to modify the memory resources and CPU architecture for Snowpark-optimized
warehouse so_warehouse
:
ALTER WAREHOUSE so_warehouse SET
RESOURCE_CONSTRAINT = 'MEMORY_1X_x86';
Resource constraints are currently not supported in the Snowflake Python APIs.
Using Snowpark Python Stored Procedures to run ML training workloads¶
For information on Machine Learning Models and Snowpark Python, see Training Machine Learning Models with Snowpark Python.
Billing for Snowpark-optimized warehouses¶
For information on Snowpark-optimized warehouse credit consumption see Table 1(a): Snowflake Credit Table for Virtual Warehouse Services
in the Snowflake Service Consumption Table.
Region availability¶
Snowpark-optimized warehouses are available in all regions across AWS, Azure, and Google Cloud [1].