Skip to content

Commit

Permalink
Merge branch 'master' into split_div
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasterer authored Nov 23, 2018
2 parents 7707d46 + 53ac89e commit 354916f
Show file tree
Hide file tree
Showing 74 changed files with 2,670 additions and 870 deletions.
73 changes: 44 additions & 29 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,53 @@ contribute to, and influence the direction of the project. We actively invite co

See the [community structure document](http://docs.tvm.ai/contribute/community.html) for the explanation of community structure and contribution guidelines.


## Committers
- [Tianqi Chen](https://github.com/tqchen) (PMC)
- [Thierry Moreau](http://homes.cs.washington.edu/~moreau/)
- [Ziheng Jiang](https://github.com/ZihengJiang)
- [Haichen Shen](http://homes.cs.washington.edu/~haichen/)
- [Yizhi Liu](https://github.com/yzhliu)

## Code Owners
- [Aditya Atluri](https://github.com/adityaatluri) ROCM
- [Leyuan Wang](https://github.com/Laurawly) TOPI
- [Yuwei Hu](https://github.com/Huyuwei) TOPI
- [Zhixun Tan](https://github.com/phisiart) OpenGL/WebGL backend
- [Nick Hynes](https://github.com/nhynes) SGX and secured computing
- [Lianmin Zheng](https://github.com/merrymercy) AutoTVM

We add tag along with committer name to show areas that they are familiar with.
We do encourage everyone to work anything they are interested in.

- [Aditya Atluri](https://github.com/adityaatluri): @adityaatluri - rocm
- [Tianqi Chen](https://github.com/tqchen) (PMC): @tqchen - topi, compiler, relay, docs
- [Yuwei Hu](https://github.com/Huyuwei): @Huyuwei - topi, frontends
- [Yizhi Liu](https://github.com/yzhliu) (PMC): @yzhliu - jvm, topi, relay
- [Ziheng Jiang](https://github.com/ZihengJiang) (PMC): @ZihengJiang - relay, compiler
- [Thierry Moreau](https://github.com/tmoreau89) (PMC): @tmoreau89 - vta
- [Haichen Shen](https://github.com/icemelon9) (PMC): @icemelon9 - relay, topi
- [Leyuan Wang](https://github.com/Laurawly): @Laurawly: - topi
- [Nick Hynes](https://github.com/nhynes): @nhynes: - sgx, rust
- [Lianmin Zheng](https://github.com/merrymercy): @merrymercy - autotvm, topi

## Reviewers
- [Zhi Chen](https://github.com/zhiics)
- [Xiaoqiang Dan](https://github.com/xqdan)
- [Liangfu Chen](https://github.com/liangfu)
- [Wuwei Lin](https://github.com/vinx13)
- [Masahiro Masuda](https://github.com/masahi)
- [Kazutaka Morita](https://github.com/kazum)
- [Tatsuya Nishiyama](https://github.com/nishi-t)
- [Pariksheet Pinjari](https://github.com/PariksheetPinjari909)
- [Jared Roesch](https://github.com/jroesch)
- [Siva](https://github.com/srkreddy1238)
- [Siju Samuel](https://github.com/siju-samuel)
- [Alex Weaver](https://github.com/alex-weaver)
- [Yao Wang](https://github.com/kevinthesun)
- [Jian Weng](https://github.com/were)
- [Eddie Yan](https://github.com/eqy)
- [Joshua Z. Zhang](https://github.com/zhreshold)

- [Aditya Atluri](https://github.com/adityaatluri): @adityaatluri
- [Tianqi Chen](https://github.com/tqchen): @tqchen
- [Liangfu Chen](https://github.com/liangfu): @liangfu
- [Zhi Chen](https://github.com/zhiics): @zhiics
- [Nick Hynes](https://github.com/nhynes): @nhynes
- [Yuwei Hu](https://github.com/Huyuwei): @Huyuwei
- [Yizhi Liu](https://github.com/yzhliu) : @yzhliu
- [Zhixun Tan](https://github.com/phisiart): @phisiart
- [Zhi Chen](https://github.com/zhiics): @zhiics
- [Xiaoqiang Dan](https://github.com/xqdan): @xqdan
- [Ziheng Jiang](https://github.com/ZihengJiang): @ZihengJiang
- [Wuwei Lin](https://github.com/vinx13): @vinx13
- [Masahiro Masuda](https://github.com/masahi): @masahi
- [Thierry Moreau](https://github.com/tmoreau89): @tmoreau89
- [Kazutaka Morita](https://github.com/kazum): @kazum
- [Tatsuya Nishiyama](https://github.com/nishi-t): @nishi-t
- [Pariksheet Pinjari](https://github.com/PariksheetPinjari909): @PariksheetPinjari909
- [Jared Roesch](https://github.com/jroesch): @jroesch
- [Siva](https://github.com/srkreddy1238): @srkreddy1238
- [Siju Samuel](https://github.com/siju-samuel): @siju-samuel
- [Haichen Shen](https://github.com/icemelon9): @icemelon9
- [Alex Weaver](https://github.com/alex-weaver): @alex-weaver
- [Yao Wang](https://github.com/kevinthesun): @kevinthesun
- [Leyuan Wang](https://github.com/Laurawly): @Laurawly
- [Jian Weng](https://github.com/were): @were
- [Eddie Yan](https://github.com/eqy): @eqy
- [Joshua Z. Zhang](https://github.com/zhreshold): @zhreshold
- [Lianmin Zheng](https://github.com/merrymercy): @merrymercy

## List of Contributors
- [Full List of Contributors](https://github.com/dmlc/tvm/graphs/contributors)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ Acknowledgement
---------------
We learnt a lot from the following projects when building TVM.
- [Halide](https://github.com/halide/Halide): TVM uses [HalideIR](https://github.com/dmlc/HalideIR) as data structure for
arithematic simplification and low level lowering. We also learnt and adapted some part of lowering pipeline from Halide.
arithmetic simplification and low level lowering. We also learnt and adapted some part of lowering pipeline from Halide.
- [Loopy](https://github.com/inducer/loopy): use of integer set analysis and its loop transformation primitives.
- [Theano](https://github.com/Theano/Theano): the design inspiration of symbolic scan operator for recurrence.
4 changes: 3 additions & 1 deletion apps/extension/python/tvm_ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
def load_lib():
"""Load library, the functions will be registered into TVM"""
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
lib = ctypes.CDLL(os.path.join(curr_path, "../../lib/libtvm_ext.so"))
# load in as global so the global extern symbol is visible to other dll.
lib = ctypes.CDLL(
os.path.join(curr_path, "../../lib/libtvm_ext.so"), ctypes.RTLD_GLOBAL)
return lib

_LIB = load_lib()
Expand Down
5 changes: 5 additions & 0 deletions apps/extension/src/tvm_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ TVM_REGISTER_GLOBAL("device_api.ext_dev")
});
} // namespace tvm_ext

// External function exposed to runtime.
extern "C" float TVMTestAddOne(float y) {
return y + 1;
}

// This callback approach allows extension allows tvm to extract
// This way can be helpful when we want to use a header only
// minimum version of TVM Runtime.
Expand Down
20 changes: 20 additions & 0 deletions apps/extension/tests/test_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,27 @@ def test_extract_ext():
assert fdict["mul"](3, 4) == 12


def test_extern_call():
n = 10
A = tvm.placeholder((n,), name='A')
B = tvm.compute((n,), lambda *i: tvm.call_extern("float32", "TVMTestAddOne", A(*i)), name='B')
s = tvm.create_schedule(B.op)

def check_llvm():
if not tvm.module.enabled("llvm"):
return
f = tvm.build(s, [A, B], "llvm")
ctx = tvm.cpu(0)
# launch the kernel.
a = tvm.nd.array(np.random.uniform(size=n).astype(A.dtype), ctx)
b = tvm.nd.array(np.zeros(n, dtype=B.dtype), ctx)
f(a, b)
tvm.testing.assert_allclose(b.asnumpy(), a.asnumpy() + 1)
check_llvm()


if __name__ == "__main__":
test_extern_call()
test_ext_dev()
test_ext_vec()
test_bind_add()
Expand Down
2 changes: 1 addition & 1 deletion apps/howto_deploy/cpp_deploy.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Copyright (c) 2017 by Contributors
* \brief Example code on load and run TVM module.s
* \file cpp_deploy_example.cc
* \file cpp_deploy.cc
*/
#include <cstdio>
#include <dlpack/dlpack.h>
Expand Down
53 changes: 16 additions & 37 deletions docs/contribute/community.rst
Original file line number Diff line number Diff line change
@@ -1,51 +1,30 @@
TVM Community Structure
TVM Community Guideline
=======================

TVM adopts the Apache style model and governs by merit. We believe that it is important to create an inclusive community where everyone can use, contribute to, and influence the direction of the project. We actively invite contributors who have earned the merit to be part of the development community. There are several roles in the community:
TVM adopts the Apache style model and governs by merit. We believe that it is important to create an inclusive community where everyone can use, contribute to, and influence the direction of the project. See `CONTRIBUTORS.md <https://github.com/dmlc/tvm/blob/master/CONTRIBUTORS.md>`_ for the current list of contributors.

- Project Management Committee(PMC) Small group of active committers that moderate the discussion, RFC, manage project releases.
- Committer Individual who has made substantial contributions to the project and is granted write access to the project and oversees the general direction of the projects.
- Code Owner Individual who is responsible for a specific area of the codebase.
- Reviewer Individual who is qualified to review for a specific area of the codebase.
- Contributor Anyone who contributes to the project.

This document explains responsibility and criteria for each role.
See `CONTRIBUTORS.md <https://github.com/dmlc/tvm/blob/master/CONTRIBUTORS.md>`_ for the current list of contributors and their roles.
General Development Process
---------------------------
Everyone in the community is welcomed to send patches, documents, and propose new directions to the project. The key guideline here is to enable everyone in the community to get involved and participate the decision and development. When major changes are proposed, an RFC should be sent to allow discussion by the community. We encourage public discussion, archivable channels such as issues, discuss forum and mailing-list, so that everyone in the community can participate and review the process later.

Code reviews are one of the key ways to ensure the quality of the code. High-quality code reviews prevent technical debt for long-term and are crucial to the success of the project. A pull request needs to be reviewed before it gets merged. A committer who has the expertise of the corresponding area would moderate the pull request and the merge the code when it is ready. The corresponding committer could request multiple reviewers who are familiar with the area of the code. We encourage contributors to request code reviews themselves and help review each other's code -- remember everyone is volunteering their time to the community, high-quality code review itself costs as much as the actual code contribution, you could get your code quickly reviewed if you do others the same favor.

Project Management Committee
----------------------------
The community should strive to reach a consensus on technical decisions through discussion. We expect committers and PMCs to moderate technical discussions in a diplomatic way, and provide suggestions with clear technical reasoning when necessary.

The PMC consists of a small group of active committers that moderate the discussion, provide mentorship to committers and code owners and manage the project release. PMC members need to actively manage the general project directions. Note that most major design choices and proposed changes should reach consensus among the committers.

Committer
---------

Committers are individuals who are granted the write access to the project. Committers oversee the general project directions and participate in the evaluation of the RFCs involving major design changes. Here is a list of useful things to do to help become a committer.

- Deep understanding of one or a few modules in the project.
- Good understanding of general project structure, demonstrated by discussion over RFCs, code reviews and proposals of new features
- Active history of code reviews that demonstrate a good technical ability
- Contribution history of high-quality documentation and tutorials to the promote project
- History of creating clean, maintainable code and including good test cases.

New committers are nominated by current committers from current code owners.

Code Owner
Committers
----------
Committers are individuals who are granted the write access to the project. A committer is usually responsible for a certain area or several areas of the code where they oversee the code review process. The area of contribution can take all forms, including code contributions and code reviews, documents, education, and outreach. Committers are essential for a high quality and healthy project. The community actively look for new committers from contributors. Here is a list of useful traits that help the community to recognize potential committers:

A code owner is an individual who is responsible for a specific area of the code-base. Code owners are responsible for the areas they are in charge of and oversee the code review process of the corresponding module. Changes to a specific area need to be approved by one of its owners in order to be merged. Once a pull request is approved by the designated code owner, the code can be directly merged into the repo. Code owners are essential for a high quality and healthy codebase.

We welcome new code owners that help to keep good code quality, testing, and documentation in specific areas. Here is a list of useful traits that help the community to recognize potential code owners:
- Sustained contribution to the project, demonstrated by discussion over RFCs, code reviews and proposals of new features, and other development activities. Being familiar with, and being able to take ownership on one or several areas of the project.
- Quality of contributions: High-quality, readable code contributions indicated by pull requests that can be merged without a substantial code review. History of creating clean, maintainable code and including good test cases. Informative code reviews to help other contributors that adhere to a good standard.
- Community involvement: active participation in the discussion forum, promote the projects via tutorials, talks and outreach. We encourage committers to collaborate broadly, e.g. do code reviews and discuss designs with community members that they do not interact physically.

- High-quality, readable code contributions indicated by pull requests that can be merged without a substantial code review
- Good coverage of tests and documentation in the contributions
- Informative code reviews to help other contributors that adhere to a good standard, spot problems in contributions etc.
- Active participation in the discussion forum
The Project Management Committee(PMC) consists group of active committers that moderate the discussion, manage the project release, and proposes new committer/PMC members. Potential candidates are usually proposed via an internal discussion among PMCs, followed by a consensus approval, i.e. least 3 +1 votes, and no vetoes. Any veto must be accompanied by reasoning. PMCs should serve the community by upholding the community practices and guidelines TVM a better community for everyone. PMCs should strive to identify new candidates outside of their own organization.

Reviewer
--------

A reviewer is an individual who actively contributed to the project and is willing to participate in the code review of new contributions. We invite reviewers from active contributors. The reviewer invitation will be sent to the potential reviewer’s email, so please log in to the discussion forum so that we can know which email address we could send an invitation to.
We actively seek reviews from reviewers. High-quality code reviews prevent technical debt for long-term and are crucial to the success of the project.
A pull request to the project has to be reviewed by a reviewer in order to be merged.
Reviewers
---------
Reviewers are individuals who actively contributed to the project and are willing to participate in the code review of new contributions. We identify reviewers from active contributors. The committers should explicitly solicit reviews from reviewers. High-quality code reviews prevent technical debt for long-term and are crucial to the success of the project. A pull request to the project has to be reviewed by at least one reviewer in order to be merged.
2 changes: 1 addition & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document contains frequently asked questions.

How to Install
--------------
See [Installation](http://tvm.ai/install/)
See [Installation](http://docs.tvm.ai/install/)

TVM's relation to Other IR/DSL Projects
---------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/langref/relay_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ This level support backpropagation of broadcast operators. It is temporary.

tvm.relay.broadcast_to_like
tvm.relay.collapse_sum_like
tvm.relay.slice_like


Level 1 Definitions
Expand Down Expand Up @@ -231,7 +232,6 @@ Level 4 Definitions
.. autofunction:: tvm.relay.strided_slice



Level 5 Definitions
-------------------
.. autofunction:: tvm.relay.image.resize
Expand All @@ -241,3 +241,4 @@ Level 10 Definitions
--------------------
.. autofunction:: tvm.relay.broadcast_to_like
.. autofunction:: tvm.relay.collapse_sum_like
.. autofunction:: tvm.relay.slice_like
2 changes: 1 addition & 1 deletion include/tvm/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Var : public HalideIR::VarExpr {


/*!
* \brief Container of constant ineteger (IntImm).
* \brief Container of constant integer (IntImm).
*
* This is used to store and automate type check
* attributes that must be constant integer.
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/relay/attrs/nn.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ struct BatchNormAttrs : public tvm::AttrsNode<BatchNormAttrs> {

/*! \brief Attributes for LRN operator */
struct LRNAttrs : public tvm::AttrsNode<LRNAttrs> {
IndexExpr size;
int size;
int axis;
double bias;
double alpha;
Expand Down
13 changes: 13 additions & 0 deletions include/tvm/relay/attrs/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ struct StridedSliceAttrs : public tvm::AttrsNode<StridedSliceAttrs> {
.describe("Stride values of the slice");
}
};


struct SliceLikeAttrs : public tvm::AttrsNode<SliceLikeAttrs> {
Array<Integer> axes;

TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs") {
TVM_ATTR_FIELD(axes)
.describe("List of axes on which input data will be sliced according to the "
"corresponding size of the second input. By default will slice "
"on all axes. Negative axes mean counting in reverse.");
}
};

} // namespace relay
} // namespace tvm
#endif // TVM_RELAY_ATTRS_TRANSFORM_H_
2 changes: 2 additions & 0 deletions include/tvm/relay/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,14 @@ inline const TTypeNode* ExprNode::type_as() const {
/*!
* \brief Print node as text format.
* \param node The node to be printed.
* \param show_meta_data Whether to print meta data section.
* \param annotate An optional callback function for attaching
* additional comment block to an expr.
* \return The text representation.
*/
std::string RelayPrint(
const NodeRef& node,
bool show_meta_data = true,
runtime::TypedPackedFunc<std::string(Expr)> annotate = nullptr);
} // namespace relay
} // namespace tvm
Expand Down
11 changes: 11 additions & 0 deletions nnvm/include/nnvm/compiler/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ inline tvm::Array<tvm::Expr> ShapeToArray(TShape shape) {
return result;
}

/*
* \brief Helper function to convert TShape to TVM array. Useful for
* passing data from NNVM param structures to TOPI ops.
*
* \param shape The shape to convert
*
* \return An Array of Expr, where each element is a constant int32
*/
inline tvm::Array<tvm::Integer> ShapeToIntArray(TShape shape) {
return tvm::Array<tvm::Integer>(ShapeToArray(shape).node_);
}
} // namespace compiler
} // namespace nnvm
#endif // NNVM_COMPILER_UTIL_H_
Loading

0 comments on commit 354916f

Please sign in to comment.