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

Function cprofileme

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

Source from the content-addressed store, hash-verified

77
78
79def cprofileme():
80 print("--------------- cProfile -----------------")
81 print("py")
82 cProfile.run("py()", sort=-1)
83 gc.collect()
84 get_accelerator().empty_cache()
85 print("cpp")
86 cProfile.run("cpp()", sort=-1)
87 gc.collect()
88 get_accelerator().empty_cache()
89 print("apex")
90 cProfile.run("apex()", sort=-1)
91 gc.collect()
92 get_accelerator().empty_cache()
93
94
95#### timeit ####

Callers 1

unflatten_bench.pyFile · 0.70

Calls 3

get_acceleratorFunction · 0.90
runMethod · 0.45
empty_cacheMethod · 0.45

Tested by

no test coverage detected