mirror of
https://github.com/nod-ai/SHARK-Studio.git
synced 2026-01-09 22:07:55 -05:00
(vicuna.py) Move enable_tracy_tracing outside of BenchmarkRunInfo (#2011)
This commit is contained in:
@@ -2277,14 +2277,14 @@ class BenchmarkRunInfo:
|
|||||||
print(f"Decode: {self.get_decode_time_ms():.2f} ms, {self.get_decode_speed():.2f} tokens/s")
|
print(f"Decode: {self.get_decode_time_ms():.2f} ms, {self.get_decode_speed():.2f} tokens/s")
|
||||||
print(f"Decode end-2-end: {self.get_e2e_decode_speed():.2f} tokens/s (w/o prompt), {self.get_e2e_token_processing_speed():.2f} tokens/s (w/ prompt)")
|
print(f"Decode end-2-end: {self.get_e2e_decode_speed():.2f} tokens/s (w/o prompt), {self.get_e2e_token_processing_speed():.2f} tokens/s (w/ prompt)")
|
||||||
|
|
||||||
def enable_tracy_tracing():
|
def enable_tracy_tracing():
|
||||||
# Make tracy wait for a caputre to be collected before exiting.
|
# Make tracy wait for a caputre to be collected before exiting.
|
||||||
environ["TRACY_NO_EXIT"] = "1"
|
environ["TRACY_NO_EXIT"] = "1"
|
||||||
|
|
||||||
if "IREE_PY_RUNTIME" not in environ or environ["IREE_PY_RUNTIME"] != "tracy":
|
if "IREE_PY_RUNTIME" not in environ or environ["IREE_PY_RUNTIME"] != "tracy":
|
||||||
print("ERROR: Tracing enabled but tracy iree runtime not used.", file=sys.stderr)
|
print("ERROR: Tracing enabled but tracy iree runtime not used.", file=sys.stderr)
|
||||||
print("Set the IREE_PY_RUNTIME=tracy environment variable.", file=sys.stderr)
|
print("Set the IREE_PY_RUNTIME=tracy environment variable.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def print_aggregate_stats(run_infos: list[BenchmarkRunInfo]) -> None:
|
def print_aggregate_stats(run_infos: list[BenchmarkRunInfo]) -> None:
|
||||||
@@ -2469,4 +2469,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if args.enable_microbenchmark:
|
if args.enable_microbenchmark:
|
||||||
print("\n### Final Statistics ###")
|
print("\n### Final Statistics ###")
|
||||||
print_aggregate_stats(benchmark_run_infos)
|
print_aggregate_stats(benchmark_run_infos)
|
||||||
|
|||||||
Reference in New Issue
Block a user