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

Validate the configuration produced by LlamaTune inverse_transform() #806

Closed
wants to merge 12 commits into from
2 changes: 2 additions & 0 deletions mlos_core/mlos_core/spaces/adapters/llamatune.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat unrelated, we should add "quantization + llamatune" tests as well.

Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def inverse_transform(self, configurations: pd.DataFrame) -> pd.DataFrame:
self.target_parameter_space,
vector=target_config_vector,
)
self.target_parameter_space.check_configuration(target_config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might just need to clip them to the range in the case that it's too large (e.g., due to quantization issues).
Are there other failure cases than that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a slightly closer look at this.
max_unique_values_per_param is forcing the lower dimensions space to be UniformIntegerHyperparatmers, but the vector produced that is then dot producted with the approximate inverted matrix returns floats.

So, I think there's an additional scaling operation required to put that vector back into the max_unique_values_per_param range when that option is not None.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've added the q_scaler inverse transform here as well, which makes the values look much better, but one is still out of bounds. I think it's maybe just needing clipping either there, or in a previous step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest -n0 mlos_bench/mlos_bench/tests/optimizers/llamatune_opt_test.py

to reproduce

# target_config.check_valid_configuration() # for ConfigSpace 1.0

target_configurations.append(target_config)

Expand Down
Loading