MATLAB’s Journey to Parallel Computing

By Michael Feldman

November 15, 2007

Propelled by its flagship MATLAB product, The MathWorks is one of the most important suppliers of software tools for the technical computing community. The MATLAB (MATrix LABoratory) language has become the preeminent interactive programming environment for scientists and engineers. Over a million customers are using it to develop technical computing applications around the world.

Recently, we got the opportunity to speak with The MathWorks co-founder and chief scientist Cleve Moler about the evolution of MATLAB and about how the language grew to include parallel programming support. The history of the MATLAB product spans over two decades.

In the early 1980s, Jack Little defined the business plan for the company, to be known as The MathWorks, while Moler was the brains behind MATLAB. Both Moler and Little, along with Steve Banger, developed the initial commercial product, MATLAB 1.0, which was launched in 1984, the same year The MathWorks was founded. Moler modestly refers to Little as the “heart and soul of the company,” but it is MATLAB that has become the company’s icon.

“I wrote MATLAB years ago, so I wouldn’t have to go down to the computer center after dinner to pick up my output,” said Moler. “It was important that MATLAB be interactive. That was more important to me than it was for it to be fast. I was worried about my time, not the computer’s time.”

But in the world of high performance technical computing, fast execution is also a big priority. When you start running applications that take weeks to complete on your PC, interactivity doesn’t mean much. These users want to tap parallel computing and still have an interactive workflow for even their largest data sets.

Although MATLAB started out as a single-threaded, shared memory programming language for the PC, even in those early days people were experimenting with it as a platform for parallel computing. In the 1980s, a few engineers were starting to use the INMOS transputer as a math accelerator. Moler said a South African company wrote a set of library functions for the transputer, and these became add-ons to MATLAB. In the late 80s, Moler himself played around with MATLAB on the Intel HyperCube, an early implementation of a parallel computer. But in these cases, MATLAB was used as the front-end for the parallel computations on the parallel computer. The language environment did not run natively on these architectures.

For the next decade, that became a recurring theme that stood in the way of extending MATLAB into parallel computing. In 1995, Moler wrote “Why There Isn’t a Parallel MATLAB,” in which he described the three major obstacles at the time: the memory model, granularity, and the business situation.

The conflict between MATLAB’s global memory model and the distributed model of most parallel systems meant that the large data matrices had to be sent back and forth between the host and the parallel computer. “It took far longer to distribute the data than it did to do the computation,” wrote Moler at the time. “Any matrix that would fit into memory on the host was too small to make effective use of the parallel computer itself.”

And on the shared memory machines of that era, it would have been difficult to implement the kind of multithreaded parallelism that would have made the design changes in the product worthwhile.

The other major problem was that early parallel computers were not built to be user-friendly. In the 1980s and 1990s, mainstream computing was still relying on Moore’s law to drive performance increases with single-core, single processor systems. The multiprocessor systems of the day were the mainframes and supercomputers, and as Moler noted, the people who owned these system didn’t buy any software; they developed it themselves. In most cases, these machines did not offer interactivity, which negates one of the main features of MATLAB.

That was more or less the case up until several years ago when cluster computers entered the mainstream. These clusters could be purchased by much smaller organizations — engineering firms, chemistry labs, finance services departments and other groups who could benefit from the collective computational power. In anticipation of this, Moler said he began working on a parallel version of MATLAB about five years ago.

“We could see that there was a potential business there,” said Moler. “And MATLAB had evolved to the point where it wasn’t just a matrix laboratory anymore. It was doing a lot of other things, so there was a possibility of doing more coarse-grained parallelism, which would be appropriate for distributed memory.”

This was before processors moved to multicore architectures. The first clusters were being built with single-core processors, but the simple multiplication of computing resources was still a revolution. MATLAB’s initial implementation of parallel computing defined a way for developers to explicitly specify distributed objects and computations. Two constructs were added: PARFOR (parallel for loops) and distributed arrays (large matrices distributed across separate memories). This is the basis for the Distributed Computing Toolbox, which was launched in 2004. The implementation has MATLAB running on multiple nodes of a cluster, with MPI under the hood.
 
