move flags to c10 (#12144)

Summary:
still influx.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12144

Reviewed By: smessmer

Differential Revision: D10140176

Pulled By: Yangqing

fbshipit-source-id: 1a313abed022039333e3925d19f8b3ef2d95306c
This commit is contained in:
Yangqing Jia
2018-10-04 02:07:11 -07:00
committed by Facebook Github Bot
parent c9f7d7b506
commit 38f3d1fc40
180 changed files with 1342 additions and 1260 deletions

View File

@ -11,27 +11,27 @@
#include "caffe2/core/operator.h"
#if !CAFFE2_MOBILE
CAFFE2_DEFINE_int64(
C10_DEFINE_int64(
aiBench_netInitSampleRate,
0,
"One in N sampling rate for net delay");
CAFFE2_DEFINE_int64(
C10_DEFINE_int64(
aiBench_netFollowupSampleRate,
0,
"One in N sampling rate for net delay");
CAFFE2_DEFINE_int64(
C10_DEFINE_int64(
aiBench_netFollowupSampleCount,
0,
"control the following c logs");
CAFFE2_DEFINE_int64(
C10_DEFINE_int64(
aiBench_operatorNetSampleRatio,
0,
"One in N sampling rate for operator delay");
CAFFE2_DEFINE_int64(
C10_DEFINE_int64(
aiBench_skipIters,
0,
"skip the first N iterations of the net run");
@ -51,11 +51,11 @@ bool registerGlobalPerfNetObserverCreator(int* /*pargc*/, char*** /*pargv*/) {
caffe2::make_unique<caffe2::NetObserverReporterPrint>());
caffe2::ObserverConfig::initSampleRate(
FLAGS_aiBench_netInitSampleRate,
FLAGS_aiBench_netFollowupSampleRate,
FLAGS_aiBench_netFollowupSampleCount,
FLAGS_aiBench_operatorNetSampleRatio,
FLAGS_aiBench_skipIters);
c10::FLAGS_aiBench_netInitSampleRate,
c10::FLAGS_aiBench_netFollowupSampleRate,
c10::FLAGS_aiBench_netFollowupSampleCount,
c10::FLAGS_aiBench_operatorNetSampleRatio,
c10::FLAGS_aiBench_skipIters);
#endif
return true;

View File

@ -21,8 +21,10 @@
#include "rocksdb/db.h"
#include "rocksdb/utilities/leveldb_options.h"
CAFFE2_DEFINE_int(caffe2_rocksdb_block_size, 65536,
"The caffe2 rocksdb block size when writing a rocksdb.");
C10_DEFINE_int(
caffe2_rocksdb_block_size,
65536,
"The caffe2 rocksdb block size when writing a rocksdb.");
namespace caffe2 {
namespace db {
@ -74,7 +76,7 @@ class RocksDB : public DB {
public:
RocksDB(const string& source, Mode mode) : DB(source, mode) {
rocksdb::LevelDBOptions options;
options.block_size = FLAGS_caffe2_rocksdb_block_size;
options.block_size = c10::FLAGS_caffe2_rocksdb_block_size;
options.write_buffer_size = 268435456;
options.max_open_files = 100;
options.error_if_exists = mode == NEW;