Voice et bot modif

This commit is contained in:
pi 2026-06-16 17:09:34 +00:00
parent 189d56026b
commit 7333a22bcd
10774 changed files with 634644 additions and 933308 deletions

View file

@ -584,7 +584,7 @@ def get_args(rank=0):
"--device",
type=str,
default="cuda" if torch.cuda.is_available() else "cpu",
choices=["cpu", "cuda", "rocm"],
choices=["cpu", "cuda"],
)
parser.add_argument("-id", "--device-id", type=int, default=0)
parser.add_argument("-w", "--warmup-runs", type=int, default=5)
@ -622,9 +622,6 @@ def get_args(rank=0):
setattr(args, "execution_provider", f"{args.device.upper()}ExecutionProvider") # noqa: B010
if args.execution_provider == "CUDAExecutionProvider":
args.execution_provider = (args.execution_provider, {"device_id": rank})
elif args.execution_provider == "ROCMExecutionProvider":
args.execution_provider = (args.execution_provider, {"device_id": rank})
args.device = "cuda"
# Check that paths have been specified for any benchmarking with ORT
if args.benchmark_type == "hf-ort":

View file

@ -109,7 +109,7 @@ def get_args():
"--device",
type=str,
required=True,
choices=["cpu", "cuda", "rocm"],
choices=["cpu", "cuda"],
help="Device to benchmark models",
)

View file

@ -12,6 +12,7 @@ import shutil
import subprocess
import sys
import tempfile
import warnings
from itertools import chain
import onnx
@ -234,6 +235,7 @@ def run_torchscript_separate_export(
opset_version=torch_export_onnx_opset_version,
do_constant_folding=True,
verbose=args.verbose,
dynamo=False,
)
# Check decoder_model.onnx and save all external data to one file
@ -293,6 +295,7 @@ def run_torchscript_separate_export(
opset_version=torch_export_onnx_opset_version,
do_constant_folding=True,
verbose=args.verbose,
dynamo=False,
)
# Check decoder_with_past_model.onnx and save all external data to one file
@ -631,7 +634,7 @@ def get_args():
"--execution_provider",
required=False,
default="cpu",
choices=["cpu", "cuda", "rocm"],
choices=["cpu", "cuda"],
help="Execution provider to verify parity with",
)
@ -670,6 +673,8 @@ def get_args():
blockwise_group = parser.add_argument_group("blockwise (4-bit quantization)")
parser.add_argument("--bits", default=4, type=int, help="the target bits to represent weight")
blockwise_group.add_argument(
"--block_size",
required=False,
@ -799,6 +804,12 @@ def get_args():
def main():
warnings.warn(
"This example is deprecated. Use the Olive recipe instead: "
"https://github.com/microsoft/olive-recipes/tree/main",
DeprecationWarning,
stacklevel=2,
)
if version.parse(torch.__version__) < version.parse("2.2.0"):
logger.error(f"Detected PyTorch version {torch.__version__}. Please upgrade and use v2.2.0 or newer.")
return
@ -988,6 +999,7 @@ def main():
model = onnx.load_model(fp_path, load_external_data=True)
quant = MatMulNBitsQuantizer(
model=model,
bits=args.bits,
block_size=args.block_size,
is_symmetric=True,
accuracy_level=args.int4_accuracy_level,

View file

@ -228,7 +228,7 @@ def get_args(argv: list[str]):
"--execution_provider",
required=False,
default="cpu",
choices=["cpu", "cuda", "rocm"],
choices=["cpu", "cuda"],
help="Execution provider to verify parity with",
)