The popularity of commodity clusters and the interactive computing experience is also what attracted Alan Edelman, chief science officer at Interactive Supercomputing (ISC), to use MATLAB as the basis for his company’s parallel computing platform, Star-P. But ISC did what The MathWorks didn’t want to do — provide a server-client model for high performance computing with MATLAB only on the client side. ISC has since expanded to support both the R and Python environments. But in all cases, the back-end acceleration on the HPC servers is performed by ISC software.

Moler, who has known Edelman since he was a grad student, said people are often confused by the distinction between the parallel computing products offered by the two companies. He says ISC didn’t change MATLAB, they just used it as a front-end. In The MathWorks’ implementation of distributed computing, MATLAB runs natively on the cluster nodes. “That’s harder, and that’s why it’s taken us longer,” Moler pointed out. “[ISC] is not a parallel MATLAB, they’re a conventional MATLAB attached to a parallel computer.”

One of the big challenges for MATLAB is how to leave peacefully with the job scheduler in the cluster. Most schedulers batch jobs under some sort of priority scheme. Under this model, user interactivity is a hit or miss proposition. Some systems offer dedicated time if you limit your request of resources — say 10 minutes and 8 processors. Otherwise, your job ends up in a batch queue. Depending upon how many other users there are, the results may or may not arrive quickly. A general solution may require more intimate integration between MATLAB and the job schedulers.

When the Distributed Computing Toolbox was envisioned, Moler was focused on cluster computing. But by the time the distributed product was launched in 2004, the dual-core Opteron was only year away. In the past few years, multicore processors have become the de facto processor architecture across almost every type of computer. But taking advantage of multiple cores requires a different approach, since it allows for shared memory multithreading, rather than just distributed memory multiprocessing. Expectations are different as well. Developers would like multicore to be supported transparently, at a level below the application software layer.

One way MATLAB does this is with implicit multithreading for matrix computation. But, according to Moler, the matrices have to be rather large before the multicore speedup is really effective. The product also uses multithreaded libraries that exploit multicore, such as ATLAS BLAS, and the Intel and AMD math libraries for matrix computations. But at this point, the matrix math components are just a portion of the entire product, Moler said.

“The question is how to do something more complicated that just matrices; and that’s difficult,” he admitted. Internally the engineers discussed adding multithreading constructs into the product. Some prototypes were built. But eventually they decided it was too complicated and didn’t really work well with the MATLAB model. Ultimately, they just weren’t convinced that explicit multithreading was the right way to go.

With accelerators like GPUs, the Cell processor, FPGAs and ClearSpeed boards coming on the scene, MATLAB users are starting to take advantage of the new parallel computing hardware. Thus far, the solutions have all involved library calls that can be invoked from MATLAB code. ClearSpeed and NVIDIA have demonstrated coprocessor acceleration from MATLAB code, and a number of people have experimented with mapping MATLAB code onto FPGAs. The limitation is that the code executed on the coprocessor needs to be substantial enough to make the overhead of sending the calculations off the host processor worthwhile.

From Moler’s point of view, native MATLAB support for exotic parallel processors will have to wait until a standard programming model and commodity hardware makes this practical. Conceivably this could happen within the next few years with the upcoming Intel Larrabee and AMD Fusion processors. These architectures promise to integrate CPU and GPU architectures and make general-purpose parallel computing available within a client. If one or both of these architectures become widely adopted, it is likely to encourage a native MATLAB implementation.

While Moler didn’t reveal any specific plans for these processors, there are a number of other developments on the drawing board. One of their projects is teaching their just-in-time compiler (JIT) to be multicore-aware. Currently the compiler only generates single-threaded code. Another area they’re looking at is enhancing the way the PARFOR and distributed arrays work. After a few years of experience with this model, there may be ways to make these structures work even better. Moler also said they’re looking at ways to parallelize the graphics capabilities of the product.

Like many software platform vendors, The MathWorks has come to the conclusion that parallel computing is their future, and the HPC community is a big part of that. It certainly wasn’t always the case. Moler said the company didn’t even come to the Supercomputing Conference until two years ago in Seattle at SC05, the year after the company introduced its Distributed Computing Toolbox. At that event, out of the 20 people from the company that attended, only Moler had been to the conference before. Last year at SC06 in Tampa, they had more people and a bigger booth, and this year at SC07 in Reno, they had their largest presence ever. With the technical computing community firmly entrenched in HPC, The MathWorks is likely to be a regular fixture at SC for some to come.

