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

[feature] sweeps #2171

Merged
merged 8 commits into from
Feb 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix the sweep logic
  • Loading branch information
winglian committed Jan 31, 2025
commit d8a4c6abbf6f1a15e35eaee4df1e3c6f2eab2887
16 changes: 13 additions & 3 deletions src/axolotl/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,22 @@ def generate_sweep_configs(base_config, sweeps_config):
for reg_combo in regular_combinations:
if paired_values:
for paired_set in paired_values:
new_config = {}
# new_config = deepcopy(base_config)
# Combine regular parameters with paired parameters
full_combo = {**dict(zip(param_names, reg_combo)), **paired_set}
all_combinations.append(full_combo)
for param_name, param_value in full_combo.items():
new_config[param_name] = param_value
print(new_config)
all_combinations.append(new_config)
else:
# If no paired values, just use regular combinations
all_combinations.append(dict(zip(param_names, reg_combo)))
# new_config = deepcopy(base_config)
new_config = {}
for param_name, param_value in zip(param_names, reg_combo):
new_config[param_name] = param_value
print(new_config)
all_combinations.append(new_config)

# randomize the order of trials
random.seed(42)
Expand All @@ -80,7 +90,7 @@ def generate_sweep_configs(base_config, sweeps_config):
result_configs = []
for combination in all_combinations:
new_config = deepcopy(base_config)
for param_name, param_value in zip(param_names, combination):
for param_name, param_value in combination.items():
new_config[param_name] = param_value
result_configs.append(new_config)

Expand Down