Skip to content

Commit 7694c10

Browse files
committed
[Automated Commit] Format Codebase
1 parent 2a0aeb2 commit 7694c10

File tree

4 files changed

+45
-29
lines changed

4 files changed

+45
-29
lines changed

compliance/nvidia/TEST04/verify_performance.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ def main():
5454

5555
if ref_mode == "SingleStream":
5656
if re.match(".*Early stopping 90th percentile estimate", line):
57-
ref_score = line.split(": ",1)[1].strip()
57+
ref_score = line.split(": ", 1)[1].strip()
5858
continue
5959

6060
if ref_mode == "MultiStream":
6161
if re.match(".*Early stopping 99th percentile estimate", line):
62-
ref_score = line.split(": ",1)[1].strip()
62+
ref_score = line.split(": ", 1)[1].strip()
6363
continue
6464

6565
if ref_mode == "Server":
@@ -91,12 +91,12 @@ def main():
9191

9292
if test_mode == "SingleStream":
9393
if re.match(".*Early stopping 90th percentile estimate", line):
94-
test_score = line.split(": ",1)[1].strip()
94+
test_score = line.split(": ", 1)[1].strip()
9595
continue
9696

9797
if test_mode == "MultiStream":
9898
if re.match(".*Early stopping 99th percentile estimate", line):
99-
test_score = line.split(": ",1)[1].strip()
99+
test_score = line.split(": ", 1)[1].strip()
100100
continue
101101

102102
if test_mode == "Server":

