-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Update from facebook #7696
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
Merged
Merged
Update from facebook #7696
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
4b0c7af
Fix handling of empty batches in SumReduceDimsOp
volkhin f4bb4bc
Deferrable async_scheduling finishRun fix
3a8615e
Simplify exception handling in async_scheduling
25504dd
[C2]worker_coordinator_memorize_worker_ids
stephenyan1231 58410cd
Add unit test for nets with no type set
6b17efa
Ignore total length argument in sympolic_pad_packed_sequence
ahhegazy c39f84f
Add support for MKLDNN to async_scheduling
0f77800
[AuFL][ensemble] support branch output for prediction
ea1c0b4
Fix a bug in add_loss in layer_model_helper
chocjy 7f5efa2
Support lradaption for adam
14ec584
Perf tweaks for async_scheduling
9529dd9
add quantization to SparseSimdAdagradOp
2da8dc7
[sr] [codemod] Change all SR callsites to use new API
madzoox b168a14
Back out "Fix handling of empty batches in SumReduceDimsOp"
pjh5 ed1df7f
Add the flow to support operator benchmark
lly-zero-one ad4ae12
[tum][gpu] Connect DPM trainer with flow and unit tests
xianjiec e3eb8dc
w/o normalized lradaption for adam dense only
d318e34
[fb] Use SharedPromise in DeferrableAsyncSchedulingNet
93da60a
[tum] implement cuda sparseLengthsMean and LengthsMean
5f3a2e3
Adding an optional parameter to allow use of protobufs in InferShapes…
mnaumovfb d0f3931
Move feature_to_index to FeatureSpec.feature_to_index
0db5ca8
[Caffe2] Rename bytes_moved to bytes_written
438bdd8
[c2] fix ReduceFrontSumOp for empty case by setting 0
xianjiec e84fdd8
[Caffe2] [Int8] Improve Intel CPU performance
6aab2df
[Easy] Improve PrependDim op logging
chocjy a71340a
DBFileReader expand db_path using os.path.expanduser(..)
xush6528 31a0bb3
[Caffe2] Add bytes_read to cost structure
b01fcc5
Fix sleef on aarch64 for hhvm
pjh5 3eff8a3
Merge remote-tracking branch 'origin/master' into update-from-facebook
bddppq 893ec8d
Remove duplicated part in caffe2/ideep/operators/conv_op.cc
bddppq 0f3f88e
Rename test helper function test_adagrad_sparse_helper to adagrad_spa…
bddppq 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 hidden or 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 |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ | |
| #include <sleef.h> | ||
| #endif | ||
|
|
||
| #include <iostream> | ||
|
|
||
| namespace at { | ||
| namespace vec256 { | ||
| namespace { | ||
|
|
||
This file contains hidden or 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,97 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
| from __future__ import print_function | ||
| from __future__ import unicode_literals | ||
|
|
||
| import argparse | ||
|
|
||
| from caffe2.python.model_helper import ModelHelper | ||
| from caffe2.python.predictor import mobile_exporter | ||
| from caffe2.python import workspace, brew | ||
|
|
||
|
|
||
| def parse_kwarg(kwarg_str): | ||
| key, value = kwarg_str.split('=') | ||
| try: | ||
| value = int(value) | ||
| except ValueError: | ||
| try: | ||
| value = float(value) | ||
| except ValueError: | ||
| pass | ||
| return key, value | ||
|
|
||
|
|
||
| def main(args): | ||
| # User defined keyword arguments | ||
| kwargs = {"order": "NCHW"} | ||
| kwargs.update(dict(args.kwargs)) | ||
|
|
||
| model = ModelHelper(name=args.benchmark_name) | ||
|
|
||
| op_type = args.operator # assumes a brew type op name | ||
| input_name = args.input_name | ||
| output_name = args.output_name | ||
|
|
||
| iters = int(args.iters) | ||
| for i in range(iters): | ||
| input_blob_name = input_name + (str(i) if i > 0 and args.chain else '') | ||
| output_blob_name = output_name + str(i + 1) | ||
| add_op = getattr(brew, op_type) | ||
| add_op(model, input_blob_name, output_blob_name, **kwargs) | ||
| if args.chain: | ||
| input_name, output_name = output_name, input_name | ||
|
|
||
| workspace.RunNetOnce(model.param_init_net) | ||
|
|
||
| init_net, predict_net = mobile_exporter.Export( | ||
| workspace, model.net, model.params | ||
| ) | ||
|
|
||
| if args.debug: | ||
| print("init_net:") | ||
| for op in init_net.op: | ||
| print(" ", op.type, op.input, "-->", op.output) | ||
| print("predict_net:") | ||
| for op in predict_net.op: | ||
| print(" ", op.type, op.input, "-->", op.output) | ||
|
|
||
| with open(args.predict_net, 'wb') as f: | ||
| f.write(predict_net.SerializeToString()) | ||
| with open(args.init_net, 'wb') as f: | ||
| f.write(init_net.SerializeToString()) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| parser = argparse.ArgumentParser( | ||
| description="Utilitity to generate Caffe2 benchmark models.") | ||
| parser.add_argument("operator", help="Caffe2 operator to benchmark.") | ||
| parser.add_argument("-b", "--blob", | ||
| help="Instantiate a blob --blob name=dim1,dim2,dim3", | ||
| action='append') | ||
| parser.add_argument("--context", help="Context to run on.", default="CPU") | ||
| parser.add_argument("--kwargs", help="kwargs to pass to operator.", | ||
| nargs="*", type=parse_kwarg, default=[]) | ||
| parser.add_argument("--init_net", help="Output initialization net.", | ||
| default="init_net.pb") | ||
| parser.add_argument("--predict_net", help="Output prediction net.", | ||
| default="predict_net.pb") | ||
| parser.add_argument("--benchmark_name", | ||
| help="Name of the benchmark network", | ||
| default="benchmark") | ||
| parser.add_argument("--input_name", help="Name of the input blob.", | ||
| default="data") | ||
| parser.add_argument("--output_name", help="Name of the output blob.", | ||
| default="output") | ||
| parser.add_argument("--iters", | ||
| help="Number of iterations to run the operator.", | ||
| default="1") | ||
| parser.add_argument("-d", "--debug", help="Print debug information.", | ||
| action='store_true') | ||
| parser.add_argument("-c", "--chain", | ||
| help="Chain ops together (create data dependencies)", | ||
| action='store_true') | ||
| args = parser.parse_args() | ||
| main(args) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.