Skip to content
Open
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
5 changes: 4 additions & 1 deletion strata_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import math
import os
import re
import shlex
import subprocess
import sys
import time
Expand Down Expand Up @@ -1270,7 +1271,9 @@ def _bench_standard(a: argparse.Namespace, machine: bool) -> int:
from strata_cli.client import server_url
target = bench_standard.Target(server_url(url), key)
redact = bench_facts.redactor(key or "")
command = redact("strata " + " ".join(str(part) for part in (a.raw_argv or ["bench", "run", "--suite", "standard-v1"])))
parts = [str(part) for part in (a.raw_argv or ["bench", "run", "--suite", "standard-v1"])]
# quoted as the shell would take it back, so a --track-notes with spaces stays one argument (#4494)
command = redact("strata " + (subprocess.list2cmdline(parts) if os.name == "nt" else shlex.join(parts)))
declared = {"track": a.track, "track_notes": a.track_notes or "no notes given by the operator",
"model_revision": a.model_revision, "source_revision": a.source_revision,
"tokenizer_revision": a.tokenizer_revision, "quantization": a.quantization,
Expand Down
3 changes: 3 additions & 0 deletions tests/terminal/test_bench_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,9 @@ def test_the_options_reach_the_report(self):
self.assertEqual(doc["hardware"]["background_workloads"], ["browser open"])
self.assertEqual(doc["software"]["build_options"], ["cuda", "sm86"])
self.assertTrue(doc["run"]["optional_concurrency"])
# #4494: the command is quoted as a shell would take it back, so a note with spaces stays one argument
quoted = '"0.2.0 release, setup choices"' if os.name == "nt" else "'0.2.0 release, setup choices'"
self.assertIn("--track-notes " + quoted, doc["run"]["command"])
self.assertIn("--track default", doc["run"]["command"])
self.assertTrue(doc["run"]["command"].startswith("strata bench run"))

Expand Down
Loading