loadgen/issue_query_controller.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ void IssueQueryController::IssueQueriesInternal(size_t query_stride,
459459
#if USE_NEW_LOGGING_FORMAT
460460
std::stringstream ss;
461461
ss << "IssueQueryThread " << thread_idx
462-
<< " Ending early: Too many outstanding queries." << " issued "
463-
<< queries_issued_total << " outstanding "
462+
<< " Ending early: Too many outstanding queries."
463+
<< " issued " << queries_issued_total << " outstanding "
464464
<< queries_outstanding;
465465
MLPERF_LOG_ERROR(detail, "error_runtime", ss.str());
466466
#else
@@ -499,8 +499,8 @@ void IssueQueryController::IssueQueriesInternal(size_t query_stride,
499499
#if USE_NEW_LOGGING_FORMAT
500500
std::stringstream ss;
501501
ss << "IssueQueryThread " << thread_idx
502-
<< " Ending early: Max query count reached." << " query_count "
503-
<< queries_issued;
502+
<< " Ending early: Max query count reached."
503+
<< " query_count " << queries_issued;
504504
MLPERF_LOG_ERROR(detail, "error_runtime", ss.str());
505505
#else
506506
detail.Error("IssueQueryThread ", std::to_string(thread_idx),
@@ -519,8 +519,8 @@ void IssueQueryController::IssueQueriesInternal(size_t query_stride,
519519
#if USE_NEW_LOGGING_FORMAT
520520
std::stringstream ss;
521521
ss << "IssueQueryThread " << thread_idx
522-
<< " Ending early: Max test duration reached." << " duration_ns "
523-
<< duration.count();
522+
<< " Ending early: Max test duration reached."
523+
<< " duration_ns " << duration.count();
524524
MLPERF_LOG_ERROR(detail, "error_runtime", ss.str());
525525
#else
526526
detail.Error("IssueQueryThread ", std::to_string(thread_idx),

loadgen/logging.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ void Logger::CollectTlsLoggerStats(TlsLogger* tls_logger) {
812812
if (max_entry_vector_size > kTlsLogReservedEntryCount) {
813813
#if USE_NEW_LOGGING_FORMAT
814814
std::stringstream msg;
815-
msg << "Logging allocation detected:" << " tid: " << tls_logger->Tid()
815+
msg << "Logging allocation detected:"
816+
<< " tid: " << tls_logger->Tid()
816817
<< " reserved_entries: " << kTlsLogReservedEntryCount
817818
<< " max_entries: " << max_entry_vector_size;
818819
MLPERF_LOG_WARNING((*this), "warning_generic_message", msg.str());

loadgen/logging.h

+33-18
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,26 @@ class ChromeTracer {
119119
void AddCompleteEvent(const std::string& name, uint64_t pid, uint64_t tid,
120120
PerfClock::time_point start, PerfClock::time_point end,
121121
const Args... args) {
122-
*out_ << "{\"name\":\"" << name << "\"," << "\"ph\":\"X\","
123-
<< "\"pid\":" << pid << "," << "\"tid\":" << tid << ","
122+
*out_ << "{\"name\":\"" << name << "\","
123+
<< "\"ph\":\"X\","
124+
<< "\"pid\":" << pid << ","
125+
<< "\"tid\":" << tid << ","
124126
<< "\"ts\":" << Micros(start - origin_).count() << ","
125-
<< "\"dur\":" << Micros(end - start).count() << "," << "\"args\":{";
127+
<< "\"dur\":" << Micros(end - start).count() << ","
128+
<< "\"args\":{";
126129
AddArgs(args...);
127130
*out_ << "}},\n";
128131
}
129132

130133
template <typename... Args>
131134
void AddAsyncBeginEvent(const std::string& name, uint64_t pid, uint64_t id,
132135
PerfClock::time_point time, const Args... args) {
133-
*out_ << "{\"name\":\"" << name << "\"," << "\"cat\":\"default\","
134-
<< "\"ph\":\"b\"," << "\"pid\":" << pid << "," << "\"id\":" << id
135-
<< "," << "\"ts\":" << Micros(time - origin_).count() << ","
136+
*out_ << "{\"name\":\"" << name << "\","
137+
<< "\"cat\":\"default\","
138+
<< "\"ph\":\"b\","
139+
<< "\"pid\":" << pid << ","
140+
<< "\"id\":" << id << ","
141+
<< "\"ts\":" << Micros(time - origin_).count() << ","
136142
<< "\"args\":{";
137143
AddArgs(args...);
138144
*out_ << "}},\n";
@@ -141,9 +147,12 @@ class ChromeTracer {
141147
template <typename... Args>
142148
void AddAsyncInstantEvent(const std::string& name, uint64_t pid, uint64_t id,
143149
PerfClock::time_point time, const Args... args) {
144-
*out_ << "{\"name\":\"" << name << "\"," << "\"cat\":\"default\","
145-
<< "\"ph\":\"n\"," << "\"pid\":" << pid << "," << "\"id\":" << id
146-
<< "," << "\"ts\":" << Micros(time - origin_).count() << ","
150+
*out_ << "{\"name\":\"" << name << "\","
151+
<< "\"cat\":\"default\","
152+
<< "\"ph\":\"n\","
153+
<< "\"pid\":" << pid << ","
154+
<< "\"id\":" << id << ","
155+
<< "\"ts\":" << Micros(time - origin_).count() << ","
147156
<< "\"args\":{";
148157
AddArgs(args...);
149158
*out_ << "}},\n";
@@ -152,15 +161,19 @@ class ChromeTracer {
152161
template <typename... Args>
153162
void AddAsyncEndEvent(const std::string& name, uint64_t pid, uint64_t id,
154163
PerfClock::time_point time) {
155-
*out_ << "{\"name\":\"" << name << "\"," << "\"cat\":\"default\","
156-
<< "\"ph\":\"e\", " << "\"pid\":" << pid << "," << "\"id\":" << id
157-
<< "," << "\"ts\":" << Micros(time - origin_).count() << "},\n";
164+
*out_ << "{\"name\":\"" << name << "\","
165+
<< "\"cat\":\"default\","
166+
<< "\"ph\":\"e\", "
167+
<< "\"pid\":" << pid << ","
168+
<< "\"id\":" << id << ","
169+
<< "\"ts\":" << Micros(time - origin_).count() << "},\n";
158170
}
159171

160172
template <typename... Args>
161173
void AddCounterEvent(const std::string& name, uint64_t pid,
162174
PerfClock::time_point time, const Args... args) {
163-
*out_ << "{\"name\":\"" << name << "\"," << "\"ph\": \"C\","
175+
*out_ << "{\"name\":\"" << name << "\","
176+
<< "\"ph\": \"C\","
164177
<< "\"pid\":" << pid << ","
165178
<< "\"ts\":" << Micros(time - origin_).count() << ","
166179
<< "\"args\":{ ";
@@ -720,13 +733,15 @@ void AsyncLog::LogDetail(const std::string& key, const T& value,
720733
}
721734
auto time_ns = (log_detail_time_ - log_origin_).count();
722735
for (auto os : detail_streams) {
723-
*os << ":::MLLOG {" << "\"key\": " << ArgValueTransform(key) << ", "
736+
*os << ":::MLLOG {"
737+
<< "\"key\": " << ArgValueTransform(key) << ", "
724738
<< "\"value\": " << ArgValueTransform(value) << ", "
725739
<< "\"time_ms\": " << ArgValueTransform(time_ns / 1000000ULL) << "."
726740
<< std::setfill('0') << std::setw(6)
727741
<< ArgValueTransform(time_ns % 1000000ULL) << ", "
728742
<< "\"namespace\": \"mlperf::logging\", "
729-
<< "\"event_type\": \"POINT_IN_TIME\", " << "\"metadata\": {"
743+
<< "\"event_type\": \"POINT_IN_TIME\", "
744+
<< "\"metadata\": {"
730745
<< "\"is_error\": " << ArgValueTransform(error_flagged_) << ", "
731746
<< "\"is_warning\": " << ArgValueTransform(warning_flagged_) << ", "
732747
<< "\"file\": \"" << file_name << "\", "
@@ -755,9 +770,9 @@ void AsyncLog::LogDetail(const std::string& message, const Args... args) {
755770
detail_streams.pop_back();
756771
}
757772
for (auto os : detail_streams) {
758-
*os << "\"pid\": " << current_pid_ << ", " << "\"tid\": " << current_tid_
759-
<< ", " << "\"ts\": " << (log_detail_time_ - log_origin_).count()
760-
<< "ns : ";
773+
*os << "\"pid\": " << current_pid_ << ", "
774+
<< "\"tid\": " << current_tid_ << ", "
775+
<< "\"ts\": " << (log_detail_time_ - log_origin_).count() << "ns : ";
761776
if (error_flagged_) {
762777
*os << "ERROR : ";
763778
} else if (warning_flagged_) {

0 commit comments

Comments
 (0)