Permalink
Browse files

[NOTE] Add Release Note

  • Loading branch information...
tqchen committed Jun 19, 2017
1 parent 3567afe commit 41fe60a76fe6e5669540acf1ef3595bc38025157
Showing with 148 additions and 1 deletion.
  1. +11 −0 LICENSE
  2. +45 −0 Makefile
  3. +92 −1 README.md
View
11 LICENSE
@@ -0,0 +1,11 @@
Copyright (c) 2016 HalideIR contributors
Copyright (c) 2012-2014 MIT CSAIL, Google Inc., and other contributors
HalideIR is derived from the Halide project.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,45 @@
LDFLAGS = -pthread -lm
CFLAGS = -std=c++11 -Wall -O2\
-Iinclude -Idmlc-core/include -Isrc -fPIC
ifdef no_rtti
CFLAGS += -fno-rtti
endif
# specify tensor path
.PHONY: clean all test doc
CCSUFFIX=cpp
all: lib/libHalideIR.a lib/libHalideIR.so
SRC = $(wildcard src/*.$(CCSUFFIX) src/*/*.$(CCSUFFIX))
ALL_OBJ = $(patsubst src/%.$(CCSUFFIX), build/%.o, $(SRC))
ALL_DEP = $(ALL_OBJ)
build/%.o: src/%.$(CCSUFFIX)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MM -MT build/$*.o $< >build/$*.d
$(CXX) -c $(CFLAGS) -c $< -o $@
lib/libHalideIR.a: $(ALL_DEP)
@mkdir -p $(@D)
ar crv $@ $(filter %.o, $?)
lib/libHalideIR.so: $(ALL_DEP)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS)
lint:
python2 dmlc-core/scripts/lint.py tvm cpp include src/tvm
doc:
doxygen docs/Doxyfile
clean:
$(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o */*.d */*/*.d */*/*/*.d
-include build/*.d
-include build/*/*.d
View
@@ -1 +1,92 @@
# HalideIR
# HalideIR: Symbolic Arithmetic IR Module
HalideIR is a base module for building symbolic expression and arithmetic simplification
for building new DSLs. It is isolated and refactored from Halide project.
## Motivation
We build this component during the development of TVM project.
Symbolic expression data structure and simplification libary
is essential to for such compiler stack project.
Unfortunately there is no standalone module that fits our need at the moment.
We find that the IR and simplification module of Halide project fits such purposes nicely.
So we isolated and refactor the coresponding module into this repo.
The major goal is minimum and interpolatable with more front-end languages.
HalideIR is used in TVM project. Here are the few major improvements.
- An isolated depenency free symbolic IR and simplification (no LLVM dependency).
- The project modularized into logical components.
- All IR structure are serializable and publically accessible from front-end language(e.g. python)
- This supports ease of development and proptyping in python
- Think of re-usablity when adding new DSL structure.
- A runtime dispatching mechanism is introduced to allow ease of add new IR node.
- Simplified variable defintiion rule: change from match by string to match by pointer
- This ensures each variable to have single define location (like SSA)
Besides these changes, we also re-factored the code to resolve some of the issues in the codebase.
Some of these changes addresses the pain point raised in Halide project.
The detailed change are listed in the later part of the project.
## Project Structure
Based on code from Halide(release_2017_05_03).
The code is componetized into four logical components
- tvm: TVM container code for interpolation, basic data structures.
- base: base utilities and type.
- ir: The IR data structure
- arithmetic: Arithemetic simplification.
### Code Style
We keep old files in old code style, but use Google C style in the newly added files.
### List of Changes
- Replace implmentation of Float16.cpp with a simpler version that does not depend on LLVM
- IntrusivePtr
- Remove IntrusivePtr, change everything to base on std::shared_ptr
- See tvm/node.h
- Add support for IR reflection via NodeRef.VisitAttrs
- All the IR is constructable from python via TVM
- This enables quick proptyping and debuging from python
- Call
- Remove Parameter, BufferPtr from Variable, Call, Load
- This simplifies dependency, we also find it is cleaner to simply use Variable
for Parameter.
- AttrStmt
- This is a new Stmt that can be used to annotate attribute of certain things
(e.g. content type of buffer).
This removes the need of string matching for properties and hacks around string matching in Let.
- We use this extensively to add new hints in the environment scope.
- FunctionContent
- Make FunctionBaseNode abstract, to replace FunctionContent
- Provide, Realize, Prefetch, ProducerConsumer, Call
- Remove use of string name matching of function
- When place where function is needed, use FunctionRef
- FunctionRef is uniqued matched by internal pointer.
- Variable, Store, Allocate, Free, For, Load, Let, LetStmt
- Remove use of string name matching of Variable
- When place where variable is needed, use VarExpr
- VarExpr is uniqued matched by internal pointer.
- Variable
- Rename Variable.name -> Variable.name_hint, to avoid confusion.
- Variable.name_hint is not used to uniquely identify the variable.
- By default, each Variable should be only defined once
- This is in analog to SSA, and can make ir pass simplier(remove need of scoping)
- Provide, Realize, Prefetch
- Change Provide and Realize to associate with value_index.
- Original Provide/Realize with multiple values can be represented by several Provide and Realize chained together
- This allows outputs of a Function to have different shapes.
- Make every field the IR reflectable and accessible from python
- std::vector<> - > Array<>(tvm/container.h)
- struct Range -> Range(Range.h)
- Range
- Remove constructor Range(min, extent) to Range::make_with_min_extent(min, extent)
- The original constructor could make new user confuse since a typical way is
range(begin, end) in both c++ and python
- Simplify Visitor
- Remove use of string name mapping in the Scope
- Remove Scope in Substitute to check name conflicts because we use variable pointer matching
- Add Expr&/Stmt& to visit interface in the IRVisitor and IRMutator
- Add a more flexible RTTI and dynamic dispatch support, see src/tvm/node.h
- IRFunctor allows plugin of new IR Node more easily, without chaning interface

0 comments on commit 41fe60a

Please sign in to comment.