Skip to main content
SynthefyNoriFineTuner fine-tunes Nori on your table in your own AWS account, deploys the result as a SageMaker asynchronous endpoint and gives you a SynthefyNoriClient for it. Open In Colab The notebook runs this page end to end. It needs AWS credentials for the account that subscribed to the Algorithm. To serve the released models as they are, see Nori Inference on Amazon SageMaker.

What you get

  • A Nori model fine-tuned on your table. Fine-tuning is regression only.
  • An asynchronous SageMaker endpoint in your account that serves only that model, under the name you choose.
  • A training report that scores the fine-tuned model and the base model on the same rows.
The training job, the endpoint and your data stay in your account. No Synthefy service sits in front of them, and Synthefy can neither see nor stop them.

Before you start

1

Install the client

2

Subscribe to Synthefy - Nori Fine-Tuning

Open the Synthefy - Nori Fine-Tuning listing in AWS Marketplace and choose View purchase options.Synthefy - Nori Fine-Tuning product page in AWS Marketplace with View purchase optionsReview the pricing and terms, then choose Subscribe at the bottom of the page.Synthefy - Nori Fine-Tuning purchase options page with Subscribe highlighted
3

Copy the Algorithm ARN for your region

Once the subscription is active, choose Launch your software on the same page. Under Algorithm ARNs, copy the ARN for your region (the JSON view lists every region). To come back to it later, open the listing and choose View purchase options, then Launch your software.Use that region for the bucket, the training job and the endpoint: the client refuses an Algorithm ARN from another region before any AWS call. You don’t need the page’s Create training job button: the client starts the job.Launch page for Synthefy - Nori Fine-Tuning with the Algorithm ARNs panel and its copy button highlighted
4

Create the execution role

SageMaker runs the training job and the endpoint as this role.
In the IAM console choose Roles, then Create role. Choose AWS service, then SageMaker as the use case, and continue: the role gets AWS’s AmazonSageMakerFullAccess policy. Name it nori-fine-tune-execution and choose Create role.
5

Choose a bucket

Use an S3 bucket in that region whose name contains sagemaker, such as sagemaker-us-east-1-ACCOUNT_ID. AmazonSageMakerFullAccess grants object access to buckets named that way, so a bucket named otherwise is refused. To create one:
The identity that runs your code needs SageMaker and S3 access too, and AmazonSageMakerFullAccess covers every call the client makes. To grant both identities less, use the least-privilege policies.
A new AWS account can have no quota for GPU instances. SageMaker then refuses the job or the endpoint before anything bills, and the error names the quota to raise in the Service Quotas console, such as ml.g5.xlarge for training job usage.

Fine-tune a model

The snippets on this page run in order in one Python session. Replace ACCOUNT_ID, the Algorithm ARN and the target column y with your own.

Prepare your table

Fine-tuning is regression only, on a table in Parquet files (.parquet or .pq).
  • Every column the job trains on must be numeric. Missing and infinite feature values count as missing; the target must be finite in every row.
  • Encode categorical columns as numbers before you upload, and keep that encoding for prediction: a text column fails the job.
  • Each model trains on at least 1,000 rows. With bag 1 the training table needs about 1,400 rows, or 1,000 with a validation channel; with bag above 1 under the default "shard", about 1,150 rows per model, or 1,050 with a validation channel (2,300 for bag 2, 9,200 for bag 8). On a table too small for bag models the job trains fewer. A job on one table has no upper limit (see Large tables).
  • A row group holds at most 2,000,000 rows and 200,000,000 cells. For a table of up to 200 columns, write it with table.to_parquet("train.parquet", index=False, row_group_size=1_000_000).
To convert a CSV file: pd.read_csv("train.csv").to_parquet("train.parquet", index=False). training_data is one .parquet or .pq object, or a folder ending in /. An object’s key must not be the start of another key in the bucket. A folder holds this table’s Parquet files only, all with the same columns, in it or its sub-folders. The job skips empty files and names starting with _ or . (such as Spark’s _SUCCESS) and fails on any other file. Point it at plain Parquet files, not at a Delta Lake or Iceberg table, and keep every column in the files rather than in folder names (region=1/). validation_data is optional, takes the same form and has exactly the training table’s columns. The job validates on its rows and never trains on them. The walkthrough uses three files with the same columns: train.parquet, the table the job trains on; validation.parquet, optional; and new.parquet, rows the job never sees, for the prediction below. Bring your own, or let the first snippet write a synthetic example of each:

