Skip to content

Commit

Permalink
fix llamacpp and windows libuv
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Nov 26, 2024
1 parent 66c837b commit 30a4472
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions optimum_benchmark/launchers/torchrun/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class TorchrunLauncher(Launcher[TorchrunConfig]):
def __init__(self, config: TorchrunConfig):
super().__init__(config)

if sys.platform == "win32":
self.logger.info("\t+ Disabline libuv on Windows")
os.environ["USE_LIBUV"] = "0"

if get_start_method(allow_none=True) != self.config.start_method:
self.logger.info(f"\t+ Setting multiprocessing start method to {self.config.start_method}")
set_start_method(self.config.start_method, force=True)
Expand Down Expand Up @@ -101,7 +105,7 @@ def launch(self, worker: Callable[..., BenchmarkReport], worker_args: List[Any])
raise RuntimeError(f"Received an unexpected response from isolated process: {output}")

self.logger.info("\t+ Aggregating reports from all rank processes")
report = BenchmarkReport.aggregate(reports)
report = BenchmarkReport.aggregate_across_processes(reports)
return report


Expand Down Expand Up @@ -155,9 +159,7 @@ def entrypoint(worker: Callable[..., BenchmarkReport], worker_args: List[Any], l
else:
setup_logging(level="ERROR", to_file=log_to_file, prefix=f"RANK-PROCESS-{rank}")

if sys.platform == "win32":
logger.info("\t+ Disabline libuv on Windows")
os.environ["USE_LIBUV"] = "0"


if torch.cuda.is_available():
logger.info(f"\t+ Setting torch.distributed cuda device to {rank}")
Expand Down
4 changes: 2 additions & 2 deletions tests/configs/_gguf_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ hydra:
mode: MULTIRUN
sweeper:
params:
backend.model: ggml-org/models
backend.task: text-generation,feature-extraction
backend.model: QuantFactory/gpt2-GGUF
backend.filename: gpt2.Q4_0.gguf
backend.filename: tinyllamas/stories15M-q8_0.gguf

0 comments on commit 30a4472

Please sign in to comment.