MCPcopy Create free account
hub / github.com/ByteDance-Seed/Triton-distributed / CSVWriter

Class CSVWriter

python/little_kernel/benchmark/utils.py:140–173  ·  view source on GitHub ↗

Unified CSV result writer with metadata header.

Source from the content-addressed store, hash-verified

138
139
140class CSVWriter:
141 """Unified CSV result writer with metadata header."""
142
143 def __init__(self, filename, headers, gpu_info=None, benchmark_name=None):
144 self.filename = filename
145 self.headers = headers
146 self.f = open(filename, "w", newline="")
147 self.writer = csv.writer(self.f)
148
149 # Write metadata as comments
150 if gpu_info:
151 self.f.write(f"# GPU: {gpu_info['name']}\n")
152 self.f.write(f"# SM Count: {gpu_info['sm_count']}\n")
153 self.f.write(f"# SM Arch: {gpu_info['sm_arch']}\n")
154 self.f.write(f"# Clock: {gpu_info['clock_mhz']} MHz\n")
155 if benchmark_name:
156 self.f.write(f"# Benchmark: {benchmark_name}\n")
157 self.f.write(f"# Date: {datetime.datetime.now().isoformat()}\n")
158
159 self.writer.writerow(headers)
160 self.f.flush()
161
162 def writerow(self, row):
163 self.writer.writerow(row)
164 self.f.flush()
165
166 def close(self):
167 self.f.close()
168
169 def __enter__(self):
170 return self
171
172 def __exit__(self, *args):
173 self.close()
174
175
176# =============================================================================

Callers 15

run_bandwidth_benchmarkFunction · 0.90
run_stride_benchmarkFunction · 0.90
run_latency_benchmarkFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected