Skip to content

A bad reference config fails every inference worker with no reason given #803

Description

@timlichtenberg

Problem description

proteus infer checks its reference config with os.path.isfile and nothing more (src/proteus/inference/inference.py, the block that resolves config['ref_config']). The file is copied into the output directory and handed to the workers without ever being read against the schema, so a mistake in it survives the whole setup.

The first worker is where it surfaces, and it surfaces badly. run_proteus in src/proteus/inference/objective.py writes the per-case config out of the reference file and runs proteus start as a subprocess with stdout=subprocess.DEVNULL and stderr=subprocess.STDOUT. The child does refuse an unrecognised key and does say which one, but it says it on stderr, and stderr follows stdout into /dev/null. What reaches the log is Failed to run PROTEUS for worker=0 iter=0; exit code 1, with nothing pointing at the reference config. Every worker then fails the same way, so a whole optimisation burns through its budget with no usable diagnosis.

The discarded output is not specific to this fault. Any reason a child run dies is thrown away the same way.

Expected behavior

The reference config is loaded through read_config_object at startup, next to the existing os.path.isfile check, so a typo stops the run before any worker is spawned and names the offending key.

Separately, when a child run fails, its output is captured and logged rather than discarded.

Evidence

The child reports the fault, and reports it exactly where the inference module has arranged not to look:

$ proteus start -c bad.toml --offline ; echo "exit=$?"
Error: Unrecognised configuration key in bad.toml:
  "not_a_real_key"
  This key is unrecognised, so setting it will have no effect. Check for typos or outdated option names.
exit=1

bad.toml is input/dummy.toml with one unrecognised key added. That message is on stderr, which run_proteus sends to /dev/null.

My computer

macOS on arm64, Python 3.12.

Additional notes

Two independent fixes here. Validating the reference config up front is the one that closes this specific hole. Capturing the child's output is worth doing on its own, since it applies to every way a worker run can fail.

Relevant people

@nichollsh

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingGrids/EnsemblesRelating to grids or forward modelsInterraIssue has been imported to the Interra Board projectPriority 1: criticalPriority level 1: highest priority – critical & fastSoftwareRelating to software and implementationimport

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions