Skip to main content

MARS: a tensor-based unified framework for large-scale data computation.

Project description

PyPI version Docs Build Coverage Quality License

Mars is a tensor-based unified framework for large-scale data computation. Documentation.

Installation

Mars is easy to install by

pip install pymars

The distributed version can be installed by

pip install 'pymars[distributed]'

For now, distributed version is only available on Linux and Mac OS.

Mars tensor

Mars tensor provides a familiar interface like Numpy.

Numpy

Mars tensor

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

The following is a brief overview of supported subset of Numpy interface.

  • Arithmetic and mathematics: +, -, *, /, exp, log, etc.

  • Reduction along axes (sum, max, argmax, etc).

  • Most of the array creation routines (empty, ones_like, diag, etc). What’s more, Mars does not only support create array/tensor on GPU, but also support create sparse tensor.

  • Most of the array manipulation routines (reshape, rollaxis, concatenate, etc.)

  • Basic indexing (indexing by ints, slices, newaxes, and Ellipsis)

  • Fancy indexing along 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.).

However, Mars has not implemented entire Numpy interface, either the time limitation or difficulty is the main handicap. Any contribution from community is sincerely welcomed. The main feature not implemented are listed below:

  • Tensor with unknown shape does not support all operations.

  • Only small subset of np.linalg are implemented.

  • Operations like sort which is hard to execute in parallel are not implemented.

  • Mars tensor doesn’t implement interface like tolist and nditer etc, because the iteration or loops over a large tensor is very inefficient.

Easy to scale in and scale out

Mars can scale in to a single machine, and scale out to a cluster with thousands of machines. Both the local and distributed version share the same piece of code, it’s fairly simple to migrate from a single machine to a cluster due to the increase of data.

Running on a single machine including thread-based scheduling, local cluster scheduling which bundles the whole distributed components. Mars is also easy to scale out to a cluster by starting different components of mars distributed runtime on different machines in the cluster.

Threaded

execute method will by default run on the thread-based scheduler on a single machine.

import mars.tensor as mt

a = mt.ones((10, 10))
a.execute()

Users can create a session explicitly.

from mars.session import new_session

session = new_session()
session.run(a + 1)
(a * 2).execute(session=session)

# session will be released when out of with statement
with new_session() as session2:
    session2.run(a / 3)

Local cluster

Users can start the local cluster bundled with the distributed runtime on a single machine. Local cluster mode requires mars distributed version.

from mars.deploy.local import new_cluster

# cluster will create a session and set it as default
cluster = new_cluster()

# run on the local cluster
(a + 1).execute()

# create a session explicitly by specifying the cluster's endpoint
session = new_session(cluster.endpoint)
session.run(a * 3)

Distributed

After installing the distributed version on every node in the cluster, A node can be selected as scheduler and another as web service, leaving other nodes as workers. The scheduler can be started with the following command:

mars-scheduler -a <scheduler_ip> -p <scheduler_port>

Web service can be started with the following command:

mars-web -a <web_ip> -s <scheduler_endpoint> --ui-port <ui_port_exposed_to_user>

Workers can be started with the following command:

mars-worker -a <worker_ip> -p <worker_port> -s <scheduler_endpoint>

After all mars processes are started, users can run

sess = new_session('http://<web_ip>:<ui_port>')
a = mt.ones((2000, 2000), chunk_size=200)
b = mt.inner(a, a)
sess.run(b)

Getting involved

Thank you in advance for your contributions!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymars-0.1.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pymars-0.1.2-cp37-cp37m-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.7mWindows x86-64

pymars-0.1.2-cp37-cp37m-manylinux1_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.7m

pymars-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

pymars-0.1.2-cp36-cp36m-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.6mWindows x86-64

pymars-0.1.2-cp36-cp36m-manylinux1_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.6m

pymars-0.1.2-cp36-cp36m-macosx_10_7_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.7+ x86-64macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

pymars-0.1.2-cp35-cp35m-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.5mWindows x86-64

pymars-0.1.2-cp35-cp35m-manylinux1_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.5m

pymars-0.1.2-cp35-cp35m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ x86-64macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

pymars-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl (6.6 MB view details)

Uploaded CPython 2.7mu

pymars-0.1.2-cp27-cp27m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ x86-64macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file pymars-0.1.2.tar.gz.

File metadata

  • Download URL: pymars-0.1.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pymars-0.1.2.tar.gz
