MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / benchmark

Method benchmark

benchmarks/base_classes.py:166–183  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

164 )
165
166 def benchmark(self, args):
167 flush()
168
169 print(f"[INFO] {self.pipe.__class__.__name__}: Running benchmark with: {vars(args)}\n")
170
171 time = benchmark_fn(self.run_inference, self.pipe, args) # in seconds.
172 memory = bytes_to_giga_bytes(torch.cuda.max_memory_allocated()) # in GBs.
173 benchmark_info = BenchmarkInfo(time=time, memory=memory)
174
175 pipeline_class_name = str(self.pipe.__class__.__name__)
176 flush()
177 csv_dict = generate_csv_dict(
178 pipeline_cls=pipeline_class_name, ckpt=self.lora_id, args=args, benchmark_info=benchmark_info
179 )
180 filepath = self.get_result_filepath(args)
181 write_to_csv(filepath, csv_dict)
182 print(f"Logs written to: {filepath}")
183 flush()
184
185
186class ImageToImageBenchmark(TextToImageBenchmark):

Callers

nothing calls this directly

Calls 7

get_result_filepathMethod · 0.95
flushFunction · 0.90
benchmark_fnFunction · 0.90
bytes_to_giga_bytesFunction · 0.90
BenchmarkInfoClass · 0.90
generate_csv_dictFunction · 0.90
write_to_csvFunction · 0.90

Tested by

no test coverage detected