Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions paddle/fluid/platform/profiler/chrometracing_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,13 @@ void ChromeTracingLogger::StartLog() {
}

void ChromeTracingLogger::LogMetaInfo(const std::string& version,
uint32_t span_indx) {
uint32_t span_index) {
output_file_stream_ << string_format(std::string(
R"JSON(
"schemaVersion": "%s",
"span_indx": "%d",)JSON"),
"span_index": "%d",)JSON"),
version.c_str(),
span_indx);
span_index);
}

#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/platform/profiler/chrometracing_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ChromeTracingLogger : public BaseLogger {
void LogDeviceProperty(
const std::map<uint32_t, gpuDeviceProp>& device_property_map);
#endif
void LogMetaInfo(const std::string& version, uint32_t span_indx);
void LogMetaInfo(const std::string& version, uint32_t span_index);

private:
void OpenFile();
Expand Down
14 changes: 7 additions & 7 deletions paddle/fluid/platform/profiler/dump/deserialization_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ std::unique_ptr<ProfilerResult> DeserializationReader::Parse() {
}
// restore extra info
ExtraInfo extra_info;
for (auto indx = 0; indx < node_trees_proto_->extra_info_size(); indx++) {
ExtraInfoMap extra_info_map = node_trees_proto_->extra_info(indx);
for (auto index = 0; index < node_trees_proto_->extra_info_size(); index++) {
ExtraInfoMap extra_info_map = node_trees_proto_->extra_info(index);
extra_info.AddExtraInfo(extra_info_map.key(),
std::string("%s"),
extra_info_map.value().c_str());
Expand Down Expand Up @@ -130,10 +130,10 @@ std::unique_ptr<ProfilerResult> DeserializationReader::Parse() {
// restore gpuDeviceProp
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
std::map<uint32_t, gpuDeviceProp> device_property_map;
for (auto indx = 0; indx < node_trees_proto_->device_property_size();
indx++) {
for (auto index = 0; index < node_trees_proto_->device_property_size();
index++) {
const DevicePropertyProto& device_property_proto =
node_trees_proto_->device_property(indx);
node_trees_proto_->device_property(index);
device_property_map[device_property_proto.id()] =
RestoreDeviceProperty(device_property_proto);
}
Expand All @@ -143,9 +143,9 @@ std::unique_ptr<ProfilerResult> DeserializationReader::Parse() {
ProfilerResult* profiler_result_ptr =
new ProfilerResult(std::move(tree), extra_info);
#endif
// restore version and span indx
// restore version and span index
profiler_result_ptr->SetVersion(node_trees_proto_->version());
profiler_result_ptr->SetSpanIndx(node_trees_proto_->span_indx());
profiler_result_ptr->SetSpanIndex(node_trees_proto_->span_index());
return std::unique_ptr<ProfilerResult>(profiler_result_ptr);
}

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/platform/profiler/dump/nodetree.proto
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ message DevicePropertyProto {

message NodeTreesProto {
required string version = 1;
required uint32 span_indx = 2;
required uint32 span_index = 2;
repeated ThreadNodeTreeProto thread_trees = 3;
repeated ExtraInfoMap extra_info = 4;
repeated DevicePropertyProto device_property = 5;
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/platform/profiler/dump/serialization_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ void SerializationLogger::LogExtraInfo(
}

void SerializationLogger::LogMetaInfo(const std::string& version,
uint32_t span_indx) {
uint32_t span_index) {
node_trees_proto_->set_version(version);
node_trees_proto_->set_span_indx(span_indx);
node_trees_proto_->set_span_index(span_index);
}

SerializationLogger::SerializationLogger(const std::string& filename) {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/platform/profiler/dump/serialization_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SerializationLogger : public BaseLogger {
void LogDeviceProperty(
const std::map<uint32_t, gpuDeviceProp>& device_property_map);
#endif
void LogMetaInfo(const std::string& version, uint32_t span_indx);
void LogMetaInfo(const std::string& version, uint32_t span_index);

private:
void OpenFile();
Expand Down
8 changes: 4 additions & 4 deletions paddle/fluid/platform/profiler/event_python.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ ProfilerResult::ProfilerResult(
: tree_(tree.release()),
extra_info_(extra_info),
device_property_map_(device_property_map),
span_indx_(0) {
span_index_(0) {
if (tree_ != nullptr) {
std::map<uint64_t, HostTraceEventNode*> nodetrees = tree_->GetNodeTrees();
for (auto& nodetree : nodetrees) {
Expand All @@ -147,7 +147,7 @@ ProfilerResult::ProfilerResult(

ProfilerResult::ProfilerResult(std::unique_ptr<NodeTrees> tree,
const ExtraInfo& extra_info)
: tree_(tree.release()), extra_info_(extra_info), span_indx_(0) {
: tree_(tree.release()), extra_info_(extra_info), span_index_(0) {
if (tree_ != nullptr) {
std::map<uint64_t, HostTraceEventNode*> nodetrees = tree_->GetNodeTrees();
for (auto& nodetree : nodetrees) {
Expand All @@ -167,15 +167,15 @@ void ProfilerResult::Save(const std::string& file_name,
const std::string format) {
if (format == std::string("json")) {
ChromeTracingLogger logger(file_name);
logger.LogMetaInfo(version_, span_indx_);
logger.LogMetaInfo(version_, span_index_);
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
logger.LogDeviceProperty(device_property_map_);
#endif
tree_->LogMe(&logger);
logger.LogExtraInfo(GetExtraInfo());
} else if (format == std::string("pb")) {
SerializationLogger logger(file_name);
logger.LogMetaInfo(version_, span_indx_);
logger.LogMetaInfo(version_, span_index_);
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
logger.LogDeviceProperty(device_property_map_);
#endif
Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/platform/profiler/event_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ class ProfilerResult {

void SetVersion(const std::string& version) { version_ = version; }

void SetSpanIndx(uint32_t span_indx) { span_indx_ = span_indx; }
void SetSpanIndex(uint32_t span_index) { span_index_ = span_index; }

std::string GetVersion() { return version_; }
uint32_t GetSpanIndx() { return span_indx_; }
uint32_t GetSpanIndex() { return span_index_; }
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
std::map<uint32_t, gpuDeviceProp> GetDeviceProperty() {
return device_property_map_;
Expand All @@ -180,7 +180,7 @@ class ProfilerResult {
std::map<uint32_t, gpuDeviceProp> device_property_map_;
#endif
std::string version_;
uint32_t span_indx_;
uint32_t span_index_;
HostPythonNode* CopyTree(HostTraceEventNode* root);
};

Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/platform/profiler/profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void SynchronizeDevice() {

std::atomic<bool> Profiler::alive_{false};

uint32_t Profiler::span_indx = 0;
uint32_t Profiler::span_index = 0;
const char* Profiler::version = "1.0.2";

std::unique_ptr<Profiler> Profiler::Create(
Expand Down Expand Up @@ -175,8 +175,8 @@ std::unique_ptr<ProfilerResult> Profiler::Stop() {
new platform::ProfilerResult(std::move(tree), extra_info);
#endif
profiler_result_ptr->SetVersion(std::string(version));
profiler_result_ptr->SetSpanIndx(span_indx);
span_indx += 1;
profiler_result_ptr->SetSpanIndex(span_index);
span_index += 1;
return std::unique_ptr<ProfilerResult>(profiler_result_ptr);
}

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/platform/profiler/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct ProfilerOptions {
class Profiler {
public:
static uint32_t
span_indx; // index of profiler range, when user profiles multiple ranges
// such as [2,4], [6,8], the first range is index 0.
span_index; // index of profiler range, when user profiles multiple
// ranges such as [2,4], [6,8], the first range is index 0.
static const char* version; // profiler version.
static std::unique_ptr<Profiler> Create(
const ProfilerOptions& options,
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/auto_parallel_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ static void parse_tensors(PyObject *obj,
phi::distributed::InferSpmdContext *ctx,
const size_t arg_pos) {
Py_ssize_t len = PyList_Size(obj);
VLOG(6) << "args indx: [" << arg_pos << "] input vector of ["
VLOG(6) << "args index: [" << arg_pos << "] input vector of ["
<< static_cast<size_t>(len) << "] tensors.";
paddle::small_vector<phi::distributed::DistMetaTensor,
phi::kInputSmallVectorSize>
Expand All @@ -893,7 +893,7 @@ static void parse_tensors(PyObject *obj,
static void parse_tensor(PyObject *obj,
phi::distributed::InferSpmdContext *ctx,
const size_t arg_pos) {
VLOG(6) << "args indx: [" << arg_pos << "] input one tensor.";
VLOG(6) << "args index: [" << arg_pos << "] input one tensor.";
DistTensorSpec in = py::cast<DistTensorSpec>(obj);
VLOG(6) << "DistTensorSpec: " << in.to_string();
ctx->EmplaceBackInput(phi::distributed::DistMetaTensor(
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3446,11 +3446,11 @@ All parameter, weight, gradient are variables in Paddle.
.def("get_extra_info", &paddle::platform::ProfilerResult::GetExtraInfo)
.def("get_version", &paddle::platform::ProfilerResult::GetVersion)
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
.def("get_span_indx", &paddle::platform::ProfilerResult::GetSpanIndx)
.def("get_span_index", &paddle::platform::ProfilerResult::GetSpanIndex)
.def("get_device_property",
&paddle::platform::ProfilerResult::GetDeviceProperty);
#else
.def("get_span_indx", &paddle::platform::ProfilerResult::GetSpanIndx);
.def("get_span_index", &paddle::platform::ProfilerResult::GetSpanIndex);
#endif

py::class_<paddle::platform::MemPythonNode>(m, "MemPythonNode")
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/blas/blas.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Blas {
const T* alpha,
const char* matdescra,
const T* val,
const int* indx,
const int* index,
const int* pntrb,
const int* pntre,
const T* b,
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/funcs/blas/blas_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ void Blas<phi::CPUContext>::CSRMM(const char *transa,
const T *alpha,
const char *matdescra,
const T *val,
const int *indx,
const int *index,
const int *pntrb,
const int *pntre,
const T *b,
Expand All @@ -2049,7 +2049,7 @@ void Blas<phi::CPUContext>::CSRMM(const char *transa,
alpha,
matdescra,
val,
indx,
index,
pntrb,
pntre,
b,
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/gpu/batch_fc_grad_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ __global__ void add_bias_grad_kernel(const T* dout_data,
int col = idx % out_dim;
T temp = static_cast<T>(0);
for (int i = 0; i < ins_num; ++i) {
int select_indx = ((row + 1) * i + 1) * col;
temp += dout_data[select_indx];
int select_index = ((row + 1) * i + 1) * col;
temp += dout_data[select_index];
}
db_data[idx] += temp;
}
Expand Down
Loading