Skip to content

Commit 8762169

Browse files
committed
Fixed num_default_workers saving, changed deps default in config wizard
1 parent 69a3389 commit 8762169

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/finn/interface/run_finn.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def run_setup_wizard(settings: FINNSettings) -> None:
324324
"directory. If relative, this path is "
325325
"searched for from the root of the used FINN repository / installation.\n"
326326
)
327-
settings.finn_deps = Prompt.ask("FINN_DEPS", default="deps")
327+
settings.finn_deps = Prompt.ask("FINN_DEPS", default="finn_deps")
328328
console.clear()
329329
console.print(
330330
"[bold]FINN_DEPS_DEFINITIONS[/bold] points to the YAML file "
@@ -338,11 +338,11 @@ def run_setup_wizard(settings: FINNSettings) -> None:
338338
console.print(
339339
"[bold]NUM_DEFAULT_WORKERS[/bold] specifies the number of "
340340
"workers to use in multithreaded contexts. By default "
341-
"this is set to 75% of your available CPU cores.\n"
342-
)
343-
settings.num_default_workers = IntPrompt.ask(
344-
"NUM_DEFAULT_WORKERS", default=settings.num_default_workers
341+
"if not set, this is set to 75% of your available CPU cores.\n"
342+
"Set this to -1 to leave this to automatic detection for each new run.\n"
343+
f"(Automatic detection would have set this to {settings.num_default_workers}).\n"
345344
)
345+
settings.num_default_workers = IntPrompt.ask("NUM_DEFAULT_WORKERS", default=-1)
346346
console.clear()
347347
console.print(
348348
"[bold]AUTOMATIC_DEPENDENCY_UPDATES[/bold] specifies whether FINN+ "
@@ -423,6 +423,10 @@ def prepare_finn(settings: FINNSettings, accept_defaults: bool, batch: bool = Fa
423423
if "PYTHONPATH" not in os.environ:
424424
os.environ["PYTHONPATH"] = ""
425425

426+
# Create FINN_BUILD_DIR if it doesnt exist yet
427+
if not settings.finn_build_dir.exists():
428+
settings.finn_build_dir.mkdir()
429+
426430
# Update / Install all dependencies
427431
if settings.automatic_dependency_updates:
428432
try:

src/finn/interface/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ def save(self, installation_independent: bool, path: Path | None = None) -> None
339339
del data["finn_custom_hls"]
340340
del data["finn_notebooks"]
341341
del data["finn_tests"]
342+
if self._num_default_workers == -1:
343+
# Dont save this if its set to automatic detection
344+
del data["num_default_workers"]
342345
with path.open("w+") as f:
343346
yaml.dump(data, f, yaml.Dumper)
344347

0 commit comments

Comments
 (0)