Start the job

The request is checked before any AWS call: the S3 locations, the hyperparameters and an instance type the base model fits. A data path without its trailing slash (.../train, which S3 would also match train-old/ against) or a base too large for the instance is refused here, with the reason, rather than minutes into a billed job.
get_training_plan() gives the plan the job would make for your table and instance type, without starting it: the models and the rows each trains on, the steps, the share of the table they read, the training hours, their dollars, and a warning for a share the steps leave unread or a max_training_hours that ends the training early. With patience set, its hours and dollars are a ceiling, since a model can stop sooner. For the example table:
It raises ValueError for a target_column or feature_columns entry the training table lacks, a validation table with other columns, a channel with no Parquet file or with a file of another extension, a file that cannot be read as Parquet, and a table too small for each model’s 1,000 rows. fine_tune() makes the same plan, logs its summary, returns it as the job’s training_plan and refuses the table before creating the job for the same reasons:
bag=2, n_steps_per_model=30 is a small run: the job takes 3 to 5 minutes when capacity is available. Every hyperparameter but the task settings (see Several tasks or a time series), with its default: An Algorithm version that trains each model for a fixed number of steps reads none of row_partition_strategy, n_passes_per_row, max_training_hours and validation_every_n_steps: on that version fine_tune() refuses a request that sets one, or that sets patience=None, naming each. Otherwise it trains each model for n_steps_per_model steps (100 by default) or 900 seconds, whichever ends first. For a large table, see Large tables.

Follow the job

get_training_curves() gives one row per model (child) and validated step: Validation error per validated step for each child of a fine-tuning job The job also appears under Training jobs in the SageMaker AI console: A completed fine-tuning job in the Training jobs list of the SageMaker AI console tuner.stop(job.job_name) stops a job. It still writes a model from the training done so far when any of it improved on the base, and ends Stopped with cut_short true in the report; deploy() accepts it. A job that reaches max_runtime_s also ends Stopped. The default is max_training_hours x 3,600 + 1,800 s (88,200 s with the default 24 hours), and 432,000 s when max_training_hours is None. At max_training_hours the job itself ends the training and still writes its model and report, so leave max_runtime_s to follow it: a request copied with new hyperparameters derives max_runtime_s from them, and a max_runtime_s you set is sent as it is. fine_tune() and get_training_plan() refuse one below max_training_hours x 3,600 + 1,800 s, except on the fixed-steps version of the Algorithm. To make a job resumable, give it checkpoint_uri, an S3 folder ending in /. The job saves each model it finishes there, and the progress of a model it is training every 15 minutes or 500 steps and when it stops. After a stop or a failure, tuner.resume(job) starts a new job with that job’s request under a new name, which trains only the models not saved in the folder, continuing a model from its last saved progress:
The resumed job keeps the job’s model_name. fine_tune() refuses a checkpoint_uri folder that holds any file, naming the job that wrote it: resume that job, give another checkpoint_uri, or pass fine_tune(request, overwrite=True), which deletes the folder’s checkpoint files and then creates the job. A folder resumes only on the Algorithm version that wrote it and with the same table and hyperparameters, and one job saves to a folder at a time. Use one folder per model, under nori/output/checkpoints/ so the least-privilege policies cover it. The folder holds at most about 0.4 GB per model for nori-6m (1.4 GB for nori-1-5, 6.1 GB for nori-100m); delete it once a job has completed.

Read the result

Lower is better: the distance from val_mse_before to val_mse_after is what fine-tuning gained on your table, so always read the two together. Both are mean squared errors in standardized target units, scored on the same rows. Without a validation channel those rows are held out of training (up to 4,096 rows, about 10 % of a smaller table); with one, they are the channel’s rows, which also steer the training, so val_mse_after runs a little optimistic there. The report also names n_val_rows, n_rows_used, cut_short, model_version, stop_reason (what ended the training), steps_per_pass (the steps the longest of the models’ passes takes), n_passes_per_row_completed, fraction_visited, rows_visited, gpus and failed_children. report.get_summary() gives these figures in a few lines, and wait() logs it when a job completes. A job whose models all fail ends Failed.

