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

Fix generating environment variables from job configurations for multi-level nesting #1967

Merged

Conversation

alaydshah
Copy link
Contributor

If the configuration path for config_sub_key is as follows:

config_parent_key:
    config_sub_key: config_sub_key_value

Then the equivalent environment variable should be as follows:
FEDML_ENV_uppercase($config_parent_key)_uppercase($config_sub_key)

This approach should be implemented recursively for any depth of nesting. However, there is currently a bug for nesting beyond two layers where it skips earlier level's config keys.

Example Job yaml multi-level nesting:

level-1:
  level-2a:
    level-3a: $3000   
    level-3b: A100-80G

  level-2b: $3000
  level-2c: A100-80G

Before this fix / Current Bug:

env_name_value_map

'FEDML_ENV_LEVEL-2A_LEVEL-3A' = '$3000'
'FEDML_ENV_LEVEL-2A_LEVEL-3B' = 'A100-80G'
'FEDML_ENV_LEVEL-1_LEVEL-2B' = '$3000'
'FEDML_ENV_LEVEL-1_LEVEL-2C' = 'A100-80G'

After this fix:

env_name_value_map

'FEDML_ENV_LEVEL-1_LEVEL-2A_LEVEL-3A' = '$3000'
'FEDML_ENV_LEVEL-1_LEVEL-2A_LEVEL-3B' =  'A100-80G'
'FEDML_ENV_LEVEL-1_LEVEL-2B' = '$3000'
'FEDML_ENV_LEVEL-1_LEVEL-2C' = 'A100-80G'

@alaydshah alaydshah merged commit 48c7d41 into dev/v0.7.0 Mar 15, 2024
1 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants