-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Implement calling of c10 ops from c2 #9369
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
Conversation
|
This is doing the same thing as #8809 but the PR was recreated due to ShipIt complications |
caffe2/operators/c10_sigmoid_op.cc
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
caffe2/core/operator_c10wrapper.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
caffe2/core/operator_c10wrapper.h
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
b34956d to
5112991
Compare
5112991 to
0996a3a
Compare
0996a3a to
d378d38
Compare
d378d38 to
aae62d7
Compare
aae62d7 to
4fb5d20
Compare
4fb5d20 to
453b1b8
Compare
453b1b8 to
92364d0
Compare
92364d0 to
66cf9e3
Compare
66cf9e3 to
2068b23
Compare
2068b23 to
6ed04b4
Compare
6ed04b4 to
5dbb9ea
Compare
5dbb9ea to
dcae9f6
Compare
dcae9f6 to
88933f6
Compare
88933f6 to
916685d
Compare
916685d to
32a1e9b
Compare
|
Can you add the test script to the actual repo so it gets run when we do OSS tests? |
Summary: Pull Request resolved: pytorch#9369 This adds the capability for caffe2 to call c10 operators and adds a dummy c10 sigmoid op as a proof of concept. I used this test script to make sure it works: from caffe2.python import workspace, model_helper import numpy as np data1 = np.random.rand(16, 100).astype(np.float32) workspace.FeedBlob("data1", data1) m = model_helper.ModelHelper(name="my net") sigmoid1 = m.net.C10Sigmoid_DontUseThisOpYet("data1", "sigmoid1") sigmoid2 = m.net.Sigmoid("data1", "sigmoid2") workspace.RunNetOnce(m.param_init_net) workspace.CreateNet(m.net) data1 = np.random.rand(16, 100).astype(np.float32) workspace.FeedBlob("data1", data1) workspace.RunNet(m.name, 1) print(workspace.FetchBlob("data1")) print(workspace.FetchBlob("sigmoid1")) print(workspace.FetchBlob("sigmoid2")) (and check that both sigmoid outputs are the same) Reviewed By: ezyang Differential Revision: D8814669 fbshipit-source-id: e289f0649d23dc9c2689c528fb9da9caf94eb6b5
32a1e9b to
eaaad21
Compare
Summary: Pull Request resolved: pytorch#9369 This adds the capability for caffe2 to call c10 operators and adds a dummy c10 sigmoid op as a proof of concept. I used this test script to make sure it works: from caffe2.python import workspace, model_helper import numpy as np data1 = np.random.rand(16, 100).astype(np.float32) workspace.FeedBlob("data1", data1) m = model_helper.ModelHelper(name="my net") sigmoid1 = m.net.C10Sigmoid_DontUseThisOpYet("data1", "sigmoid1") sigmoid2 = m.net.Sigmoid("data1", "sigmoid2") workspace.RunNetOnce(m.param_init_net) workspace.CreateNet(m.net) data1 = np.random.rand(16, 100).astype(np.float32) workspace.FeedBlob("data1", data1) workspace.RunNet(m.name, 1) print(workspace.FetchBlob("data1")) print(workspace.FetchBlob("sigmoid1")) print(workspace.FetchBlob("sigmoid2")) (and check that both sigmoid outputs are the same) Reviewed By: ezyang Differential Revision: D8814669 fbshipit-source-id: eeb0e7a854727f1617a3c592a662a7e5ae226f40
Summary:
This adds the capability for caffe2 to call c10 operators and adds a dummy c10 sigmoid op as a proof of concept.
I used this test script to make sure it works:
(and check that both sigmoid outputs are the same)
Differential Revision: D8814669