Access the fine-tuned model

The job writes model.tar.gz under output_path, at job.artifact_uri, with the model, its registry entry and training_report.json. The model holds what changed relative to the base, so you serve it through an endpoint, not on its own. It stays in your bucket until you delete it.
Never expire nori/output/ as a whole: the model package reads its model from there.
From another session, pick the job up by its name; deploy() takes the name directly:

Deploy and predict

Deploy

deploy() makes a model package from the job, a SageMaker model, an endpoint config and the endpoint, and returns once it is InService, in 4 to 6 minutes. Pass instance_type= for another endpoint type from the instance table. The endpoint appears under Endpoints in the console: A fine-tuned model's asynchronous endpoint InService in the SageMaker AI console
The endpoint bills every hour from creation until undeploy(), whether or not you send requests. Prices per instance type and region are on SageMaker AI pricing.

Predict

create_client() builds the same SynthefyNoriClient every Nori user has, in SageMaker mode, bound to this endpoint and the fine-tuned model’s name. The endpoint does not store your table, so every predict() sends context rows; 500 keeps the example small. Send the feature columns in training order, without the target. new.parquet holds rows the job never saw, so the comparison with truth is an honest one; the validation rows would flatter it, since they also steered the training. The endpoint serves only its own model and refuses a request naming another, even a valid ft- name.

Several models and endpoints

A job trains one model, and an endpoint serves the one model it was deployed from: a request naming another model is refused. For several models, run one job per model_name and deploy each:
Jobs run at the same time when your training quota allows it (see the quotas below). One model can sit behind several endpoints: pass a different endpoint_name to each deploy() call (the default is the model’s name). The model package is reused, each endpoint gets its own async output prefix under output_path, and each bills on its own. Separate endpoints isolate workloads, for example one per team or per environment. For throughput, add instances to one endpoint instead: each instance handles one request at a time and extra requests wait in the endpoint’s queue, so N instances answer N requests at once. deploy() creates the endpoint with one instance; raise the count from the SageMaker AI console (the endpoint’s configuration) or with aws sagemaker update-endpoint and a new endpoint config, within your endpoint quota.

Switch it off

undeploy() deletes the endpoint, its endpoint configs and the SageMaker model, and keeps the model package for a later deploy(). Expire nori/invocations/ and nori/output/ft-acme-churn-v1/async/ after at least a day.

When something goes wrong

Reference

Instance types and quotas

You need quota for one training instance and one endpoint instance. A job’s default type follows its base model: A job trains one model per GPU at a time: on a type with N GPUs the bag models train in ceil(bag / N) rounds, against bag rounds on one GPU, so the default bag=8 takes two rounds on a 4-GPU type and one on an 8-GPU type. A multi-GPU type finishes sooner but bills more per GPU-hour than the one-GPU types with the same GPU, so the same job costs more on it. The quotas are named like ml.g5.xlarge for training job usage and ml.g5.xlarge for endpoint usage. At 0 SageMaker refuses the create call (ResourceLimitExceeded) before anything bills, and the client raises FineTuningError naming the quota. The same quotas set how much runs at once: N jobs on ml.g5.xlarge need its training quota at N or more, and N endpoint instances of a type need its endpoint quota at N or more. New accounts often start at 0 for GPU types; request what you need in the Service Quotas console before the first job, since approval can take a few days. Check your quota:

Large tables: what a job reads and what it costs

