Cuda SparseLabelSplitOp

Summary:
This is a brief introduction to what this op is doing. In the multi-label case,
i.e., each example has more than one label, we want to find out which examples
have values for each label. That is, given a sparse representation in
len = (2,3), ind = (1, 2, 0, 1, 2), val = (10, 20, 5, 8, 15), we want to return
example_id_0 = [1], example_id_1 = [0,1], example_id_2 = [0,1],
value_0 = [5], value_1 = [10,8], value_2 = [20,15].

There are two special things here. 1. The size of each output tensor is unknown until runtime;
2. The ordering in each output tensor should be preserved, e.g., example_id_1 = [0,1] instead of [1,0].

What I am doing now is to get the output size and an offset map (see codes) in cpu and then
launch a kernel to take care of the rest. This requires a copy of O(N) which is really not ideal.

Previously I had an implementation that computes the output size in gpu but when I fill values in
the output tensors it is hard to make sure the ordering will be preserved unless I do a sorting afterwards.

Reviewed By: azzolini

Differential Revision: D5825104

fbshipit-source-id: 4d987cef0247746998ec1d2acc47fc5ed2302722
1 file changed
tree: 56e9027d1cc69bd534a1a3a977a86c70a66f4fb6
  1. .travis/
  2. caffe/
  3. caffe2/
  4. cmake/
  5. conda/
  6. docker/
  7. docs/
  8. scripts/
  9. third_party/
  10. .Doxyfile
  11. .Doxyfile-c
  12. .Doxyfile-python
  13. .gitignore
  14. .gitmodules
  15. .travis.yml
  16. appveyor.yml
  17. CMakeLists.txt
  18. LICENSE
  19. Makefile
  20. NOTICE
  21. README.md
  22. release-notes.md
README.md

Caffe2

License TravisCI Build Status Appveyor Build Status

Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.

News and Events

Caffe2 research award competition request for proposals

Questions and Feedback

Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.

Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.

License

Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.

Further Resources on Caffe2.ai