MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / timeme

Function timeme

tests/benchmarks/unflatten_bench.py:100–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99
100def timeme():
101 print("--------------- timeit -----------------")
102 print(f'py ={timeit.Timer("py()", globals=globals()).timeit(number=1)}')
103 gc.collect()
104 get_accelerator().empty_cache()
105 print(f'cpp ={timeit.Timer("cpp()", globals=globals()).timeit(number=1)}')
106 gc.collect()
107 get_accelerator().empty_cache()
108 print(f'apex={timeit.Timer("apex()", globals=globals()).timeit(number=1)}')
109 gc.collect()
110 get_accelerator().empty_cache()
111
112
113#### line_profiler ####

Callers 1

unflatten_bench.pyFile · 0.70

Calls 2

get_acceleratorFunction · 0.90
empty_cacheMethod · 0.45

Tested by

no test coverage detected