A training step reads a number of rows set by the table’s width, and a model takes the steps that read its share of the table n_passes_per_row times (once by default), so a larger table takes more steps and more time. A model takes at least 100 steps, which read about 790,000 rows of a table of 20 numeric feature columns and about 220,000 of a table of 100. A model that patience (25 by default) or max_training_hours stops sooner reads less: the report’s steps_run gives the steps each model took and n_passes_per_row_completed how many times the models read their rows. One pass of one nori-6m model over 50,000,000 rows of 20 numeric feature columns (us-east-1 on-demand prices, 2026-10-27): The pass takes 6,293 steps of about 7,950 rows (about 2,210 at 100 columns). The hours count the steps, a validation score every 4 steps and a few minutes of reading and fitting. On N GPUs, N models make their passes at once for that price. The ml.g6e types are not measured; the report of a short job on one (its seconds_per_step) gives that type’s figure. nori-1-5, the default base, takes 6.0 s a step on the same table, measured with four models on ml.g5.12xlarge; on the ml.g6 and ml.g6e types its plan gives the steps and rows per step and no hours or dollars. The default job (bag 8, "shard") splits the table among its eight models, and each reads its eighth once, so on a type with N GPUs it takes about ceil(8 / N) / 8 of the hours and dollars in the table: up to about 5.3 h and $7.4 on `ml.g5.xlarge` and 1.3 h and $9.3 on ml.g5.12xlarge, plus the few minutes of reading and fitting, and less when patience stops a model sooner. bag=2 makes two passes over halves: about the same hours and dollars on a one-GPU type, half of them on a 4-GPU or 8-GPU type. The hours and dollars grow with n_passes_per_row. get_training_plan() gives the figures for your table and type. max_training_hours (24 by default, at most 119.5) caps the job from its start, the read of the table included: each model stops at it, and a model not started by then does not train (the report lists it in unstarted_children). For a table whose pass takes longer, raise it or set it to None; max_runtime_s follows it unless you set it. Every instance type the job runs on has enough memory and disk for any table within the row group limits, up to 10,000 feature columns; choose by time and price.

Several tasks or a time series

One fine-tuned model can learn several regression tasks at once, such as one per store, product or series. Nori reads each task from the context rows a prediction sends, so the fine-tuned model serves every task: predict a store by sending that store’s rows as context.
  • task_column names each row’s task in one table (numbers or text). It is not a feature.
  • tasks, a list of TaskTable in place of target_column, gives tables in different files or folders of the training data their own target, and each may set its own feature_columns, task_column and time_column.
  • time_column names a timestamp, date or integer column and makes each task of its table a time series: every training step predicts the query_rows rows right after context_rows rows of history, as a forecast does.
Any of tasks, task_column, time_column, context_rows or query_rows makes a job of tasks. It reads its tables into memory whole: at most 1,000,000 rows together, fewer above 100 features. For a larger table of one task, leave all five unset. The tasks need at least 1,000 training rows together, and each task at least 32 rows besides its held-out rows (a tabular task 48 with bag 2 and 64 with bag 8). A task whose target never changes is refused. A job of tasks has no plan before the job (get_training_plan() checks the tables, then raises ValueError) and refuses checkpoint_uri. The report’s tasks lists each task’s table, rows and MSE before and after. Only a newer version of the Algorithm reads these settings; an earlier one refuses them.

Least-privilege IAM policies

For production, replace AmazonSageMakerFullAccess with two policies that grant each identity only what it uses. With them the bucket can have any name. The execution role’s policy, saved as execution-policy.json with BUCKET, REGION, ACCOUNT_ID and ALGORITHM_ARN replaced, lets:
  • the job read nori/data/, write nori/output/ and delete what it saves under nori/output/checkpoints/
  • the endpoint read nori/invocations/ and write under nori/output/
  • SageMaker describe the Algorithm and your model package as this role
The model package is named after the job, nori-ft-... unless you set job_name; if you set it, use its prefix in this policy.
execution-policy.json
Put it on the role in place of the managed policy:
The identity that runs your code needs the policy below, saved as caller-policy.json with BUCKET, REGION and ACCOUNT_ID replaced. s3:ListBucket makes a missing object read as not found, which the client relies on while it waits for a result, and lets fine_tune() check a one-object channel and list the checkpoint_uri folder; s3:GetObject reads the folder’s records, and s3:DeleteObject lets fine_tune(request, overwrite=True) empty it. sagemaker:ListTrainingJobs lets fine_tune() with a checkpoint_uri, and resume(), find a job that still saves to the folder; both refuse without it. With kms_key_id, the key’s policy must let both identities use it.
caller-policy.json
For a role:

Alarms

An EventBridge rule on SageMaker’s training job state changes can email you when a job ends Failed or Stopped, and CloudWatch alarms on InvocationFailures and ApproximateAgeOfOldestRequest watch an endpoint you keep running. The client’s README has the commands, under Alarms.

Next steps

Inference on Amazon SageMaker

Serve the released Nori models from one SageMaker endpoint, without fine-tuning.

Python Client

DataFrames, categorical encoding, retries, and distribution outputs.