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

[One Shot] Specify recipe_args on CLI #1902

Merged
merged 9 commits into from
Jan 9, 2024
Merged

[One Shot] Specify recipe_args on CLI #1902

merged 9 commits into from
Jan 9, 2024

Conversation

Satrat
Copy link
Contributor

@Satrat Satrat commented Dec 13, 2023

Requested by research, adding a CLI parameter for passing recipe args

Example Usage

test_recipe.yaml

test_stage:
  obcq_modifiers:
    SparseGPTModifier:
      sparsity: eval(use_sparsity)
      block_size: 128
      sequential_update: False
      quantize: False
      targets: [
        "re:model.layers.\\d+$"
      ]

To run:

python src/sparseml/transformers/sparsification/obcq/obcq.py Xenova/llama2.c-stories15M open_platypus --recipe_args use_sparsity=0.7 --recipe test_recipe.yaml

Update: The output recipe.yaml will now reflect the evaluated argument value. Also added this recipe_arg feature to the finetuning script

bfineran
bfineran previously approved these changes Dec 13, 2023
Copy link
Contributor

@natuan natuan left a comment

Choose a reason for hiding this comment

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

@Satrat I've tried out this PR, and while the overwriting of recipe args works as expected, the saved recipe still has the variable argument, i.e. without specific values. This I think will break other flows (e.g. evaluation). Could you please check that from your side?

@Satrat
Copy link
Contributor Author

Satrat commented Dec 14, 2023

@Satrat I've tried out this PR, and while the overwriting of recipe args works as expected, the saved recipe still has the variable argument, i.e. without specific values. This I think will break other flows (e.g. evaluation). Could you please check that from your side?

Good catch! Yes we definitely want the output to reflect the evaluated args, I'll look into it further tomorrow

@Satrat
Copy link
Contributor Author

Satrat commented Dec 15, 2023

@Satrat I've tried out this PR, and while the overwriting of recipe args works as expected, the saved recipe still has the variable argument, i.e. without specific values. This I think will break other flows (e.g. evaluation). Could you please check that from your side?

Good catch! Yes we definitely want the output to reflect the evaluated args, I'll look into it further tomorrow

Just an update on this: I had hoped this would be a quick bug fix, but trying to fix this revealed the new modifier refactor doesn't handle evaluated args correctly during export, so its going to be a bit more involved to fix. I opened a ticket to track: https://app.asana.com/0/1203126676641557/1206186419092269/f and will leave this PR open until its resolved

dbogunowicz
dbogunowicz previously approved these changes Dec 18, 2023
@Satrat Satrat dismissed stale reviews from dbogunowicz and bfineran via 72b867d January 8, 2024 16:47
Copy link
Member

@rahul-tuli rahul-tuli left a comment

Choose a reason for hiding this comment

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

LGTM!

@Satrat Satrat merged commit c35206d into main Jan 9, 2024
12 checks passed
@Satrat Satrat deleted the cli_recipe_args branch January 9, 2024 16:23
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.

None yet

6 participants