Data

Alibaba Cloud released Mars, a tensor-based framework for large-scale data computation

2 min read

A few days ago, Alibaba Cloud announced the release of Mars, its tensor-based framework for large-scale data computation. Mars tensor provides a familiar interface like Numpy, which is a popular tool for most of the Python users such as mathematicians, engineers, etc. and the ones working in core scientific computing. Mars can also scale into a single machine, and scale out to a cluster with hundreds of machines.

Users can simply install Mars tensor with the following code:

import mars.tensor as mta = mt.random.rand(1000, 2000)(a + 1).sum(axis=1).execute()

According to a Medium post by Synced, “Mars can simply tile a large tensor into small chunks and describe the inner computation with a directed graph, enabling the running of parallel computation on a wide range of distributed environments, from a single machine to a cluster comprising thousands of machines.”
Xuye Qin, Alibaba Cloud Senior Engineer, bragged about Mars’ performance by stating, “Mars can complete the computation on a 2.25T-size matrix and a 2.25T-size matrix multiplication in two hours.”

Unlike NumPy, Mars provides users with the ability to run matrix computation at a very large-scale. Alibaba developers carried out a simple experiment to test Mars’ performance. According to the graph below where NumPy (represented by a red cross at the upper left) lags far behind Mars tensors, which is successful in achieving ideal performance values.

Source: Medium

Mars supports a subset of NumPy interfaces, which include:

  • Arithmetic and mathematics: +, -, *, /, exp, log, etc.
  • Reduction along axes (sum, max, argmax, etc).
  • Most of the array creation routines (empty, ones_like, diag, etc). Mars not only supports create array/tensor on GPU, but also supports create sparse tensor.
  • Most of the array manipulation routines such as reshape, rollaxis, concatenate, etc.
  • Basic indexing (indexing by ints, slices, newaxes, and Ellipsis)
  • Fancy indexing along a single axis with lists or NumPy arrays, e.g. x[[1, 4, 8],:5]
  • Universal functions for elementwise operations.
  • Linear algebra functions including product (dot, matmul, etc.) and decomposition (cholesky, svd, etc.).

To know more about Mars in detail, visit its official GitHub page.

Read Next

NumPy drops Python 2 support. Now you need Python 3.5 or later

Google researchers introduce JAX: A TensorFlow-like framework for generating high-performance code from Python and NumPy machine learning programs

Introducing numpywren, system for linear algebra built on a serverless architecture

Savia Lobo

A Data science fanatic. Loves to be updated with the tech happenings around the globe. Loves singing and composing songs. Believes in putting the art in smart.

Share
Published by
Savia Lobo

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago