Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Parameters in Kedro Not Working as Expected #4437

Open
fpiedrah opened this issue Jan 22, 2025 · 2 comments
Open

Runtime Parameters in Kedro Not Working as Expected #4437

fpiedrah opened this issue Jan 22, 2025 · 2 comments
Labels
Community Issue/PR opened by the open-source community

Comments

@fpiedrah
Copy link

Description

Runtime parameters in Kedro are not being recognized when passed via --params in the CLI.

Context

I am trying to pass runtime parameters for model_name and model_identifier, with default values specified in a global file. However, Kedro does not recognize the runtime parameters and always falls back to the global defaults. If only the runtime parameter is provided, Kedro returns an error.

My parameters.yml file:

model:
  name: "${runtime_params:model_name}"
  identifier: "${runtime_params:model_identifier}"

When running:

kedro run --params model_name=llama,model_identifier=meta-llama/Llama-3.1-8

I get the error:

InterpolationResolutionError: Runtime parameter 'model_name' not found and no default value provided.

This prevents overriding these values dynamically at runtime.

Steps to Reproduce

  1. Define parameters.yml with runtime parameters:

    model:
      name: "${runtime_params:model_name}"
      identifier: "${runtime_params:model_identifier}"
  2. Run the pipeline with:

    kedro run --params model_name=llama,model_identifier=meta-llama/Llama-3.1-8
  3. Get the following error:

    InterpolationResolutionError: Runtime parameter 'model_name' not found and no default value provided.
    

Expected Result

Runtime parameters should be injected when passed via --params in the CLI.

Actual Result

InterpolationResolutionError: Runtime parameter 'model_name' not found and no default value provided.

Your Environment

  • Conda version: 24.9.2
  • Kedro version (kedro -V): 0.19.10
  • Python version (python -V): 3.12.7
  • Operating system: macOS Sonoma

I also made a change by commenting out parts of the settings.py file. While I don't believe this is related, I’m including my settings.py file:

from pathlib import Path  # noqa: E402
from kedro.config import OmegaConfigLoader  # noqa: E402

CONF_SOURCE = "configuration"
CONFIG_LOADER_CLASS = OmegaConfigLoader

CONFIG_LOADER_ARGS = {
    "base_env": "base",
    "default_run_env": "local",
}
@merelcht merelcht added the Community Issue/PR opened by the open-source community label Jan 22, 2025
@github-project-automation github-project-automation bot moved this to Wizard inbox in Kedro Wizard 🪄 Jan 22, 2025
@Galileo-Galilei
Copy link
Member

I think, but we should confirm with @ankatiyar (If I remember correctly she was the one who implemented runtime_params resolver) that this specific resolver does not work inside parameters.yml but only inside catalog.yml. I don't remember the rationale and hopefully someone can step in to explain, but I understand this behaviour is confusing.

I also tag @astrojuanlu as I think this is part of another discussion about unifying globals /runtime / "normal" parameters and clarifying what is allowed or not (preferably before 0.20 😉)

@ankatiyar
Copy link
Contributor

Hi, sorry I missed the tag earlier. So the runtime_params: resolver should work in the parameters.yml file. The only place it doesn't work is in globals.yml but the error message should say something like : UnsupportedInterpolationType: The runtime_params: resolver is not supported for globals.

I've tried to reproduce the error with the information mentioned above and the runtime parameters work for me as expected. Have you been able to resolve this issue in the mean time @fpiedrah? I would like to see the full stacktrace if it's possible otherwise?

@ankatiyar ankatiyar moved this from Wizard inbox to Needs more info in Kedro Wizard 🪄 Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Issue/PR opened by the open-source community
Projects
Status: Needs more info
Development

No branches or pull requests

4 participants