Skip to Content
Snowflake Native AppPredictive Models

Predictive Models

In the Native App, predictive models train and score inside your Snowflake account, on a compute pool the app creates for them. Your data, the trained models and the scores never leave the account. This page covers what the app runs, how to prepare an install, how your roles read predictions, and what predictive costs.

A predictive run inside your Snowflake account: the control plane launches a job on the ML compute pool, which reads features from and writes scores to your database, stores or fetches the signed model in the app's own database, and publishes a predictions view your roles read through PREDICTIONS_READER

How it works

  • One job per run. Each training or rescore starts its own job on the app’s ML compute pool. A job takes a whole node, so the pool runs as many jobs at once as it has nodes. The job has no external network access.
  • Features and scores stay in your database. The job reads a feature table built by the app’s predictive warehouse, and writes each rescore’s scores to a new table in the app’s CDP_PLANNER schema. The predictions view your audiences use is switched to the new scores only once they are complete.
  • Trained models are kept by the app. Each trained model is stored in the app’s own database, beside its metadata, and signed by the app. Before a model is used to score, the app checks it against its signature, and a model that fails the check is never loaded.

Prerequisites

  • The Native App installed and set up, including Step 3 of the setup app, which creates the app’s services.
  • The privileges the app requests at install, including CREATE COMPUTE POOL and CREATE WAREHOUSE. No further grant to the app is needed for predictive.
  • An account that allows user workloads on Snowpark Container Services. If your account sets DISALLOWED_SPCS_WORKLOAD_TYPES or ALLOWED_SPCS_WORKLOAD_TYPES, USER must be allowed; the readiness check below reports it.

Prepare the install

The setup app creates two objects for predictive alongside the app’s other services. An install set up before predictive models existed gets them from the upgrade that brings predictive, with no step of yours. Both start suspended, so they cost nothing until a model trains.

ObjectDefaultPurpose
<APP>_ML_POOLHIGHMEM_X64_S, up to 2 nodes, suspends after 5 minutes idleRuns the training and scoring jobs
<APP>_PREDICTIVE_WHSmall, suspends after 1 minute idleRuns the SQL those jobs issue: the feature build and the scoring finalisation. Resize it with APP_DATA.SET_PREDICTIVE_WAREHOUSE_SIZE.

Check that the install can run predictive models:

CALL <APP>.APP_DATA.PREDICTIVE_READINESS();

The result lists each check and, for anything not ready, what to do. Until it passes, Zeotap refuses to start a training or rescore and shows the reason, so no run starts that cannot finish.

To change the pool’s instance family or its node count:

CALL <APP>.APP_DATA.SET_ML_POOL('HIGHMEM_X64_M', 2);

The family changes only while no predictive job is running and the pool is suspended. If the pool is running, the procedure suspends it and asks you to run it again a minute later. The node count can be 1 to 10.

When runs wait for a node

Each job takes a whole node, so with the default of two nodes a third run started while two are running waits until one finishes. Time spent waiting counts toward a run’s time limit. A training runs for at most 6 hours, and is failed if it has not finished 6 hours 30 minutes after it was launched; a rescore runs for at most 1 hour, and must finish within 1 hour 30 minutes. If runs often wait, for example because several models retrain on the same schedule, raise the node count:

CALL <APP>.APP_DATA.SET_ML_POOL(NULL, 4);

A higher cap costs nothing by itself: the pool adds a node only when a job needs one, and suspends 5 minutes after its last job ends.

Read predictions from your own roles

Everything the app creates in your database belongs to the app, so your roles can read it only once the app grants it. The app grants every predictions view, scores table and model metrics table it writes to an application role, PREDICTIONS_READER. Grant that role to the roles that should read predictions:

GRANT APPLICATION ROLE <APP>.PREDICTIONS_READER TO ROLE <your_role>;

The role that installed the app already holds it. PREDICTIONS_READER sees the predictive outputs only, not the app’s other tables.

Cost

Predictive runs use two kinds of compute in your account, both billed to you by Snowflake:

  • ML compute pool node time. A node bills at least 5 minutes each time it starts, then per second, and runs on for 5 minutes after its last job before it suspends.
  • Predictive warehouse time, for the SQL each run issues.
Instance familyCredits per node-hour
HIGHMEM_X64_S (default)0.28
HIGHMEM_X64_M1.11
MEM_X64_G2_321.344 on AWS, 1.148 on Azure

SET_ML_POOL also accepts other memory-optimised families, but Zeotap has rates only for these three. On any other family it can neither estimate nor record a run’s cost, so a model with a cost budget waits for your approval before every training. The default family has been measured on GCP; on AWS and Azure, Snowflake lists HIGHMEM_X64_S as a previous-generation family.

Before a training run, Zeotap estimates its node time in credits. If the model has a cost budget, a run over it waits for your approval. When a training or scoring run ends, whether it succeeded or failed, Zeotap records its cost: its share of the pool’s node time, from the moment its job was launched, so a node’s start-up counts. Runs that follow each other on the same node share its 5-minute minimum and its 5-minute idle time rather than each paying for them. Both figures appear on the model’s Activity tab in credits, with a US-dollar figure beside them at $3.00 per credit, which your contract price may differ from. Neither includes the warehouse SQL.

Billing mode

Your admin chooses how predictive usage is billed under the listing, in the setup app’s Predictive billing section:

ModeMeaning
IncludedPredictive is covered by the listing’s pricing. The default.
Compute pool surchargeThe surcharge set on the listing applies. No per-run charges are added.

Each change is recorded with when it was made, and applies from the next run.

Upgrades and retraining

A model's life in the Native App: train, store and sign, promote, score on schedule; an app upgrade that changes the ML libraries leads to one retrain, after which the new version is stored, promoted and scored

An app upgrade can change the machine learning libraries a model was trained with. A model trained before such a change is never scored with the new libraries. Instead:

  • On the model’s next scheduled rescore, Zeotap retrains it once. Your audiences keep the last scores until the new version is promoted and rescored.
  • A rescore you start by hand is refused with the reason.
  • If the retrain fails or is not promoted, the stale-scores alert says why. Promote a version trained since, or fix the model and retrain it.

A model with no rescore schedule is not retrained automatically. Retrain it from its page.

Limits

  • A trained model can be up to 256 MiB, and an install keeps up to 2 GiB of trained models. Older versions beyond a model’s retained versions are removed as new ones are stored.
  • Deleting a model does not drop its predictions view and scores tables from your database. The app owns them, so to drop them yourself, take ownership of them first, as for an uninstall.
  • Uninstalling the app removes its CDP_PLANNER schema, with every predictions view and scores table in it, unless you take ownership of it first. See Uninstall.
  • A training runs for at most 6 hours and a rescore for at most 1 hour. Each must also finish within 30 minutes more than that of being launched, including any time spent waiting for a node (see When runs wait for a node).
  • Per-run billing is not available yet.
  • Alerts reach Slack, email or webhooks only through the external access integrations you approve. Without them, they appear in the app.

Next steps

Last updated on