pytorch/caffe2
Adam Simpkins 00896cb9ed [caffe2] update db::Transaction::Put() to accept the value by rvalue reference (#60208)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60208

Update the DB APIs so that `db::Transaction::Put()` accepts the value by
rvalue reference.  This allows DB implementations to write data asynchronously
without being forced to make an additional copy of the data in memory.
`Put()` implementations can now use the string move constructor or assignment
operator to get the string data and continue performing the write
asynchronously after returning from `Put()`.

Note that I chose to entirely replace the existing `Put()`, removing the
ability for callers to call `Put()` with a `const std::string&` argument for
the value, rather than simply adding another overloaded version of `Put()`.

This was done because in practice there were no call sites using `Put()` that
cannot move in their data.  Eliminating the `const std::string&` API entirely
simplifies the DB implementations: DBs that wish do support move semantics do
not have to implement both the move and the copy versions of `Put()`.

Test Plan:
Searched through fbcode to try and make sure I found all `db::Transaction`
subclasses, and will check sandcastle results to help confirm.

Ran the modelstore checkpointing unit tests.

Differential Revision: D29204425

fbshipit-source-id: 28be6646e92e5df71954d4bb3dc0c8add30ed041
2021-06-23 22:12:53 -07:00
..
contrib remove unused type: ignore directives (#60006) 2021-06-18 07:23:31 -07:00
core [caffe2] update db::Transaction::Put() to accept the value by rvalue reference (#60208) 2021-06-23 22:12:53 -07:00
cuda_rtc
db [caffe2] update db::Transaction::Put() to accept the value by rvalue reference (#60208) 2021-06-23 22:12:53 -07:00
distributed remove unused type: ignore directives (#60006) 2021-06-18 07:23:31 -07:00
experiments
ideep External stream (#59527) 2021-06-14 13:46:11 -07:00
image
mobile
mpi
observers [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
onnx [ONNX] Update ONNX to rel-1.9 (#55889) (#57080) 2021-06-02 08:27:17 -07:00
operators [caffe2] update db::Transaction::Put() to accept the value by rvalue reference (#60208) 2021-06-23 22:12:53 -07:00
opt Add support for MatMul to BatchMatMulFP16Acc{16,32}Fake Op Mapping 2021-06-02 08:32:21 -07:00
perfkernels Update call site for FBGemm quantization util functions. (#624) 2021-06-16 10:15:34 -07:00
predictor [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
proto Fix some typing issues (#59952) 2021-06-15 14:11:06 -07:00
python Weighted decay with frequency (count-based) (#60382) 2021-06-21 18:46:35 -07:00
quantization Delete empty caffe2/quantization/CMakeLists.txt (#59717) 2021-06-09 14:20:33 -07:00
queue [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
serialize Enable implicit operator versioning via number of arguments (#58852) 2021-06-15 02:07:40 -07:00
sgd Weighted decay with frequency (count-based) (#60382) 2021-06-21 18:46:35 -07:00
share [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
test
transforms [clang-tidy] Exclude cppcoreguidelines-avoid-magic-numbers (#57841) 2021-05-07 20:02:33 -07:00
utils [caffe2/utils] Add explicit rule to avoid package boundary violation 2021-06-22 12:22:24 -07:00
video
.clang-format
__init__.py
c2_aten_srcs.bzl
CMakeLists.txt cmake: Prefer CMAKE_CURRENT_SOURCE_DIR to TORCH_SRC_DIR (#60493) 2021-06-23 14:08:19 -07:00
README.md
release-notes.md
requirements.txt
VERSION_NUMBER

Caffe2

Jenkins 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.

Questions and Feedback

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

Further Resources on Caffe2.ai