Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install specific pynvml, and pp fix #5

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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: 8 additions & 7 deletions pytorch-client
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ exec 2>&1

model="llama"

pwd=`/bin/pwd`
pushd /opt/app-root/lib/python3.11/site-packages
find . -name METADATA | cpio -pdumv $pwd/instructlab-site-packages-metadata
popd

longopts=""
longopts+=" model:"

Expand Down Expand Up @@ -43,13 +38,19 @@ echo "model: $workflow"
git clone https://github.com/pytorch/benchmark.git
pushd benchmark
pip uninstall -y nvidia-ml-py
pip install pynvml
pip install --force-reinstall -v pynvml==11.5.3

pwd=`/bin/pwd`
pushd /opt/app-root/lib/python3.11/site-packages
find . -name METADATA | cpio -pdumv $pwd/instructlab-site-packages-metadata
popd

python run_benchmark.py test_bench --help
bench_cmd="python run_benchmark.py test_bench -m $model"
echo "About to run: $bench_cmd"
date +%s.%N >begin.txt
$bench_cmd >run_benchmark_output.txt
date +%s.%N >end.txt
rc=$?
date +%s.%N >end.txt
popd
exit $rc
4 changes: 3 additions & 1 deletion pytorch-post-process
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ def main():
log_sample(file_id, desc, names, sample)

for key in d['metrics'].keys():
if (re.search("metric=latencies$", key)):
if (re.search("metric=latencies$", key) and re.findall("[0-9]+(?:[.][0-9]+)?", str(d['metrics'][key])) ):
desc = {'source' : 'pytorch', 'class': 'count', 'type': 'latency-milliseconds'}
sample = {'begin': begin, 'end': end, 'value': d['metrics'][key]}
log_sample(file_id, desc, names, sample)
else:
print("skipping: " + key)

metric_file_name = finish_samples()
period['metric-files'].append(metric_file_name)
Expand Down