Subscribe to HPCwire's Weekly Update!

Be the most informed person in the room! Stay ahead of the tech trends with industry updates delivered to you every week!

Q&A with Nvidia’s Chief of DGX Systems on the DGX-GB200 Rack-scale System

March 27, 2024

Pictures of Nvidia's new flagship mega-server, the DGX GB200, on the GTC show floor got favorable reactions on social media for the sheer amount of computing power it brings to artificial intelligence.  Nvidia's DGX Read more…

Call for Participation in Workshop on Potential NSF CISE Quantum Initiative

March 26, 2024

Editor’s Note: Next month there will be a workshop to discuss what a quantum initiative led by NSF’s Computer, Information Science and Engineering (CISE) directorate could entail. The details are posted below in a Ca Read more…

Waseda U. Researchers Reports New Quantum Algorithm for Speeding Optimization

March 25, 2024

Optimization problems cover a wide range of applications and are often cited as good candidates for quantum computing. However, the execution time for constrained combinatorial optimization applications on quantum device Read more…

NVLink: Faster Interconnects and Switches to Help Relieve Data Bottlenecks

March 25, 2024

Nvidia’s new Blackwell architecture may have stolen the show this week at the GPU Technology Conference in San Jose, California. But an emerging bottleneck at the network layer threatens to make bigger and brawnier pro Read more…

Who is David Blackwell?

March 22, 2024

During GTC24, co-founder and president of NVIDIA Jensen Huang unveiled the Blackwell GPU. This GPU itself is heavily optimized for AI work, boasting 192GB of HBM3E memory as well as the the ability to train 1 trillion pa Read more…

Nvidia Appoints Andy Grant as EMEA Director of Supercomputing, Higher Education, and AI

March 22, 2024

Nvidia recently appointed Andy Grant as Director, Supercomputing, Higher Education, and AI for Europe, the Middle East, and Africa (EMEA). With over 25 years of high-performance computing (HPC) experience, Grant brings a Read more…

Q&A with Nvidia’s Chief of DGX Systems on the DGX-GB200 Rack-scale System

March 27, 2024

Pictures of Nvidia's new flagship mega-server, the DGX GB200, on the GTC show floor got favorable reactions on social media for the sheer amount of computing po Read more…

NVLink: Faster Interconnects and Switches to Help Relieve Data Bottlenecks

March 25, 2024

Nvidia’s new Blackwell architecture may have stolen the show this week at the GPU Technology Conference in San Jose, California. But an emerging bottleneck at Read more…

Who is David Blackwell?

March 22, 2024

During GTC24, co-founder and president of NVIDIA Jensen Huang unveiled the Blackwell GPU. This GPU itself is heavily optimized for AI work, boasting 192GB of HB Read more…

Nvidia Looks to Accelerate GenAI Adoption with NIM

March 19, 2024

Today at the GPU Technology Conference, Nvidia launched a new offering aimed at helping customers quickly deploy their generative AI applications in a secure, s Read more…

The Generative AI Future Is Now, Nvidia’s Huang Says

March 19, 2024

We are in the early days of a transformative shift in how business gets done thanks to the advent of generative AI, according to Nvidia CEO and cofounder Jensen Read more…

Nvidia’s New Blackwell GPU Can Train AI Models with Trillions of Parameters

March 18, 2024

Nvidia's latest and fastest GPU, codenamed Blackwell, is here and will underpin the company's AI plans this year. The chip offers performance improvements from Read more…

Nvidia Showcases Quantum Cloud, Expanding Quantum Portfolio at GTC24

March 18, 2024

Nvidia’s barrage of quantum news at GTC24 this week includes new products, signature collaborations, and a new Nvidia Quantum Cloud for quantum developers. Wh Read more…

Houston We Have a Solution: Addressing the HPC and Tech Talent Gap

March 15, 2024

Generations of Houstonian teachers, counselors, and parents have either worked in the aerospace industry or know people who do - the prospect of entering the fi Read more…

Alibaba Shuts Down its Quantum Computing Effort

November 30, 2023

In case you missed it, China’s e-commerce giant Alibaba has shut down its quantum computing research effort. It’s not entirely clear what drove the change. Read more…

