Production on Snowflake
Run an existing Engine model as a GPU ML Job and schedule it with Snowflake Tasks. The query warehouse supplies data access; the compute pool runs Engine.
Prepare Snowflake
Adapt the following steps to your account configuration. This guide uses GPU ML Jobs, Snowflake Tasks, Model Registry and Snowflake tracking.
Provision resources
- Choose a compatible GPU Container Runtime and Python build from Snowflake setup.
- Provision a GPU compute pool available in your region. Use the sizing steps below to select its resources.
- Provision a query warehouse, source schemas, model registry schema, output schema and payload/artifact stages. The warehouse handles connector queries; the compute pool runs Engine.
- Configure the stage used by the Engine artifact adapter with
SNOWFLAKE_SSEencryption. Keep retained models and outputs separate from job-local scratch.
Size compute and storage
- Use GPU sizing to select CPU, RAM and local SSD capacity for one job. For 100 GiB of source Parquet, the guidance recommends 32 vCPUs, at least 150 GiB RAM and 400 GiB free scratch, increasing to 800 GiB for graphs with many edges.
- Select GPU memory for your model and measure peak use with representative data. The source-data sizing estimates do not specify GPU memory requirements.
- Place scratch on local SSD and retain models and accepted outputs in durable storage. Network storage and cloud block volumes are not supported as Engine working storage.
- Size concurrent jobs for their combined resource use. Additional workers do not automatically distribute one Engine graph.
Configure access
-
Assign the job’s execution role and grant the permissions for routine scoring:
Model
USAGEalone does not allow downloading the bundle’s files. -
Grant provisioning roles the additional privileges to create jobs, Tasks, models and experiments. Separate these from the scoring role’s routine access.
-
Configure package access through the supported repository or an external access integration.
-
Use
SnowflakeConnector.from_spcs_env()where runtime identity is available, with the query warehouse supplied explicitly. The service execution role needs access to source data, model artifacts, output locations and tracking.
Install dependencies
- Follow Snowflake setup for runtime-specific installation requirements.
- Add
kumo-engine[snowflake]to the ML Job’s Python requirements, using the approved Engine build containing the MLOps APIs. This extra supplies the Snowflake connector and SDK dependencies. - Add source-specific extras if the workflow accesses other services. For example, use
kumo-engine[snowflake,s3]when it also uses the Engine S3 connector. - Use the same approved package version for training and scoring. Run the setup guide’s import and GPU checks in the job environment and record the effective dependency versions.
Prepare the model and prediction script
-
Select an evaluated model and retain its complete bundle, exact version and required text embedding assets. Store these outside temporary scratch. See Publish and Retrieve Models.
-
Move the working prediction code into
predict_batch.py, including imports, connector setup, graph definitions and predictive-query definitions. The production script illustrates the structure; use its Snowflake connectors for your production schemas. -
Supply the following inputs through your script arguments or job configuration:
These are application inputs, not built-in Engine CLI flags. A model bundle does not contain the source data or graph snapshot.
-
Load the model and build or reload the intended snapshot. Regenerate the prediction population for the batch.
-
Call
Trainer.predictinside the Kumo MLOps context to retain prediction records for monitoring. Configure a durable artifact root and the tracking destination for your environment. -
Export predictions to the attempt destination. Check the saved keys, population and task-specific row counts before making the output available to the application.
Deploy the ML Job
- Package
predict_batch.pyand its supporting modules using the ML Job walkthrough. - Configure the compute pool, payload stage, runtime, Python requirements and application inputs.
- Register a reusable ML Job Definition using Snowflake ML Jobs.
- Invoke the definition once and wait for the underlying ML Job result. Review the logs and saved prediction output.
- Create a Task or task-graph step that invokes the definition after upstream refresh. Supply the intended batch anchor and a separate attempt destination on each invocation.
- Configure Task timeouts, failure suspension and notifications. Add bounded retries once output delivery is duplicate-safe.
- Test that an ML Job failure makes the calling Task fail and sends the configured notification.
Snowflake registry run_batch provides an alternative container inference path. It writes scores without Kumo prediction-run records and requires the intended snapshot to be supplied for refreshed data. This guide uses ML Jobs calling Trainer.predict for Kumo monitoring.
Run the job before scheduling
- Run the job from a fresh runtime with the intended execution identity.
- Review terminal job status, saved predictions and tracking records. Read the saved output through the application’s access path.
- Measure peak RAM, GPU memory, scratch use and job duration on representative data. Adjust capacity before increasing concurrency.
- Test an interrupted run and retry before publishing its output. Keep the same model, data version, population and prediction anchor across attempts. Accept only one output for each logical batch.
- Test rollback to the previous model version and accepted output.
Schedule predictions and monitor results
- Schedule the job after the upstream data refresh, or configure a dependency on the refresh task.
- Record the model version, data or snapshot version, prediction anchor, batch identifier, accepted output location and job status together.
- Configure operational alerts for failed jobs and missed freshness deadlines. Track job duration, resource use and requested, scored and skipped rows.
- Compute score drift from retained Kumo prediction records. Evaluate model performance when labels become available and the prediction outcome window has completed.
- Export monitoring results to governed tables and configure their refresh schedule, alert thresholds and responsible operator.
Job logs describe execution health; drift and labeled outcomes describe model behavior. Investigate data freshness and population changes before deciding to retrain. Registry-native scoring may use a different monitoring path from jobs calling Trainer.predict inside Kumo MLOps.
For output delivery, keep each attempt separate until validation succeeds. Publish the accepted location once per batch and retain the previous accepted output on failure. See Schedule Prediction Jobs.
Promote and refresh models
- Train and register a candidate without changing the production alias.
- Compare the candidate with the current model using the same evaluation population and outcome definition.
- Run the candidate in the production job environment, then promote the accepted version. Record the exact version used for each prediction batch.
- Retain the previous model, embedding assets and runtime configuration. To roll back, select that version for subsequent jobs and restore the previous accepted output where needed.
See Refresh a Model for refresh cadence and evaluation guidance.
Assign ISV operating responsibilities
-
Assign the following responsibilities before deployment:
-
For ISV-operated environments, separate customer credentials, artifact roots, outputs and execution resources. A shared Python process does not provide tenant isolation.
-
Store credentials in managed secrets or use workload identity. Define credential rotation and revocation procedures, and exclude tokens and customer rows from diagnostic logs.
-
Agree on compute ownership, artifact retention and deletion permissions.