mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-06-19 15:52:08 +00:00
delete optimum.habana import
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
1e56e5fe5c
commit
dbec20f98f
@ -4,8 +4,8 @@ import os
|
||||
import glob
|
||||
import time
|
||||
|
||||
from optimum.habana.utils import to_gb_rounded
|
||||
import habana_frameworks.torch as htorch
|
||||
import numpy as np
|
||||
|
||||
START_TS = None
|
||||
DBG_TRACE_FILENAME = os.environ.get("DBG_TRACE_FILENAME")
|
||||
@ -14,6 +14,19 @@ if "GRAPH_VISUALIZATION" in os.environ:
|
||||
os.remove(f)
|
||||
|
||||
|
||||
def to_gb_rounded(mem: float) -> float:
|
||||
"""
|
||||
Rounds and converts to GB.
|
||||
|
||||
Args:
|
||||
mem (float): memory in bytes
|
||||
|
||||
Returns:
|
||||
float: memory in GB rounded to the second decimal
|
||||
"""
|
||||
return np.round(mem / 1024**3, 2)
|
||||
|
||||
|
||||
def count_hpu_graphs():
|
||||
return len(glob.glob(".graph_dumps/*PreGraph*"))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user