TECHNOLOGY

Kedro environment overrides: a partial model mapping can discard inherited parameters

In this article
THE QUICK TAKE

An environment override is interpreted through its merge strategy; inspect the resolved mapping, not only the edited leaf.

The override that changes more than intended

A base configuration places learning rate, optimizer name and regularization beneath a model key. A staging environment defines only the learning rate under that same key. The author expects every other setting to be inherited. The training node instead receives a smaller mapping and may fail or fall back to defaults inside application code.

The edited file is therefore insufficient evidence of the experiment’s actual parameters. The important artifact is the configuration produced after environment loading, interpolation and application-level interpretation have finished.

Understand the environment boundary

Kedro’s configuration guide explains the base environment and overriding environments. Their purpose is convenient reuse, but inheritance is governed by explicit loading rules rather than an intuitive promise to preserve every nested field.

In the example, the shared top-level model key is the collision point. Reviewing only the learning-rate value misses the possibility that the rest of the original mapping has been replaced. This can alter initialization or preprocessing as well as optimization.

Choose the intended merge behavior

The merge strategy documentation distinguishes destructive and soft merging across environments. Under destructive merging, an overriding top-level key replaces the corresponding base entry. A soft strategy supports nested merging for a configuration type.

Select the strategy because it matches the project’s ownership model. Sometimes complete replacement is desirable: inheriting an obsolete optimizer option could be more dangerous than requiring a complete mapping. Soft merging is not automatically the correct policy for every catalog or parameter collection.

Examine the loader that actually runs

The OmegaConfigLoader API exposes merge strategy and environment configuration. A standalone notebook loader can be configured differently from the project’s normal run. Compare those settings before treating notebook inspection as proof of production behavior.

Check the resolved model subtree in a controlled environment, excluding credentials. Validate required fields and allowed combinations at the application boundary. This is related to explicit schema contracts: syntactically valid configuration can still describe an unintended experiment.

Preserve the experimental explanation

Store the effective non-sensitive parameters with the model result, together with the configuration revision and selected environment. That record allows a reviewer to distinguish a deliberately removed setting from an accidental inheritance assumption.

When reproducing a run, restore random-state replay separately. Correct configuration merging does not restore random generators, and restored generators do not repair a missing optimizer setting. Both belong to an explanation of why a repeated experiment should behave comparably.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles