From a7155883a9e332431ce5fe7ae6711526d8ed664e Mon Sep 17 00:00:00 2001 From: braf Date: Mon, 9 Dec 2024 23:10:45 +0000 Subject: [PATCH] Fixing codeQL issues --- genai-perf/genai_perf/checkpoint/checkpoint.py | 1 - genai-perf/genai_perf/config/generate/perf_analyzer_config.py | 2 +- genai-perf/genai_perf/measurements/model_constraints.py | 2 +- genai-perf/genai_perf/measurements/run_config_measurement.py | 2 -- genai-perf/genai_perf/measurements/run_constraints.py | 2 +- genai-perf/genai_perf/subcommand/analyze.py | 2 +- genai-perf/tests/test_perf_analyzer_config.py | 2 +- 7 files changed, 5 insertions(+), 8 deletions(-) diff --git a/genai-perf/genai_perf/checkpoint/checkpoint.py b/genai-perf/genai_perf/checkpoint/checkpoint.py index 9568a1c0..c4541449 100644 --- a/genai-perf/genai_perf/checkpoint/checkpoint.py +++ b/genai-perf/genai_perf/checkpoint/checkpoint.py @@ -19,7 +19,6 @@ from genai_perf.config.input.config_command import ConfigCommand from genai_perf.config.run.results import Results from genai_perf.exceptions import GenAIPerfException -from genai_perf.types import CheckpointObject @dataclass(frozen=True) diff --git a/genai-perf/genai_perf/config/generate/perf_analyzer_config.py b/genai-perf/genai_perf/config/generate/perf_analyzer_config.py index 1432b9a4..ee4bfd06 100644 --- a/genai-perf/genai_perf/config/generate/perf_analyzer_config.py +++ b/genai-perf/genai_perf/config/generate/perf_analyzer_config.py @@ -17,7 +17,7 @@ from dataclasses import dataclass from enum import Enum, auto from pathlib import Path -from typing import Any, Dict, List, Optional +from typing import Any, List, Optional from genai_perf.config.generate.search_parameter import SearchUsage from genai_perf.config.input.config_command import ( diff --git a/genai-perf/genai_perf/measurements/model_constraints.py b/genai-perf/genai_perf/measurements/model_constraints.py index 6a74620b..496d30b4 100644 --- a/genai-perf/genai_perf/measurements/model_constraints.py +++ b/genai-perf/genai_perf/measurements/model_constraints.py @@ -13,7 +13,7 @@ # limitations under the License. from dataclasses import dataclass -from typing import Dict, Optional, Tuple, TypeAlias, Union +from typing import Optional from genai_perf.types import ConstraintName, Constraints diff --git a/genai-perf/genai_perf/measurements/run_config_measurement.py b/genai-perf/genai_perf/measurements/run_config_measurement.py index c4e65297..ca22ea89 100644 --- a/genai-perf/genai_perf/measurements/run_config_measurement.py +++ b/genai-perf/genai_perf/measurements/run_config_measurement.py @@ -24,7 +24,6 @@ ModelConfigMeasurements, ) from genai_perf.measurements.run_constraints import RunConstraints -from genai_perf.record.gpu_record import GPURecord from genai_perf.record.record import Record from genai_perf.types import ( CheckpointObject, @@ -33,7 +32,6 @@ GpuId, GpuMetricObjectives, GpuRecords, - MetricObjectives, ModelName, ModelWeights, PerfMetricName, diff --git a/genai-perf/genai_perf/measurements/run_constraints.py b/genai-perf/genai_perf/measurements/run_constraints.py index 96f8e068..aa886627 100644 --- a/genai-perf/genai_perf/measurements/run_constraints.py +++ b/genai-perf/genai_perf/measurements/run_constraints.py @@ -13,7 +13,7 @@ # limitations under the License. from dataclasses import dataclass -from typing import Dict, Optional, TypeAlias +from typing import Dict, Optional from genai_perf.measurements.model_constraints import ModelConstraints from genai_perf.types import ConstraintName, ModelName diff --git a/genai-perf/genai_perf/subcommand/analyze.py b/genai-perf/genai_perf/subcommand/analyze.py index 8b24aebd..64496403 100644 --- a/genai-perf/genai_perf/subcommand/analyze.py +++ b/genai-perf/genai_perf/subcommand/analyze.py @@ -62,7 +62,7 @@ run_perf_analyzer, ) from genai_perf.tokenizer import get_tokenizer -from genai_perf.types import GpuRecords, ModelObjectiveParameters +from genai_perf.types import ModelObjectiveParameters logger = logging.getLogger(__name__) diff --git a/genai-perf/tests/test_perf_analyzer_config.py b/genai-perf/tests/test_perf_analyzer_config.py index bd9f88e8..87cca6cc 100644 --- a/genai-perf/tests/test_perf_analyzer_config.py +++ b/genai-perf/tests/test_perf_analyzer_config.py @@ -14,7 +14,7 @@ import json import unittest -from unittest.mock import MagicMock, patch +from unittest.mock import patch from genai_perf import parser from genai_perf.checkpoint.checkpoint import checkpoint_encoder