Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update upstream 20190628 #37

Merged
merged 22 commits into from
Jun 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3cf71fd
[AutoTVM] Fix a bug in simulated annealing (#3413)
merrymercy Jun 27, 2019
3c92fbf
Fix Windows build (#3429)
aksarben09 Jun 27, 2019
0aaa8a2
Undefined name: Typo in variable name sotrage_order --> storage_order…
cclauss Jun 27, 2019
847fce8
Add mod supoort in relay.build (#3424)
apivovarov Jun 27, 2019
69ce676
[VTA][TSIM] Verilator compile report error for printf (#3438)
huajsj Jun 27, 2019
2022f77
Use print() function in both Python 2 and Python 3 (#3440)
cclauss Jun 27, 2019
7cbcfd0
GraphTuner supports relay.module as input (#3434)
kevinthesun Jun 27, 2019
68326ea
[Relay][Frontend] Fix tensorflow frontend lstm forget bias adding ord…
ttyang1018 Jun 27, 2019
755c570
[Relay] Fix reduce axis bug (#3422)
altanh Jun 27, 2019
c320d06
[Relay][Parser] simplify build script, remove python 2 support (#3419)
MarisaKirisame Jun 28, 2019
7af7e30
Memory leak in the relay interpreter (#3448)
hlu1 Jun 28, 2019
d5641f6
fix deprecation warning (#3446)
MarisaKirisame Jun 28, 2019
7446172
[Relay] Register abs gradient: grad * (select(x < 0, -1, 1)) (#3447)
kaitingwang Jun 28, 2019
4bd867b
[RELAY] [OP] [MXNet Frontend] Add sequence_mask (#3437)
sxjscience Jun 28, 2019
5379923
Nested rfactor fix, update predicates as well as source. (#3382)
csarofeen Jun 28, 2019
d2f46bc
[Relay] Fix ad for conditional expression (#3453)
MarisaKirisame Jun 28, 2019
beadb14
[Relay] Feature Detection (#3238)
MarisaKirisame Jun 28, 2019
29c7da7
[VTA][Relay] Relay Compilation + AutoTVM compatible operator librarie…
tmoreau89 Jun 28, 2019
a2c66c5
[CI] Fix windows build, add azure pipeline (#3458)
tqchen Jun 28, 2019
28d9549
Migrate badge to new job (#3459)
tqchen Jun 28, 2019
e911751
Update README.md
tqchen Jun 28, 2019
30a5d73
Update dmlc_tvm_commit_id
Jun 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/HalideIR
Submodule HalideIR updated 1 files
+6 −4 src/tvm/node/node.h
16 changes: 12 additions & 4 deletions 3rdparty/compiler-rt/builtin_fp16.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ static inline DST_T __truncXfYf2__(SRC_T a) {
const DST_REP_T dstNaNCode = dstQNaN - 1;

// Break a into a sign and representation of the absolute value
const union { SRC_T f; SRC_REP_T i; } src_rep = {.f = a};
union SrcExchangeType { SRC_T f; SRC_REP_T i; };
SrcExchangeType src_rep;
src_rep.f = a;
const SRC_REP_T aRep = src_rep.i;
const SRC_REP_T aAbs = aRep & srcAbsMask;
const SRC_REP_T sign = aRep & srcSignMask;
Expand Down Expand Up @@ -134,7 +136,9 @@ static inline DST_T __truncXfYf2__(SRC_T a) {

// Apply the signbit to (DST_T)abs(a).
const DST_REP_T result = absResult | sign >> (srcBits - dstBits);
const union { DST_T f; DST_REP_T i; } dst_rep = {.i = result};
union DstExchangeType { DST_T f; DST_REP_T i; };
DstExchangeType dst_rep;
dst_rep.i = result;
return dst_rep.f;
}

Expand Down Expand Up @@ -163,7 +167,9 @@ static inline DST_T __extendXfYf2__(SRC_T a) {
const DST_REP_T dstMinNormal = DST_REP_T(1) << DST_SIG_BITS;

// Break a into a sign and representation of the absolute value
const union { SRC_T f; SRC_REP_T i; } src_rep = {.f = a};
union SrcExchangeType { SRC_T f; SRC_REP_T i; };
SrcExchangeType src_rep;
src_rep.f = a;
const SRC_REP_T aRep = src_rep.i;
const SRC_REP_T aAbs = aRep & srcAbsMask;
const SRC_REP_T sign = aRep & srcSignMask;
Expand Down Expand Up @@ -205,6 +211,8 @@ static inline DST_T __extendXfYf2__(SRC_T a) {

// Apply the signbit to (DST_T)abs(a).
const DST_REP_T result = absResult | (DST_REP_T)sign << (dstBits - srcBits);
const union { DST_T f; DST_REP_T i; } dst_rep = {.i = result};
union DstExchangeType { DST_T f; DST_REP_T i; };
DstExchangeType dst_rep;
dst_rep.i = result;
return dst_rep.f;
}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@

<img src=https://raw.githubusercontent.com/tqchen/tvm.ai/master/images/logo/tvm-logo-small.png width=128/> Open Deep Learning Compiler Stack
==============================================

[![GitHub license](https://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![Build Status](http://ci.tvm.ai:8080/buildStatus/icon?job=tvm/master)](http://ci.tvm.ai:8080/job/tvm/job/master/)

[Documentation](https://docs.tvm.ai) |
[Contributors](CONTRIBUTORS.md) |
[Community](https://tvm.ai/community.html) |
[Release Notes](NEWS.md)

[![Build Status](http://ci.tvm.ai:8080/buildStatus/icon?job=tvm/master)](http://ci.tvm.ai:8080/job/tvm/job/master/)
[![Azure Pipeline](https://dev.azure.com/tvmai/tvm/_apis/build/status/windows_mac_build?branchName=master)](https://dev.azure.com/tvmai/tvm/_build/latest?definitionId=2&branchName=master)

TVM is a compiler stack for deep learning systems. It is designed to close the gap between the
productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends.
TVM works with deep learning frameworks to provide end to end compilation to different backends.
Expand Down
24 changes: 5 additions & 19 deletions vta/python/vta/top/arm_conv2d.py → apps/pynq_rpc/start_rpc_server_to_tracker.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -14,24 +15,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
"""Reuse conv2d schedule from ARM CPU"""
PROJROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"

import tvm

from topi.nn import conv2d, conv2d_alter_layout
from topi import generic

@conv2d.register(["vtacpu", "vta"])
def compute(*args, **kwargs):
with tvm.target.arm_cpu("vtacpu"):
return conv2d(*args, **kwargs)

@generic.schedule_conv2d_nchw.register(["vtacpu", "vta"])
def schedule(*args, **kwargs):
with tvm.target.arm_cpu("vtacpu"):
return generic.schedule_conv2d_nchw(*args, **kwargs)

@conv2d_alter_layout.register(["vtacpu", "vta"])
def alter(*args, **kwargs):
with tvm.target.arm_cpu("vtacpu"):
return conv2d_alter_layout(*args, **kwargs)
export PYTHONPATH=${PYTHONPATH}:${PROJROOT}/python:${PROJROOT}/vta/python
export PYTHONPATH=${PYTHONPATH}:/home/xilinx/pynq
python3 -m vta.exec.rpc_server --tracker fleet:9190 --key pynq
49 changes: 12 additions & 37 deletions cmake/modules/ANTLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,19 @@
# under the License.

if(USE_ANTLR)
file(GLOB_RECURSE ANTLR4
/usr/local/lib/antlr-*-complete.jar
/usr/local/Cellar/*antlr-*-complete.jar)
set(RELAY_PARSER_DIR
${CMAKE_CURRENT_SOURCE_DIR}/python/tvm/relay/grammar)

if(ANTLR4)
# Get the first element of the list of antlr jars.
# Sort and reverse the list so the item selected is the highest
# version in lib or else in Cellar if no lib installation exists.
list(SORT ANTLR4)
list(REVERSE ANTLR4)
list(GET ANTLR4 0 ANTLR4)
set(RELAY_PARSER_DIR
${CMAKE_CURRENT_SOURCE_DIR}/python/tvm/relay/grammar)
set(RELAY_PARSER
${RELAY_PARSER_DIR}/py3/RelayVisitor.py
${RELAY_PARSER_DIR}/py3/RelayParser.py
${RELAY_PARSER_DIR}/py3/RelayLexer.py)

set(RELAY_PARSER
${RELAY_PARSER_DIR}/py2/RelayVisitor.py
${RELAY_PARSER_DIR}/py2/RelayParser.py
${RELAY_PARSER_DIR}/py2/RelayLexer.py
# Generate ANTLR grammar for parsing.
add_custom_command(OUTPUT ${RELAY_PARSER}
COMMAND antlr4 -visitor -no-listener -Dlanguage=Python3 ${RELAY_PARSER_DIR}/Relay.g4 -o ${RELAY_PARSER_DIR}/py3
DEPENDS ${RELAY_PARSER_DIR}/Relay.g4
WORKING_DIRECTORY ${RELAY_PARSER_DIR})

${RELAY_PARSER_DIR}/py3/RelayVisitor.py
${RELAY_PARSER_DIR}/py3/RelayParser.py
${RELAY_PARSER_DIR}/py3/RelayLexer.py)

set(JAVA_HOME $ENV{JAVA_HOME})
if (NOT DEFINED JAVA_HOME)
# Hack to get system to search for Java itself.
set(JAVA_HOME "/usr")
endif()

# Generate ANTLR grammar for parsing.
add_custom_command(OUTPUT ${RELAY_PARSER}
COMMAND ${JAVA_HOME}/bin/java -jar ${ANTLR4} -visitor -no-listener -Dlanguage=Python2 ${RELAY_PARSER_DIR}/Relay.g4 -o ${RELAY_PARSER_DIR}/py2
COMMAND ${JAVA_HOME}/bin/java -jar ${ANTLR4} -visitor -no-listener -Dlanguage=Python3 ${RELAY_PARSER_DIR}/Relay.g4 -o ${RELAY_PARSER_DIR}/py3
DEPENDS ${RELAY_PARSER_DIR}/Relay.g4
WORKING_DIRECTORY ${RELAY_PARSER_DIR})

add_custom_target(relay_parser ALL DEPENDS ${RELAY_PARSER})
else()
message(FATAL_ERROR "Can't find ANTLR4: ANTLR4=" ${ANTLR4})
endif()
add_custom_target(relay_parser ALL DEPENDS ${RELAY_PARSER})
endif(USE_ANTLR)
2 changes: 1 addition & 1 deletion dmlc_tvm_commit_id.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cbec5b94b87455f07918f7f4488c9a82a2d26708
3247d3172eb9d0c753e54511598286b9e8b91c1b
2 changes: 2 additions & 0 deletions docs/api/python/topi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ List of operators
topi.image.resize
topi.argsort
topi.topk
topi.sequence_mask


List of schedules
Expand Down Expand Up @@ -167,6 +168,7 @@ topi
.. autofunction:: topi.layout_transform
.. autofunction:: topi.argsort
.. autofunction:: topi.topk
.. autofunction:: topi.sequence_mask

topi.nn
~~~~~~~
Expand Down
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ def run_doxygen(folder):
'../tutorials/autotvm',
'../tutorials/dev',
'../tutorials/topi',
'../tutorials/deployment'])
'../tutorials/deployment',
'../vta/tutorials/frontend',
'../vta/tutorials/optimize',
'../vta/tutorials/autotvm'])

def generate_doxygen_xml(app):
"""Run the doxygen make commands if we're on the ReadTheDocs server"""
Expand Down
2 changes: 2 additions & 0 deletions docs/langref/relay_op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ This level support backpropagation of broadcast operators. It is temporary.
tvm.relay.device_copy
tvm.relay.annotation.on_device
tvm.relay.reverse_reshape
tvm.relay.sequence_mask
tvm.relay.nn.batch_matmul
tvm.relay.contrib.adaptive_max_pool2d
tvm.relay.contrib.adaptive_avg_pool2d
Expand Down Expand Up @@ -323,6 +324,7 @@ Level 10 Definitions
.. autofunction:: tvm.relay.device_copy
.. autofunction:: tvm.relay.annotation.on_device
.. autofunction:: tvm.relay.reverse_reshape
.. autofunction:: tvm.relay.sequence_mask
.. autofunction:: tvm.relay.nn.batch_matmul
.. autofunction:: tvm.relay.contrib.adaptive_max_pool2d
.. autofunction:: tvm.relay.contrib.adaptive_avg_pool2d
2 changes: 1 addition & 1 deletion include/tvm/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Integer : public Expr {
*/
operator int64_t() const {
CHECK(node_ != nullptr)
<< " Trying get reference a null Integer";
<< " Trying to reference a null Integer";
return (*this)->value;
}
/*! \brief type indicate the container type */
Expand Down
12 changes: 12 additions & 0 deletions include/tvm/relay/attrs/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@ struct ShapeOfAttrs : public tvm::AttrsNode<ShapeOfAttrs> {
}
};

struct SequenceMaskAttrs : public tvm::AttrsNode<SequenceMaskAttrs> {
double mask_value;
int axis;

TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs") {
TVM_ATTR_FIELD(mask_value).set_default(0)
.describe("The masking value.");
TVM_ATTR_FIELD(axis).set_default(0)
.describe("The axis of the length dimension. Can only be 0 or 1.");
}
}; // struct SequenceMaskAttrs.

} // namespace relay
} // namespace tvm
#endif // TVM_RELAY_ATTRS_TRANSFORM_H_
11 changes: 0 additions & 11 deletions include/tvm/relay/expr_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,6 @@ class ExprMutator
*/
void PostOrderVisit(const Expr& node, std::function<void(const Expr&)> fvisit);

/*
* \brief Bind function parameters or free variables.
*
* Parameter binding can only happen if expr is a Function.
* binds cannot change internal arguments of internal functions.
*
* \param expr The function to be binded.
* \param binds The map of arguments to
*/
Expr Bind(const Expr& expr, const tvm::Map<Var, Expr>& binds);

} // namespace relay
} // namespace tvm
#endif // TVM_RELAY_EXPR_FUNCTOR_H_
Loading