Git Product home page Git Product logo

matxscript-2's Introduction

MatxScript

Documentation | 文档 | Contributors | Release Notes

MatxScript is an ahead of time compiler for a subset of the Python language.

Installation

pip install matxscript

A Quick Example

import matx
import timeit

def fib(n: int) -> int:
    if n <= 1:
        return n
    else:
        return fib(n - 1) + fib(n - 2)


if __name__ == '__main__':
    fib_script = matx.script(fib)
    
    # test on Macbook with m1 chip
    print(f'Python execution time: {timeit.timeit(lambda: fib(30), number=10)}s')  # 1.59s
    print(f'Matx execution time: {timeit.timeit(lambda: fib_script(30), number=10)}s') # 0.03s

License

© Bytedance Inc. Licensed under an Apache-2.0 license.

Contribute to MatxScript

Everyone is welcomed to contribute. We value all forms of contributions, including, but not limited to:

  • Code reviewing of the existing patches.
  • Documentation and usage examples
  • Community participation in issues.
  • Code readability and developer guide
    • We welcome contributions that add code comments to improve readability
    • We also welcome contributions to docs to explain the design choices of the internal.
  • Test cases to make the codebase more robust
  • Tutorials, blog posts, talks that promote the project.

Acknowledgement

We learned a lot from the following projects when building MatxScript.

  • TVM: Part of MatxScript's IR and Runtime originates from TVM. We also learned and adapted some part of codegen pipeline from TVM.

  • Python: Part of the runtime code comes from cpython for align the semantics

  • Folly: We adopted the idea of FBString to design our runtime::string_core

  • abseil-cpp: The string_view structure and ByteHash algorithm originates from abseil

  • rapidjson: The json module is implemented based on rapidjson

  • CV-CUDA: The vision CUDA runtime is developed using the operators provided by CV-CUDA.

matxscript-2's People

Contributors

cloud-mxd avatar jc-bytedance avatar vermouth1992 avatar firebrother avatar lly-devbd avatar shanesyy-1992 avatar eric-haibin-lin avatar bhshu avatar kongroo avatar houqi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.