Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,10 @@ RUN chmod +x /opt/triton-model-analyzer/nvidia_entrypoint.sh
RUN chmod +x build_wheel.sh && \
./build_wheel.sh perf_analyzer true && \
rm -f perf_analyzer
RUN python3 -m pip install nvidia-pyindex && \
python3 -m pip install wheels/triton_model_analyzer-*-manylinux*.whl
# Install other pip packages
RUN python3 -m pip install coverage
RUN python3 -m pip install mypy
RUN python3 -m pip install types-PyYAML
RUN python3 -m pip install types-requests
RUN python3 -m pip install types-protobuf
RUN python3 -m pip install mkdocs
RUN python3 -m pip install mkdocs-htmlproofer-plugin==0.10.3
RUN python3 -m pip install yapf==0.32.0

# Install model analyzer and development dependencies
RUN python3 -m pip install --no-cache-dir wheels/triton_model_analyzer-*-manylinux*.whl && \
python3 -m pip install --no-cache-dir -r requirements-dev.txt

RUN apt-get install -y wkhtmltopdf

Expand Down
30 changes: 17 additions & 13 deletions experiments/experiment_config_command_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,26 @@ def make_config(data_path, model_name, other_args):
else:
checkpoint_dir = f"{data_path}/{model_name}"

# yapf: disable
args = [
'model-analyzer', 'profile',
'--profile-models', model_name,
'--model-repository', data_path,
'--checkpoint-directory', checkpoint_dir
"model-analyzer",
"profile",
"--profile-models",
model_name,
"--model-repository",
data_path,
"--checkpoint-directory",
checkpoint_dir,
]
args += other_args

if '-f' not in args and '--config-file' not in args:
args += ['-f', 'path-to-config-file']
if "-f" not in args and "--config-file" not in args:
args += ["-f", "path-to-config-file"]
yaml_content = convert_to_bytes("")
else:
index = args.index('-f') if '-f' in args else args.index('--config-file')
index = args.index("-f") if "-f" in args else args.index("--config-file")
yaml_file = args[index + 1]

with open(yaml_file, 'r') as f:
with open(yaml_file, "r") as f:
yaml_content = f.read()
yaml_content = convert_to_bytes(yaml_content)

Expand All @@ -65,10 +68,11 @@ def make_config(data_path, model_name, other_args):
config = ConfigCommandExperiment()
cli = CLI()
cli.add_subcommand(
cmd='profile',
help='Run model inference profiling based on specified CLI or '
'config options.',
config=config)
cmd="profile",
help="Run model inference profiling based on specified CLI or "
"config options.",
config=config,
)
cli.parse()
mock_config.stop()

Expand Down
31 changes: 15 additions & 16 deletions experiments/experiment_file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@ def write(self, checkpoint_data, profile_data, radius, min_initialized):
)
quick_best_measurement = profile_data.get_best_run_config_measurement()

# yapf: disable
writer.writerow({
"overall_num_measurements":
checkpoint_data.get_run_config_measurement_count(),
"overall_best_throughput":
overall_best_measurement.get_non_gpu_metric_value("perf_throughput"),
"quick_num_measurements":
profile_data.get_run_config_measurement_count(),
"missing_num_measurements":
checkpoint_data.get_missing_measurement_count(),
"quick_throughput":
quick_best_measurement.get_non_gpu_metric_value("perf_throughput"),
"radius": radius,
"min_initialized": min_initialized
})
# yapf: enable
writer.writerow(
{
"overall_num_measurements": checkpoint_data.get_run_config_measurement_count(),
"overall_best_throughput": overall_best_measurement.get_non_gpu_metric_value(
"perf_throughput"
),
"quick_num_measurements": profile_data.get_run_config_measurement_count(),
"missing_num_measurements": checkpoint_data.get_missing_measurement_count(),
"quick_throughput": quick_best_measurement.get_non_gpu_metric_value(
"perf_throughput"
),
"radius": radius,
"min_initialized": min_initialized,
}
)
except OSError as e:
raise TritonModelAnalyzerException(e)
23 changes: 14 additions & 9 deletions experiments/scripts/test_pa.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,15 +343,21 @@ def _add_results(self, config, results):
self._results.append((config, results))

def _get_cmd(self, config: RunConfigData):
# yapf: disable
cmd = [
"/usr/local/bin/perf_analyzer", "-v",
"-i", config.protocol,
"--measurement-mode", config.measurement_mode,
"-m", config.model,
"-b", str(config.batch_size),
"--concurrency-range", str(config.concurrency),
"--max-threads", str(config.max_threads)
"/usr/local/bin/perf_analyzer",
"-v",
"-i",
config.protocol,
"--measurement-mode",
config.measurement_mode,
"-m",
config.model,
"-b",
str(config.batch_size),
"--concurrency-range",
str(config.concurrency),
"--max-threads",
str(config.max_threads),
]
if config.protocol == "http":
cmd += ["-u", "localhost:8000"]
Expand All @@ -362,7 +368,6 @@ def _get_cmd(self, config: RunConfigData):
cmd += ["--async"]
else:
cmd += ["--sync"]
# yapf: enable
return cmd

def _get_dict_combos(self, config: dict):
Expand Down
107 changes: 0 additions & 107 deletions format.py

This file was deleted.

Loading
Loading