Algorithm Hash digest
SHA256 48cfe07ec2f87ea87ed730f41927182d05f94eccb3d89d9cf3edc5e6a32f9a12
MD5 29be4e30cd330c558c3a54d47c567321
BLAKE2b-256 c561c5ebf63ff1a169553ad19b499cfa0f0029435de05ac7aee55230f99da272

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pymars-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8c2b1a9a64e175e289b957bb1bc94fb44c5b0800288b4bf161be1527b915486e
MD5 0c0083f920fb72d2346fc9e4767025e5
BLAKE2b-256 f08a9f0395ff6f66093b3b1ec4d4ac89be39bc95ab0c41c95b15ced3a800d30f

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pymars-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8ec70e6e23397fbf8219810943a72d4b6f1c86a7e1a8d589b7b8eded4416baef
MD5 5a91fe3fb994ededc0b6889eeccfa67f
BLAKE2b-256 26c02e1c36207deddcd7fd6ddc1e8e0e2ca11af3f61f15fa493e0fe5d55cb12c

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pymars-0.1.2-cp37-cp37m-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 24da15d6d5b8519100869b6f60a1acec0b8cb07adf5ca42d1da812d74dc19576
MD5 dc428c0318c5b96ba83fe835d6054985
BLAKE2b-256 76f48a858390c67076bbc4ed51af45d55a47d650e5eada26e7d96fa5ef4aeb30

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pymars-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 ee4aeaba1741f55efc5566e304aeda28e50b2e2f67f1cd5750c7eac7f293939e
MD5 99671c9f3400cfa79ccab02ecca95f8f
BLAKE2b-256 242b36d1d8e47c091da193ea7ae7116dde12cfb0e82521350ce945d9ccc8706e

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for pymars-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 104eb83eb1cb9223a7699c96868fab84dd256cd829c8fc5d168e5cbbfdf61a0b
MD5 83e4499c7ab3b0f80904f49393816f8b
BLAKE2b-256 ebf36260c51610f433317c8aeab92e723f50725bf8c3d2b5a7905fafabab52ab

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp36-cp36m-macosx_10_7_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pymars-0.1.2-cp36-cp36m-macosx_10_7_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 1d61d56ede464c8716290e674612e6e20869352acac98db63679f49902a55859
MD5 0b92a7465be5ddad16f503085e0dbf7e
BLAKE2b-256 d81487a7fa378b419824b09c38388036c34f57166a7d34fdf6f906f9c6eb2a80

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.4

File hashes

Hashes for pymars-0.1.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 0991d08cd6901fa4c6907cb710837fc1db2433f5de14deb968877d431d0a90a1
MD5 8154ed639193fa6f0d0d4e63287755d4
BLAKE2b-256 9f1fe9d82da04dbcc95dda312e54842b54d5d36a811aec34ac6f98dd375b74f5

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for pymars-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 10fa1054dd4afb70f23534efdcfc155aa1801a4ca250483749de8a22d0d9e4e5
MD5 feb55650107781d14a496fbc350d9fe8
BLAKE2b-256 96d0b4fa9399cbd30fc5913fb2736b495112389949e283dce2fc752fb9a4cf09

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp35-cp35m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pymars-0.1.2-cp35-cp35m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 82cfa509f5930405fbd68f0c23da447d743497466486f3903cd3fc81a152e225
MD5 77a6172b2f93cd82ddf0dd509c000b35
BLAKE2b-256 4b4a7a6ba549dceacd37e5ea725e9a7523a3405eea936bc7f05565bdf305c541

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: pymars-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 6.6 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for pymars-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c0854f771a6da139755ed16557cfbc830e292e13d556351f71b7b7063011edd
MD5 3746bc415c7fb2e8d35b4e8fbff40e77
BLAKE2b-256 9b25f30181755af6affac9dbec132cd077419cf91359c9af72ed2904c032b671

See more details on using hashes here.

File details

Details for the file pymars-0.1.2-cp27-cp27m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for pymars-0.1.2-cp27-cp27m-macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 7ac5e1fbfe2e6f1d5e7999ea0defb2ee49c8659116285168380913dc9d1e14fc
MD5 6095e1a739e0d6fc91159a5827a2b257
BLAKE2b-256 5e908a917eba33ff39884488c751e06d57567e35c869884970cf9fb78498a9f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page