This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[WIP] CMake NNPack support #9860
Closed
Closed
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
d61e408
Added two functions to the C api:
af19a0a
update to latest version
dcf94e2
Merge branch 'master' into master
dabraude 5782eed
changed to us spelling
dabraude b987833
Update c_api.cc
dabraude a206dc7
removing the initialise function
dabraude 3c65037
removed initialize function and fixed bug with symbol loading
dabraude 32987f1
sync with apache
dabraude fdff10b
removed extra function
dabraude 226755c
Update c_api.h
dabraude b3ed2ba
changed submodule versions to match apache
dabraude 44e9759
added NNPack and dependencies
dabraude 0810fbf
added missing dependency
dabraude 25e04c0
incremental update
dabraude db05b81
NNPack now compiling
dabraude 6e9bfbb
enabled NNPack define, and fixed import paths
dabraude b2d7eb5
changed to reflect apache master
dabraude 2f8ac5b
Update CONTRIBUTORS.md
dabraude 3486c23
Merge branch 'master' into nnpack
dabraude e2cc244
Added two functions to the C api:
06363f5
changed to us spelling
dabraude 3fffa33
Update c_api.cc
dabraude 29ed230
removing the initialise function
dabraude 695b88f
removed initialize function and fixed bug with symbol loading
dabraude e301fbd
removed extra function
dabraude 1e688b3
Update c_api.h
dabraude a704907
added NNPack and dependencies
dabraude 5c2e889
added missing dependency
dabraude 83a527a
incremental update
dabraude d619f54
NNPack now compiling
dabraude 104c3ea
enabled NNPack define, and fixed import paths
dabraude ea74a2d
changed to reflect apache master
dabraude e13ed8a
fixed merge issues
dabraude 5959de5
removed NNPack dependency submodules
dabraude b1cd82b
Merge branch 'master' of https://github.com/dabraude/incubator-mxnet …
dabraude 9866ec4
moved files to be similar to other backends
dabraude cd8e5a2
now compiling
dabraude 31796cd
incremental update
dabraude a9b18a5
Added two functions to the C api:
c9ec707
changed to us spelling
dabraude 9dcddd4
Update c_api.cc
dabraude 383b42c
removing the initialise function
dabraude a5a0ee9
removed initialize function and fixed bug with symbol loading
dabraude 886658a
removed extra function
dabraude 7f79e66
Update c_api.h
dabraude ec724cf
changed to reflect apache master
dabraude 57c0a33
removed initialize function and fixed bug with symbol loading
dabraude bf8dbc3
changed to reflect apache master
dabraude 14f9f48
moved files to be similar to other backends
dabraude 733114e
fixed conflicts
dabraude 34572d2
Added two functions to the C api:
0eee65f
changed to us spelling
dabraude 8119136
Update c_api.cc
dabraude 5711e21
removing the initialise function
dabraude 0a5288f
removed initialize function and fixed bug with symbol loading
dabraude 79ade33
removed extra function
dabraude 9c4df00
Update c_api.h
dabraude 791995d
added NNPack and dependencies
dabraude 8a105c7
added missing dependency
dabraude 80e8141
incremental update
dabraude 5b92773
NNPack now compiling
dabraude 8d95a04
enabled NNPack define, and fixed import paths
dabraude d015d92
changed to reflect apache master
dabraude b071542
Added two functions to the C api:
dc570f4
changed to us spelling
dabraude d6d579f
Update c_api.cc
dabraude fb61233
removing the initialise function
dabraude f68546c
removed initialize function and fixed bug with symbol loading
dabraude c68f82c
removed extra function
dabraude 0c82493
Update c_api.h
dabraude 902e042
incremental update
dabraude 7dd8fe5
enabled NNPack define, and fixed import paths
dabraude 1a948a1
changed to reflect apache master
dabraude e04a594
removed NNPack dependency submodules
dabraude b427d51
moved files to be similar to other backends
dabraude 8c1e6b3
now compiling
dabraude bc95032
incremental update
dabraude 0d607d7
Added two functions to the C api:
c68e3f7
changed to us spelling
dabraude 6edebcc
Update c_api.cc
dabraude f616b9a
removing the initialise function
dabraude 15261ec
removed initialize function and fixed bug with symbol loading
dabraude 0a1ec6a
removed extra function
dabraude d9efcda
Update c_api.h
dabraude 3469537
changed to reflect apache master
dabraude a466d02
removed initialize function and fixed bug with symbol loading
dabraude 4c29ec8
changed to reflect apache master
dabraude fcd5ec0
moved files to be similar to other backends
dabraude 847bb18
merging
dabraude 9c78f01
fixed merge
dabraude 69adaca
Update CONTRIBUTORS.md
dabraude 070fe2e
stripped down files that won't be used
dabraude 05e176f
stripped down files that won't be used
dabraude c17a987
updated to latest NNPack and incorporated CMake suggestions
dabraude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* 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 | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/*! | ||
* \file nnpack_ops-inl.h | ||
* \brief | ||
* \author David Braude | ||
*/ | ||
|
||
#ifndef MXNET_OPERATOR_NN_NNPACK_NNPACK_OPS_INL_H_ | ||
#define MXNET_OPERATOR_NN_NNPACK_NNPACK_OPS_INL_H_ | ||
|
||
#if MXNET_USE_NNPACK == 1 | ||
|
||
#include <mxnet/io.h> | ||
#include <mxnet/base.h> | ||
#include <mxnet/ndarray.h> | ||
#include <mxnet/operator.h> | ||
#include <mxnet/operator_util.h> | ||
#include <dmlc/logging.h> | ||
#include <dmlc/optional.h> | ||
#include <vector> | ||
#include <nnpack.h> | ||
|
||
// TODO: | ||
// Convolutional layer | ||
// Inference-optimized forward propagation (nnp_convolution_inference) | ||
// Training-optimized forward propagation (nnp_convolution_output) | ||
// Training-optimized backward input gradient update (nnp_convolution_input_gradient) | ||
// Training-optimized backward kernel gradient update (nnp_convolution_kernel_gradient) | ||
// Fully-connected layer | ||
// Inference-optimized forward propagation (nnp_fully_connected_inference and nnp_fully_connected_inference_f16f32 version for FP16 weights) | ||
// Training-optimized forward propagation (nnp_fully_connected_output) | ||
// Max pooling layer | ||
// Forward propagation, both for training and inference, (nnp_max_pooling_output) | ||
// ReLU layer (with parametrized negative slope) | ||
// Forward propagation, both for training and inference, optionally in-place, (nnp_relu_output) | ||
// Backward input gradient update (nnp_relu_input_gradient) | ||
|
||
namespace mxnet { | ||
namespace op { | ||
|
||
/* For softmax */ | ||
void NNPACKSoftmaxForward(const nnvm::NodeAttrs& attrs, const OpContext &ctx, | ||
const NDArray &in_data, const OpReqType &req, | ||
const NDArray &out_data); | ||
|
||
} // namespace op | ||
} // namespace mxnet | ||
#endif // MXNET_USE_MKLDNN == 1 | ||
|
||
#endif // MXNET_OPERATOR_NN_MKLDNN_MKLDNN_OPS_INL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to do set the following variables:
NNPACK_BUILD_TESTS
andNNPACK_BUILD_BENCHMARKS
disabled building NNPACK's own tests and benchmarks (which are enabled by default), and settingNNPACK_LIBRARY_TYPE
,PTHREADPOOL_LIBRARY_TYPE
andCPUINFO_LIBRARY_TYPE
as"static"
would build these projects as static libraries even ifBUILD_SHARED_LIBS
isON
.After
add_subdirectory
, you'd likely want to addto build nnpack, pthreadpool, and cpuinfo with
-fPIC
even through they are static libraries.