Skip to content

[Entrypoint] Update oneshot to post_train#1136

Closed
horheynm wants to merge 11 commits intomainfrom
post-train
Closed

[Entrypoint] Update oneshot to post_train#1136
horheynm wants to merge 11 commits intomainfrom
post-train

Conversation

@horheynm
Copy link
Copy Markdown

@horheynm horheynm commented Feb 11, 2025

Blocked on #1109 to obtain models without training_args

SUMMARY:

  • Update oneshot to post_train
  • Make post_train have its own pipeline, decoupled form main
  • Make post_train's input arguments only dependent on ModelArguments, DatasetArguments, and RecipeArguments. Any TrainingArguments-related input arg will raise an error. Ex. overwrite_output_dir.
  • Update any oneshot usage in the function name (run_oneshot_and_finetune), Enum attributes (RecipeStages), variable name (oneshot_model) to post_train`.
  • Update folder names from oneshot to post_train (ex. "tests/llmcompressor/transformers/oneshot/oneshot_configs")
  • Update cli command in setup.py
  • In stage-runner, in the logic to detect if post_train or train, change the order to detect post_train first (train is a subset, so currently train will always be detected if post_train).

TEST PLAN:

  • Pass existing tests
  • search oneshot using grep.

FOLLOWUPS:

  • Remove oneshot dependent code (ex. SessionMixin.apply)
  • Remove stage-runner

@github-actions
Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

George Ohashi added 2 commits February 11, 2025 08:49
or self.run_type == StageRunType.POST_TRAIN
):
return self.run_type
if StageRunType.POST_TRAIN.value in self.group:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

flip the order check if the config_name has "post_train" first before "train".

max_seq_length=MAX_SEQ_LENGTH,
num_calibration_samples=NUM_CALIBRATION_SAMPLES,
save_compressed=SAVE_COMPRESSED,
overwrite_output_dir=True,
Copy link
Copy Markdown
Author

@horheynm horheynm Feb 11, 2025

Choose a reason for hiding this comment

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

Only used in training args, not post-train dep args. Will raise an error if present

@dsikka
Copy link
Copy Markdown
Collaborator

dsikka commented Feb 11, 2025

we should be landing the entrypoint updates, independent of changing the naming from oneshot to post_train.

@horheynm horheynm changed the title [OneshotRefactor] Update oneshot to post_train [Entrypoint] Update oneshot to post_train Feb 19, 2025
main(model_args, data_args, recipe_args, training_args)


def oneshot(**kwargs):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you please redirect this to post_train with a deprecation warning?

@dsikka dsikka closed this Apr 23, 2025
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.

3 participants