Customer Stories / financial-services / Ghana

2024

Mazzuma Reduces Training Time from 23 Hours to 30 Minutes Using DeepSpeed ZeRO on Amazon SageMaker

Mazzuma builds blockchain infrastructure tools to help developers in emerging markets deliver high-quality payment services. Its app, MazzumaGPT, which is powered by generative artificial intelligence, helps developers generate code in minutes.

35

models trained in 6 months

30-minute

model training reduced from 23 hours

40%

reduction in latency

800

tokens processed per second

Overview

Mazzuma, a Ghana-based startup, is working to provide greater access to artificial intelligence (AI) and blockchain technology. “We want to use our generative AI project to democratize AI—giving access to people who do not have the kind of expertise or research background to build language models at scale,” says Nii Osae, cofounder and director of software engineering at Mazzuma.

The company built a generative AI app, MazzumaGPT, using Amazon Web Services (AWS) and Amazon SageMaker—a service to build, train, and deploy machine learning (ML) models for virtually any use case with fully managed infrastructure, tools, and workflows. By using AWS, Mazzuma created this tool in months at low cost, and MazzumaGPT is now serving developers in 85 countries around the world.

Making AI Tools Accessible Using Amazon SageMaker

Mazzuma’s vision is to build tools in the blockchain space so that developers in emerging markets can use the technology to build the next generation of finance applications. Mazzuma specializes in smart contracts, a blockchain-based technology for automating digital agreements. The company has customers in finance, insurance, and utility management that use MazzumaGPT to generate smart contract code to jump-start their applications.
When Mazzuma began creating MazzumaGPT, it needed infrastructure that would provide the scalability and performance needed to train its models. “We needed an all-encompassing environment for our training, evaluation, model registry, and inference endpoints,” says Osae. “Amazon SageMaker is a comprehensive solution that offers all the services and tools that we needed in a holistic manner.”
Mazzuma used Amazon SageMaker to train, test, fine-tune, and deploy its ML models in 6 months. The company worked alongside AWS solutions architects and benefited from the AWS credits that were offered through the AWS Activate program for startups. “AWS does a stellar job with cost optimization,” says Kofi Genfi, cofounder and director of business strategy at Mazzuma. “Building these kinds of tools is expensive, but AWS has made this technology accessible and as affordable as possible so that developers from all over the world can access it.”

kr_quotemark

"Amazon SageMaker is a comprehensive solution that offers all the services and tools that we needed in a holistic manner."

Nii Osae,
Cofounder and Director of Software Engineering, Mazzuma

Facilitating Large-Scale Model Training Using Amazon EFS

To begin training, Mazzuma used Amazon SageMaker JumpStart, an ML hub with foundation models, built-in algorithms, and prebuilt ML solutions that users can deploy with a few clicks. “If you are coming in fresh and want to use a foundation model for training, that is available for you in Amazon SageMaker JumpStart,” says Osae.
Another feature that Mazzuma benefited from was deep learning containers. When launching an Amazon SageMaker instance, it already includes a container with ML frameworks and dependencies such as PyTorch and TensorFlow. “AWS provides all these resources from the get-go,” says Osae. “This is a game changer. It made the bootstrapping and scaffolding process of our project seamless.”
Mazzuma used a large language model with 15 billion parameters and more than 600 GB of model data as the basis for its training. To store and transfer model data into Amazon SageMaker—at speeds of 1.5 Gbps—the company used Amazon Elastic File System(Amazon EFS), a serverless, fully elastic file storage service. During the 6-month period of the project, the company trained more than 35 models and stored over 2 TB of data in Amazon EFS. “Using Amazon EFS, we could scale out and do high-quality experiments,” says Osae.
Mazzuma also used Amazon SageMaker Studio, a single web-based interface for complete ML development, to set up three separate spaces to test different model modalities. After training, the company creates inference endpoints using Amazon SageMaker Serverless Inference, a purpose-built inference option to deploy and scale ML models without configuring or managing the underlying infrastructure. When Mazzuma implemented Serverless Inference, it saw a 40 percent latency drop. The inference engine processes 800 tokens per second, and the solution handles 10–12 requests per second depending on traffic. Mazzuma observes these metrics using Amazon CloudWatch, a solution to observe and monitor resources and applications.
The fine-tuning of Mazzuma’s models sped up when the company began using the open-source tool DeepSpeed Zero Redundancy Optimizer (DeepSpeed ZeRO). “When we started using DeepSpeed ZeRO on AWS, we sped up our model training from 23 to 24 hours to under 30 minutes,” says Osae. “Implementing the tool in other environments can be cumbersome, but on AWS, the deep learning containers have the appropriate libraries that support the DeepSpeed ZeRO framework to accelerate training of large models.”
For other startups, Osae recommends taking advantage of AWS Cost Explorer, a tool to visualize, understand, and manage AWS costs and use. “Many startups overengineer their solutions, but by using cost optimization tools on AWS, you can determine the valuable instances or tools that you need to build your project out from a minimum viable product,” says Osae.

Making Blockchain Technology Accessible with MazzumaGPT

Developers around the world now use MazzumaGPT to generate code. In October 2023, Mazzuma cohosted a hackathon in collaboration with Ethereum. At that event, one team built a blockchain-based system to track utilities and reward people who pay bills on time. Another group used MazzumaGPT to create a tool that uses smart contracts to monitor personal savings.
“We are really excited that MazzumaGPT can help a lot of developers jump-start their programs, especially in emerging markets,” says Genfi. “We’re looking forward to seeing the interesting projects that the community will create using these tools, and we hope that creators will use MazzumaGPT to build the next generation of applications.”

About Company

Mazzuma, an African startup, is empowering developers to create code more efficiently by creating a generative AI tool, MazzumaGPT, on AWS using Amazon SageMaker.

AWS Services Used

Amazon SageMaker

Build, train, and deploy machine learning (ML) models for any use case with fully managed infrastructure, tools, and workflows

Learn more »

Amazon Elastic File System (Amazon EFS)

Serverless, fully elastic file storage

Learn more »

Amazon SageMaker Studio

A single web-based interface for end-to-end ML development

Learn more »

Amazon SageMaker JumpStart

Machine learning (ML) hub with foundation models, built-in algorithms, and prebuilt ML solutions that you can deploy with just a few clicks

Learn more »

AWS Customer Success Stories

Organizations of all sizes use AWS to increase agility, lower costs, and accelerate innovation in the cloud.

Get Started

Organizations of all sizes across all industries are transforming their businesses and delivering on their missions every day using AWS. Contact our experts and start your own AWS journey today.