Skip to content

Commit

Permalink
format.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kzawora-intel committed Nov 6, 2024
1 parent 40882f3 commit 8e62377
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
20 changes: 8 additions & 12 deletions .jenkins/lm-eval-harness/test_lm_eval_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,14 @@ def report_performance(task, input_lens, output_lens, time, record_property):
context_lens = [i + o for i, o in zip(input_lens, output_lens)]
gen_tput = sum(output_lens) / time
all_lens = [input_lens, output_lens, context_lens]
min_input_tokens, min_output_tokens, min_context_tokens = [
min(x) for x in all_lens
]
max_input_tokens, max_output_tokens, max_context_tokens = [
max(x) for x in all_lens
]
mean_input_tokens, mean_output_tokens, mean_context_tokens = [
statistics.mean(x) for x in all_lens
]
stddev_input_tokens, stddev_output_tokens, stddev_context_tokens = [
statistics.stdev(x) for x in all_lens
]
min_input_tokens, min_output_tokens, min_context_tokens = (
min(x) for x in all_lens)
max_input_tokens, max_output_tokens, max_context_tokens = (
max(x) for x in all_lens)
mean_input_tokens, mean_output_tokens, mean_context_tokens = (
statistics.mean(x) for x in all_lens)
stddev_input_tokens, stddev_output_tokens, stddev_context_tokens = (
statistics.stdev(x) for x in all_lens)
msg = (
f'{task} | estimated average generation throughput: {gen_tput:.2f} tokens/s \n' # noqa: G004, E501
f'{task} | input_tokens | min: {min_input_tokens} | max: {max_input_tokens} | mean: {mean_input_tokens:.2f} | stddev: {stddev_input_tokens:.2f}\n' # noqa: E501
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ def get_gaudi_sw_version():
output = subprocess.run("hl-smi",
shell=True,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
capture_output=True,
env={"ENABLE_CONSOLE": "true"})
if output.returncode == 0 and output.stdout:
return output.stdout.split("\n")[2].replace(
Expand Down
2 changes: 1 addition & 1 deletion vllm/executor/ray_hpu_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RayHPUExecutor(DistributedGPUExecutor):
uses_ray: bool = True

def _init_executor(self) -> None:
self.forward_dag: Optional["ray.dag.CompiledDAG"] = None
self.forward_dag: Optional[ray.dag.CompiledDAG] = None
# If the env var is set, it uses the Ray's compiled DAG API
# which optimizes the control plane overhead.
# Run vLLM with VLLM_USE_RAY_COMPILED_DAG=1 to enable it.
Expand Down
2 changes: 1 addition & 1 deletion vllm/model_executor/layers/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def _get_bin_counts_and_mask(
return bin_counts, mask


class ApplyToppTopkScalar():
class ApplyToppTopkScalar:
"""
The original implementation of _apply_top_k_top_p is more general
as it uses vector topp, topk
Expand Down
7 changes: 3 additions & 4 deletions vllm/worker/hpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class Singleton(type):

def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton,
cls).__call__(*args, **kwargs)
cls._instances[cls] = super().__call__(*args, **kwargs)
return cls._instances[cls]


Expand Down Expand Up @@ -281,7 +280,7 @@ def precompute_indices_and_offsets(block_size, slot_mapping, is_prompt):
return indices, offsets


class HpuModelAdapter():
class HpuModelAdapter:

def __init__(self, model, block_size, dtype, enforce_eager):
self.model = model
Expand Down Expand Up @@ -1788,7 +1787,7 @@ def _maybe_wrap_in_hpu_graph(*args, **kwargs):
) if htorch.utils.internal.is_lazy() else HpuModelAdapter(*args, **kwargs)


class HabanaProfilerCounterHelper():
class HabanaProfilerCounterHelper:

def __init__(self):
self.niter = 0
Expand Down

0 comments on commit 8e62377

Please sign in to comment.