Nvidia H100: Are 550,000 GPUs Enough for This Year?

August 17, 2023

The GPU Squeeze continues to place a premium on Nvidia H100 GPUs. In a recent Financial Times article, Nvidia reports that it expects to ship 550,000 of its lat Read more…

Shutterstock 1285747942

AMD’s Horsepower-packed MI300X GPU Beats Nvidia’s Upcoming H200

December 7, 2023

AMD and Nvidia are locked in an AI performance battle – much like the gaming GPU performance clash the companies have waged for decades. AMD has claimed it Read more…

DoD Takes a Long View of Quantum Computing

December 19, 2023

Given the large sums tied to expensive weapon systems – think $100-million-plus per F-35 fighter – it’s easy to forget the U.S. Department of Defense is a Read more…

Synopsys Eats Ansys: Does HPC Get Indigestion?

February 8, 2024

Recently, it was announced that Synopsys is buying HPC tool developer Ansys. Started in Pittsburgh, Pa., in 1970 as Swanson Analysis Systems, Inc. (SASI) by John Swanson (and eventually renamed), Ansys serves the CAE (Computer Aided Engineering)/multiphysics engineering simulation market. Read more…

Choosing the Right GPU for LLM Inference and Training

December 11, 2023

Accelerating the training and inference processes of deep learning models is crucial for unleashing their true potential and NVIDIA GPUs have emerged as a game- Read more…

Intel’s Server and PC Chip Development Will Blur After 2025

January 15, 2024

Intel's dealing with much more than chip rivals breathing down its neck; it is simultaneously integrating a bevy of new technologies such as chiplets, artificia Read more…

Baidu Exits Quantum, Closely Following Alibaba’s Earlier Move

January 5, 2024

Reuters reported this week that Baidu, China’s giant e-commerce and services provider, is exiting the quantum computing development arena. Reuters reported � Read more…

Leading Solution Providers

Contributors

Comparing NVIDIA A100 and NVIDIA L40S: Which GPU is Ideal for AI and Graphics-Intensive Workloads?

October 30, 2023

With long lead times for the NVIDIA H100 and A100 GPUs, many organizations are looking at the new NVIDIA L40S GPU, which it’s a new GPU optimized for AI and g Read more…

Shutterstock 1179408610

Google Addresses the Mysteries of Its Hypercomputer 

December 28, 2023

When Google launched its Hypercomputer earlier this month (December 2023), the first reaction was, "Say what?" It turns out that the Hypercomputer is Google's t Read more…

AMD MI3000A

How AMD May Get Across the CUDA Moat

October 5, 2023

When discussing GenAI, the term "GPU" almost always enters the conversation and the topic often moves toward performance and access. Interestingly, the word "GPU" is assumed to mean "Nvidia" products. (As an aside, the popular Nvidia hardware used in GenAI are not technically... Read more…

Shutterstock 1606064203

Meta’s Zuckerberg Puts Its AI Future in the Hands of 600,000 GPUs

January 25, 2024

In under two minutes, Meta's CEO, Mark Zuckerberg, laid out the company's AI plans, which included a plan to build an artificial intelligence system with the eq Read more…

Google Introduces ‘Hypercomputer’ to Its AI Infrastructure

December 11, 2023

Google ran out of monikers to describe its new AI system released on December 7. Supercomputer perhaps wasn't an apt description, so it settled on Hypercomputer Read more…

China Is All In on a RISC-V Future

January 8, 2024

The state of RISC-V in China was discussed in a recent report released by the Jamestown Foundation, a Washington, D.C.-based think tank. The report, entitled "E Read more…

Intel Won’t Have a Xeon Max Chip with New Emerald Rapids CPU

December 14, 2023

As expected, Intel officially announced its 5th generation Xeon server chips codenamed Emerald Rapids at an event in New York City, where the focus was really o Read more…

IBM Quantum Summit: Two New QPUs, Upgraded Qiskit, 10-year Roadmap and More

December 4, 2023

IBM kicks off its annual Quantum Summit today and will announce a broad range of advances including its much-anticipated 1121-qubit Condor QPU, a smaller 133-qu Read more…

  • arrow
  • Click Here for More Headlines
  • arrow
HPCwire