astore

check

Description

The `check` action, part of the 'Analytic Store Scoring' action set, validates an ONNX (Open Neural Network Exchange) model. This is a crucial preliminary step to ensure the model is well-formed, structurally sound, and compatible with SAS Viya before it is uploaded or used for scoring tasks. The action verifies the integrity of the ONNX file, confirming that it adheres to the standard format.

proc cas; astore.check / onnx=binary-large-object; run;
Settings
ParameterDescription
onnxSpecifies the binary large object (BLOB) that contains the ONNX model to be validated. This is typically a reference to a CAS table containing the model data.
Data Preparation View data prep sheet
Loading an ONNX Model into a CAS Table

To use the `check` action, the ONNX model must first be available in CAS as a binary large object. The following DATA step reads an ONNX file from a server-accessible path and loads its binary content into a CAS table. This table can then be referenced by the `check` action.

Copied!
1/* This example assumes the ONNX file is accessible from the CAS server */
2DATA casuser.onnx_model_blob (copies=0);
3 LENGTH onnx_model 8;
4 INFILE "/path/to/your/model.onnx" recfm=f lrecl=256;
5 INPUT onnx_model 8.;
6RUN;
7 
8PROC CAS;
9 TABLE.promote / name="onnx_model_blob" caslib="casuser";
10RUN;

Examples

This example demonstrates the fundamental use of the `check` action. It points to a CAS table containing the ONNX model's binary data to perform the validation.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3astore.check / onnx={TABLE={caslib='casuser', name='onnx_model_blob'}};
4 
5RUN;
6 
Result :
The action will execute and a success or failure status will be printed to the SAS log. A success note indicates the ONNX model is valid. If the model is invalid, an error message detailing the issue will be displayed.

This example shows how to execute the `check` action and store the outcome in a CASL variable named 'validationResult'. Printing this variable allows for programmatic inspection of the validation status. A successful check is a prerequisite for using the model with other actions like `score` or `upload`.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3astore.check RESULT=validationResult / onnx={TABLE={caslib='casuser', name='onnx_model_blob'}};
4PRINT validationResult;
5 
6RUN;
7 
Result :
The printed 'validationResult' object will contain a table. For a valid model, the table will indicate success. For an invalid model, it will contain detailed error messages specifying the inconsistencies or formatting issues found within the ONNX file, helping to diagnose the problem.

FAQ

What is the purpose of the astore.check action?
What are the parameters for the astore.check action?
How is the ONNX model provided to the astore.check action?
What is the syntax for using the astore.check action in CASL?