SAS Viya is fast. Earlier this year, an independent group analyzed and reviewed the speed at which SAS Viya could load and pre-process data, train and score models, and calculate accuracy. They found that on average, SAS Viya was 30 times faster than all other solutions in the study. And it makes sense that SAS Viya is so fast. SAS has been in the analytics game for almost 50 years staffed by the best statistical programmers and computer scientists who can optimize not only the engine running the code but also the code itself.
In my tests, I have seen SAS Viya score 10 million records of data using a SAS model in about 2 minutes. But what about a real challenge? How fast can SAS Viya run non-SAS code in a non-SAS engine? The SAS Model Manager team was challenged to run Python models faster. At minimum, the team was tasked with scoring 10 million records using a Python model in 45 minutes. I am happy to report that the SAS Model Manager team not only met that challenge but exceeded it! After optimizing our Python base container, SAS Model Manager can deploy Python models into a container in 2-3 minutes. Once the container is built and running, the team’s benchmarks show that a single container can score 10 million records of data in under 3 minutes. That is over 15 times faster than our goal. Additionally, that means we are scoring 60,000 rows per second!
SAS Model Manager is the ModelOps solution for registering, managing, comparing, testing, monitoring, and deploying models on SAS Viya. SAS Model Manager can build and deploy containers for SAS, Python, and R models using a technology called SAS Container Runtime. SAS Container Runtime allows models to run in any OCI-compliant system using a lightweight and scalable container that manages the dependencies required by that model. These containers are executed outside of SAS Viya without needed to pay any additional fees to SAS.
To leverage the faster scoring of Python models inside a container, you will need SAS Viya 2023.09 or later. Next, you will need to:
docker run -p <port-number>:8080 <container-name>
# Specifiy URL
url='http://localhost:<port-number>/<model-name>'
# Make POST request with data
response = requests.post(
url=url,
headers={"Content-Type": "application/json"},
data=json.dumps(data.to_json())
)
# View results
new_container_results = pd.DataFrame(response.json()["data"])
pprint.pprint(response.json()["metadata"])
pprint.pprint(new_container_results)
The following demo shows the container in action:
Want to learn more? Check out these resources!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.