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

Method benchmark

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

Source from the content-addressed store, hash-verified

102 )
103
104 def benchmark(self, args):
105 flush()
106
107 print(f"[INFO] {self.pipe.__class__.__name__}: Running benchmark with: {vars(args)}\n")
108
109 time = benchmark_fn(self.run_inference, self.pipe, args) # in seconds.
110 memory = bytes_to_giga_bytes(torch.cuda.max_memory_allocated()) # in GBs.
111 benchmark_info = BenchmarkInfo(time=time, memory=memory)
112
113 pipeline_class_name = str(self.pipe.__class__.__name__)
114 flush()
115 csv_dict = generate_csv_dict(
116 pipeline_cls=pipeline_class_name, ckpt=args.ckpt, args=args, benchmark_info=benchmark_info
117 )
118 filepath = self.get_result_filepath(args)
119 write_to_csv(filepath, csv_dict)
120 print(f"Logs written to: {filepath}")
121 flush()
122
123
124class TurboTextToImageBenchmark(TextToImageBenchmark):

Callers

nothing calls this directly

Calls 7

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
get_result_filepathMethod · 0.45

Tested by

no test coverage detected