Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 747c0a6

Browse files
Initial OSS release of Tensor Comprehensions.
0 parents  commit 747c0a6

File tree

282 files changed

+44284
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+44284
-0
lines changed

.circleci/config.yml

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
version: 2
2+
jobs:
3+
"build-1404":
4+
working_directory: ~/TensorComprehensions
5+
resource_class: xlarge
6+
docker:
7+
- image: tensorcomprehensions/linux-trusty-gcc4.8-tapir5.0-cuda8-cudnn6-py3-conda:x86
8+
9+
steps:
10+
- checkout
11+
- run:
12+
name: check_formatting
13+
command: |
14+
cd ~/TensorComprehensions
15+
CLANG=/usr/local/clang+llvm-tapir5.0/bin/clang-format ./check_format.sh
16+
17+
- run:
18+
name: submodules
19+
command: |
20+
git submodule sync
21+
git submodule update --init --recursive
22+
23+
- restore_cache:
24+
keys:
25+
- v2-caffe2-{{ checksum ".git/modules/third-party/caffe2/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
26+
27+
- restore_cache:
28+
keys:
29+
- v1-aten-{{ checksum ".git/modules/third-party/ATen/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
30+
31+
- restore_cache:
32+
keys:
33+
- v1-isl-{{ checksum ".git/modules/third-party/islpp/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
34+
35+
- restore_cache:
36+
keys:
37+
- v1-halide-{{ checksum ".git/modules/third-party/halide/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
38+
39+
- run:
40+
name: build
41+
command: |
42+
cd ~/TensorComprehensions
43+
export TC_DIR=$(pwd)
44+
VERBOSE=1 USE_CONTBUILD_CACHE=1 CORES=16 CMAKE_VERSION="cmake" ATEN_NO_CUDA=0 CLANG_PREFIX="`/usr/local/clang+llvm-tapir5.0/bin/llvm-config --prefix`" ./build.sh --all
45+
46+
- save_cache:
47+
key: v2-caffe2-{{ checksum ".git/modules/third-party/caffe2/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
48+
paths:
49+
- third-party-install/bin/convert_caffe_image_db
50+
- third-party-install/bin/convert_db
51+
- third-party-install/bin/db_throughput
52+
- third-party-install/bin/make_cifar_db
53+
- third-party-install/bin/make_mnist_db
54+
- third-party-install/bin/predictor_verifier
55+
- third-party-install/bin/print_registered_core_operators
56+
- third-party-install/bin/run_plan
57+
- third-party-install/bin/speed_benchmark
58+
- third-party-install/bin/split_db
59+
- third-party-install/bin/inspect_gpus
60+
- third-party-install/bin/print_core_object_sizes
61+
- third-party-install/bin/tutorial_blob
62+
- third-party-install/caffe
63+
- third-party-install/caffe2
64+
- third-party-install/include/caffe
65+
- third-party-install/include/caffe2
66+
- third-party-install/lib/libcaffe2.so
67+
- third-party-install/lib/libcaffe2_gpu.so
68+
- third-party/caffe2/build_host_protoc
69+
70+
- save_cache:
71+
key: v1-aten-{{ checksum ".git/modules/third-party/ATen/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
72+
paths:
73+
- third-party-install/share/ATen
74+
- third-party-install/include/ATen
75+
- third-party-install/include/TH
76+
- third-party-install/include/THC
77+
- third-party-install/include/THCS
78+
- third-party-install/include/THCUNN
79+
- third-party-install/include/THNN
80+
- third-party-install/include/THS
81+
- third-party-install/lib/libATen.so
82+
- third-party-install/lib/libATen.so.1
83+
- third-party-install/lib/libTH.so
84+
- third-party-install/lib/libTH.so.0
85+
- third-party-install/lib/libTHC.so
86+
- third-party-install/lib/libTHC.so.0
87+
- third-party-install/lib/libTHCS.so
88+
- third-party-install/lib/libTHCS.so.1
89+
- third-party-install/lib/libTHCUNN.so
90+
- third-party-install/lib/libTHNN.so
91+
- third-party-install/lib/libTHS.so
92+
- third-party-install/lib/libTHS.so.1
93+
- third-party/ATen/build/src/ATen/test
94+
95+
- save_cache:
96+
key: v1-isl-{{ checksum ".git/modules/third-party/islpp/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
97+
paths:
98+
- third-party-install/include/isl
99+
- third-party-install/lib/libisl.so
100+
- third-party-install/lib/libisl-static.a
101+
- third-party/islpp/build/isl_test
102+
- third-party/islpp/build/isl_test_int
103+
104+
- save_cache:
105+
key: v1-halide-{{ checksum ".git/modules/third-party/halide/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1404
106+
paths:
107+
- third-party-install/include/Halide
108+
- third-party-install/lib/libHalide.so
109+
- third-party-install/lib/libHalide.a
110+
111+
- run:
112+
name: test_isl
113+
command: |
114+
cd ~/TensorComprehensions
115+
LD_PRELOAD=$(pwd)/third-party-install/lib/libisl.so ./third-party/islpp/build/isl_test
116+
LD_PRELOAD=$(pwd)/third-party-install/lib/libisl.so ./third-party/islpp/build/isl_test_int
117+
118+
- run:
119+
name: test_cpu
120+
command: |
121+
cd ~/TensorComprehensions
122+
./test_cpu.sh
123+
124+
"build-1604":
125+
working_directory: ~/TensorComprehensions
126+
resource_class: xlarge
127+
docker:
128+
- image: tensorcomprehensions/linux-xenial-gcc5-tapir5.0-cuda9-cudnn7-py3:x86
129+
130+
steps:
131+
- checkout
132+
- run:
133+
name: check_formatting
134+
command: |
135+
cd ~/TensorComprehensions
136+
CLANG=/usr/local/clang+llvm-tapir5.0/bin/clang-format ./check_format.sh
137+
138+
- run:
139+
name: submodules
140+
command: |
141+
git submodule sync
142+
git submodule update --init --recursive
143+
144+
- restore_cache:
145+
keys:
146+
- v2-caffe2-{{ checksum ".git/modules/third-party/caffe2/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
147+
148+
- restore_cache:
149+
keys:
150+
- v1-aten-{{ checksum ".git/modules/third-party/ATen/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
151+
152+
- restore_cache:
153+
keys:
154+
- v1-isl-{{ checksum ".git/modules/third-party/islpp/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
155+
156+
- restore_cache:
157+
keys:
158+
- v1-halide-{{ checksum ".git/modules/third-party/halide/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
159+
160+
- run:
161+
name: build
162+
command: |
163+
cd ~/TensorComprehensions
164+
export TC_DIR=$(pwd)
165+
VERBOSE=1 USE_CONTBUILD_CACHE=1 CORES=16 CMAKE_VERSION="cmake" ATEN_NO_CUDA=0 CLANG_PREFIX="`/usr/local/clang+llvm-tapir5.0/bin/llvm-config --prefix`" BUILD_TYPE=Release ./build.sh --all
166+
167+
- save_cache:
168+
key: v2-caffe2-{{ checksum ".git/modules/third-party/caffe2/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
169+
paths:
170+
- third-party-install/bin/convert_caffe_image_db
171+
- third-party-install/bin/convert_db
172+
- third-party-install/bin/db_throughput
173+
- third-party-install/bin/make_cifar_db
174+
- third-party-install/bin/make_mnist_db
175+
- third-party-install/bin/predictor_verifier
176+
- third-party-install/bin/print_registered_core_operators
177+
- third-party-install/bin/run_plan
178+
- third-party-install/bin/speed_benchmark
179+
- third-party-install/bin/split_db
180+
- third-party-install/bin/inspect_gpus
181+
- third-party-install/bin/print_core_object_sizes
182+
- third-party-install/bin/tutorial_blob
183+
- third-party-install/caffe
184+
- third-party-install/caffe2
185+
- third-party-install/include/caffe
186+
- third-party-install/include/caffe2
187+
- third-party-install/lib/libcaffe2.so
188+
- third-party-install/lib/libcaffe2_gpu.so
189+
190+
- save_cache:
191+
key: v1-aten-{{ checksum ".git/modules/third-party/ATen/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
192+
paths:
193+
- third-party-install/share/ATen
194+
- third-party-install/include/ATen
195+
- third-party-install/include/TH
196+
- third-party-install/include/THC
197+
- third-party-install/include/THCS
198+
- third-party-install/include/THCUNN
199+
- third-party-install/include/THNN
200+
- third-party-install/include/THS
201+
- third-party-install/lib/libATen.so
202+
- third-party-install/lib/libATen.so.1
203+
- third-party-install/lib/libTH.so
204+
- third-party-install/lib/libTH.so.0
205+
- third-party-install/lib/libTHC.so
206+
- third-party-install/lib/libTHC.so.0
207+
- third-party-install/lib/libTHCS.so
208+
- third-party-install/lib/libTHCS.so.1
209+
- third-party-install/lib/libTHCUNN.so
210+
- third-party-install/lib/libTHNN.so
211+
- third-party-install/lib/libTHS.so
212+
- third-party-install/lib/libTHS.so.1
213+
- third-party/ATen/build/src/ATen/test
214+
215+
- save_cache:
216+
key: v1-isl-{{ checksum ".git/modules/third-party/islpp/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
217+
paths:
218+
- third-party-install/include/isl
219+
- third-party-install/lib/libisl.so
220+
- third-party-install/lib/libisl-static.a
221+
- third-party/islpp/build/isl_test
222+
- third-party/islpp/build/isl_test_int
223+
224+
- save_cache:
225+
key: v1-halide-{{ checksum ".git/modules/third-party/halide/HEAD" }}-{{ checksum "build.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}-1604
226+
paths:
227+
- third-party-install/include/Halide
228+
- third-party-install/lib/libHalide.so
229+
- third-party-install/lib/libHalide.a
230+
231+
- run:
232+
name: test_isl
233+
command: |
234+
cd ~/TensorComprehensions
235+
LD_PRELOAD=$(pwd)/third-party-install/lib/libisl.so ./third-party/islpp/build/isl_test
236+
LD_PRELOAD=$(pwd)/third-party-install/lib/libisl.so ./third-party/islpp/build/isl_test_int
237+
238+
- run:
239+
name: test_cpu
240+
command: |
241+
cd ~/TensorComprehensions
242+
./test_cpu.sh
243+
244+
workflows:
245+
version: 2
246+
build:
247+
jobs:
248+
- "build-1404"
249+
- "build-1604"

.clang-format

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
41+
ConstructorInitializerIndentWidth: 4
42+
ContinuationIndentWidth: 4
43+
Cpp11BracedListStyle: true
44+
DerivePointerAlignment: false
45+
DisableFormat: false
46+
ForEachMacros: [ FOR_EACH_RANGE, FOR_EACH, ]
47+
IncludeCategories:
48+
- Regex: '^<.*\.h(pp)?>'
49+
Priority: 1
50+
- Regex: '^<.*'
51+
Priority: 2
52+
- Regex: '.*'
53+
Priority: 3
54+
IndentCaseLabels: true
55+
IndentWidth: 2
56+
IndentWrappedFunctionNames: false
57+
KeepEmptyLinesAtTheStartOfBlocks: false
58+
MacroBlockBegin: ''
59+
MacroBlockEnd: ''
60+
MaxEmptyLinesToKeep: 1
61+
NamespaceIndentation: None
62+
ObjCBlockIndentWidth: 2
63+
ObjCSpaceAfterProperty: false
64+
ObjCSpaceBeforeProtocolList: false
65+
PenaltyBreakBeforeFirstCallParameter: 1
66+
PenaltyBreakComment: 300
67+
PenaltyBreakFirstLessLess: 120
68+
PenaltyBreakString: 1000
69+
PenaltyExcessCharacter: 1000000
70+
PenaltyReturnTypeOnItsOwnLine: 200
71+
PointerAlignment: Left
72+
ReflowComments: true
73+
SortIncludes: true
74+
SpaceAfterCStyleCast: false
75+
SpaceBeforeAssignmentOperators: true
76+
SpaceBeforeParens: ControlStatements
77+
SpaceInEmptyParentheses: false
78+
SpacesBeforeTrailingComments: 1
79+
SpacesInAngles: false
80+
SpacesInContainerLiterals: true
81+
SpacesInCStyleCastParentheses: false
82+
SpacesInParentheses: false
83+
SpacesInSquareBrackets: false
84+
Standard: Cpp11
85+
TabWidth: 8
86+
UseTab: Never

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
__pycache__/
2+
*.so
3+
*~
4+
build/*
5+
docs/build/*
6+
third-party/*_cache
7+
third-party/llvm_sources*
8+
third-party-install/*
9+
buck-out
10+
.buckd
11+
conda
12+
.nfs*
13+
*/.nfs*
14+
tensor_comprehensions.egg-info/
15+
tensor_comprehensions/version.py
16+
slurm-*
17+
examples/results*

.gitmodules

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Development branches, we modify those heavily
2+
[submodule "third-party/islpp"]
3+
path = third-party/islpp
4+
url = [email protected]:nicolasvasilache/isl.git
5+
branch = ntv_dev
6+
[submodule "third-party/cub"]
7+
path = third-party/cub
8+
url = [email protected]:nicolasvasilache/cub.git
9+
branch = nvrtc-cub
10+
[submodule "third-party/halide"]
11+
path = third-party/halide
12+
url = https://github.com/halide/Halide.git
13+
14+
# Mainstream branches, we don't modify those
15+
[submodule "third-party/caffe2"]
16+
path = third-party/caffe2
17+
url = [email protected]:caffe2/caffe2.git
18+
[submodule "third-party/gflags"]
19+
path = third-party/gflags
20+
url = https://github.com/gflags/gflags
21+
[submodule "third-party/glog"]
22+
path = third-party/glog
23+
url = https://github.com/google/glog.git
24+
[submodule "third-party/ATen"]
25+
path = third-party/ATen
26+
url = [email protected]:zdevito/aten.git
27+
[submodule "third-party/dlpack"]
28+
path = third-party/dlpack
29+
url = https://github.com/dmlc/dlpack.git
30+
[submodule "third-party/googletest"]
31+
path = third-party/googletest
32+
url = https://github.com/google/googletest.git
33+
[submodule "third-party/pybind11"]
34+
path = third-party/pybind11
35+
url = https://github.com/pybind/pybind11.git

0 commit comments

Comments
 (0)